From 6270c5d620885d13cd4f1646f3b458014000d260 Mon Sep 17 00:00:00 2001 From: Ilya Rassadin Date: Thu, 8 Sep 2022 07:44:57 +0200 Subject: [PATCH] refactor deploy_code_to_server --- .deploy_code_to_server.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.deploy_code_to_server.yml b/.deploy_code_to_server.yml index a12672d..41b9132 100644 --- a/.deploy_code_to_server.yml +++ b/.deploy_code_to_server.yml @@ -24,12 +24,15 @@ extends: .before_deploy_code variables: RSYNC_PARAMS: '--delete --dry-run' - script: + before_script: + - !reference [.before_deploy_code, before_script] - 'which curl || (apt-get update -y && apt-get install curl -y)' - curl -O https://gitlab.cetera.ru/boilerplate/ci/raw/master/rsync-filter-std - *set_rsync_filter - echo PROJECT_FILTER set to $PROJECT_FILTER + script: - rsync -avz --chown=$user:$group -e "ssh $SSH_OPTS" --filter="merge rsync-filter-std" --filter="merge $PROJECT_FILTER" $RSYNC_PARAMS $CI_PROJECT_DIR/ root@${!PROJECT_SERVER}::www/${!PROJECT_SITE}/ + after_script: - if [ $PROJECT_CMS_TYPE = bitrix ]; then curl -o /tmp/.settings_extra.php https://gitlab.cetera.ru/boilerplate/ci/raw/master/.settings_extra.php; fi - if [ $PROJECT_CMS_TYPE = bitrix ]; then rsync -avz --chown=$user:$group -e "ssh $SSH_OPTS" /tmp/.settings_extra.php root@${!PROJECT_SERVER}::www/${!PROJECT_SITE}/www/bitrix/; fi - curl -L ${!PROJECT_SITE}/pagespeed_admin/cache?purge=* || echo "can't purge cache" -- GitLab