From d01b9a09ccabf8833e66aa779b0c7c9f43effd34 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 16 Aug 2018 23:38:10 +0200 Subject: [PATCH] Adjust ci to renaming master to staging, add production branch --- .gitlab-ci.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bfae8eb..174b333 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,7 @@ deploy_staging: - eval $(ssh-agent -s) - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - echo "$PRIVATE_KEY" | ssh-add - - - rsync -e "ssh -l deploy -p 31337" -av public/ 195.54.164.87:s + - rsync -e "ssh -l deploy -p 31337" -av public/ 195.54.164.87:staging/s when: on_success environment: name: staging @@ -59,4 +59,30 @@ deploy_staging: artifacts: paths: - public/ + only: + - staging + +deploy_production: + image: "alpine:3.8" + stage: deploy + dependencies: + - build_calendar + variables: + SHELL: "/bin/sh" + script: + - apk --no-cache --upgrade add openssh-client rsync + - mkdir -p ~/.ssh + - eval $(ssh-agent -s) + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config + - echo "$PRIVATE_KEY" | ssh-add - + - rsync -e "ssh -l deploy -p 31337" -av public/ 195.54.164.87:production/s + when: on_success + environment: + name: staging + url: https://berlin.ccc.de/ + artifacts: + paths: + - public/ + only: + - staging