From addab8bf416fffd60edc4b39b7a27078a0c81ee6 Mon Sep 17 00:00:00 2001 From: Marat Date: Fri, 16 Feb 2018 20:09:09 +0000 Subject: [PATCH] Add new file --- .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..216d6d4 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +variables: + SERVER_URL: "go.skillbox.ru" + DOMAIN: "$CI_BUILD_REF_SLUG.$SERVER_URL" + GIT_DEPTH: "1" + +types: + - deploy_branch + - deploy_production + +deploy_branch: + stage: deploy_branch + script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - ~/.composer/vendor/bin/envoy run deploy --cleanup --branch="$CI_BUILD_REF_SLUG" + environment: + name: production + url: https://go.skillbox.ru + + variables: + GIT_DEPTH: "1" + +# when: manual + only: + - dev + - autodeploy + +deploy_production: + stage: deploy_production + script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - ~/.composer/vendor/bin/envoy run deploy --cleanup --branch="$CI_BUILD_REF_SLUG" + environment: + name: production + url: https://go.skillbox.ru + + variables: + GIT_DEPTH: "1" + + when: manual + only: + - master \ No newline at end of file