File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
post_push/lib/docker-pull-resources
push/lib/git-bare-resources Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ PUSH=git-bare
1111PACKAGE=git
1212RESTART_COMMAND=" sh deploy/run.sh restart"
1313DEPLOYMENT_DIR=' $HOME/sites/$SERVICE_NAME/$PROJECT_ENVIRONMENT'
14+ LOG_DIR=$DEPLOYMENT_DIR /shared/logs
1415RELEASE_COUNT=5
1516DOCKER_COMPOSE_OPTS=" "
1617DOCKER_REGISTRY=https://dockerhub.finology.com.my
Original file line number Diff line number Diff line change 1616
1717cd $DEPLOY_DIR /current && docker-compose -f docker-compose.yml up -d --no-build
1818
19+ if [ -n " $LOG_DIR " ]; then
20+ if [ ! -d " $LOG_DIR " ]; then
21+ info " Creating Log Directory; $LOG_DIR "
22+ mkdir -p " $LOG_DIR "
23+ fi
24+
25+ if [ -d " $LOG_DIR " ]; then
26+ info " Saving Logs To $LOG_DIR /$SERVICE_NAME .log"
27+ docker-compose -f docker-compose.yml logs -f >> " $LOG_DIR /$SERVICE_NAME .log" 2>&1 &
28+ fi
29+ fi
30+
1931post_startup
Original file line number Diff line number Diff line change @@ -19,12 +19,7 @@ stop_current_container() {
1919CURRENT_DOCKER_COMPOSE=" $DEPLOYMENT_DIR /current/docker-compose.yml"
2020CURRENT_DIR=$( pwd)
2121if [ -f " $CURRENT_DOCKER_COMPOSE " ]; then
22- CURRENT_LOG_FOLDER=" $DEPLOYMENT_DIR /shared/logs"
23- mkdir -p " $CURRENT_LOG_FOLDER "
2422cd " $DEPLOYMENT_DIR /current"
25- if [ -d " $CURRENT_LOG_FOLDER " ]; then
26- docker-compose logs 2>&1 >> " $CURRENT_LOG_FOLDER /$SERVICE_NAME .log"
27- fi
2823docker-compose rm -sf
2924cd " $CURRENT_DIR "
3025fi
You can’t perform that action at this time.
0 commit comments