distcloud/distributedcloud/files/clean-dcorch
Gustavo Herzmann b7f31ee6b6 Migrate distributedcloud .deb from dl_hooks
Replace dl_hook with "src_path" and moves the 'files' folder
outside of the 'centos' directory.

Test Plan:
1. PASS - Successfully build distributedcloud package
2. PASS - Build an image and install it, checking if it includes the
          latest distributedcloud package.
3. PASS - Modify a source file, do a second subsequent build without
          using the clean option, install the image and verify that
          the build picks up the most recent .deb file by checking
          if the modification is present on the source file.

Story: 2010512
Task: 47108

Signed-off-by: Gustavo Herzmann <gustavo.herzmann@windriver.com>
Change-Id: I0f82689298e203e3655ec47cb1ab7683f440908a
2023-01-13 15:46:06 +00:00

24 lines
568 B
Bash

#!/bin/bash
#
# Wrapper script to run dcorch-manage db_clean on active controller only
#
re='^[0-9]+$'
function is_active_pgserver()
{
# Determine whether we're running on the same controller as the service.
/usr/bin/sm-query service postgres | grep -q enabled-active
return $?
}
if is_active_pgserver
then
if [[ $1 =~ $re ]]
then
/usr/bin/nice -n 2 /usr/bin/dcorch-manage db_clean $1 >> /var/log/dcorch/dcorch-clean.log
else
/usr/bin/nice -n 2 /usr/bin/dcorch-manage db_clean 3 >> /var/log/dcorch/dcorch-clean.log
fi
fi