Commit 6270c5d6 authored by Ilya Rassadin's avatar Ilya Rassadin
Browse files

refactor deploy_code_to_server

parent 438ac29f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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"