summaryrefslogtreecommitdiffstats
path: root/tools/docker-compose/awx-autoreload
diff options
context:
space:
mode:
authorHao Liu <44379968+TheRealHaoLiu@users.noreply.github.com>2024-03-06 21:22:44 +0100
committerGitHub <noreply@github.com>2024-03-06 21:22:44 +0100
commit1b56d94d3083d6cd598ae2ad8f5d142559b16f77 (patch)
tree125a23e69673f9ec3c3d82d12db1b0f07fd5d9c4 /tools/docker-compose/awx-autoreload
parentAllow for manually starting workflow to build devel images (#14955) (diff)
downloadawx-1b56d94d3083d6cd598ae2ad8f5d142559b16f77.tar.xz
awx-1b56d94d3083d6cd598ae2ad8f5d142559b16f77.zip
In development environment not auto-reload explicitly STOPPED processes (#14958)
Not auto-reload explicitly STOPPED processes In development/debug workflow sometime we explicitly STOP processes this will make sure auto-reload does not start them back up
Diffstat (limited to '')
-rwxr-xr-xtools/docker-compose/awx-autoreload11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/docker-compose/awx-autoreload b/tools/docker-compose/awx-autoreload
index 0f6f0b8f9d..37507c2451 100755
--- a/tools/docker-compose/awx-autoreload
+++ b/tools/docker-compose/awx-autoreload
@@ -13,8 +13,15 @@ inotifywait -mrq -e create,delete,attrib,close_write,move --exclude '(/awx_devel
since_last=$((this_reload-last_reload))
if [[ "$file" =~ ^[^.].*\.py$ ]] && [[ "$since_last" -gt 1 ]]; then
echo "File changed: $file"
- echo "Running command: $2"
- eval $2
+ # if SUPERVISOR_CONFIG_PATH is defined run `supervisorctl -c $SUPERVISOR_CONFIG_PATH` else just run `supervisorctl`
+ if [ -n "$SUPERVISOR_CONFIG_PATH" ]; then
+ supervisorctl_command="supervisorctl -c $SUPERVISOR_CONFIG_PATH"
+ else
+ supervisorctl_command="supervisorctl"
+ fi
+ tower_processes=`$supervisorctl_command status tower-processes:* | grep -v STOPPED | awk '{print $1}' | tr '\n' ' '`
+ echo echo "Running command: $supervisorctl_command restart $tower_processes"
+ eval $supervisorctl_command restart $tower_processes
last_reload=`date +%s`
fi
done