Skip to content

Commit

Permalink
WI-193: provide service name to post deploy script (#52)
Browse files Browse the repository at this point in the history
* provide service info to post deploy script

* Add default post deploy script
  • Loading branch information
chandra-tacc authored Sep 26, 2024
1 parent 299c1de commit f1f7d43
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ deploy-service:
$(DOCKER_COMPOSE) stop $(service)
$(DOCKER_COMPOSE) up -d $(service)
ifdef POST_DEPLOY_SCRIPT
chmod +x ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT} && ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT}
chmod +x ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT} && ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT} $(service)
endif
$(DOCKER_COMPOSE) restart nginx

Expand All @@ -72,7 +72,7 @@ deploy-all:
$(DOCKER_COMPOSE) stop
$(DOCKER_COMPOSE) up -d
ifdef POST_DEPLOY_SCRIPT
chmod +x ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT} && ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT}
chmod +x ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT} && ${CAMINO_HOME}/conf/camino/${POST_DEPLOY_SCRIPT} all
endif
$(DOCKER_COMPOSE) restart nginx

Expand Down
4 changes: 0 additions & 4 deletions conf/scripts/post-deploy-core.sh

This file was deleted.

12 changes: 12 additions & 0 deletions conf/scripts/post-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
service=$1

if [[ "$service" == *"core"* ]] || [[ "$service" == "all" ]]; then
docker exec portal_django python3 manage.py migrate
docker exec portal_django python3 manage.py collectstatic --noinput --clear
fi

if [[ "$service" == *"cms"* ]] || [[ "$service" == "all" ]]; then
docker exec portal_cms python3 manage.py migrate
docker exec portal_cms python3 manage.py collectstatic --noinput --clear
fi

0 comments on commit f1f7d43

Please sign in to comment.