From b6ee1539d5de24a3175e968391d77ba96d99123d Mon Sep 17 00:00:00 2001 From: laurentheirendt <laurent.heirendt@uni.lu> Date: Wed, 1 Jul 2020 14:44:16 +0200 Subject: [PATCH] adapt yml --- .gitlab-ci.yml | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f5445786..fb17b86f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,34 @@ -image: git-r3lab.uni.lu:4567/r3/docker/nodejs-yarn-grunt +stages: + - build + - deploy + +build: + image: git-r3lab.uni.lu:4567/r3/docker/nodejs-yarn-grunt + stage: build + + rules: + - if: $CI_COMMIT_BRANCH == "develop" + + before_script: + - git config submodule.theme.url https://$CI_DEPLOY_USER:$CI_DEPLOY_PASSWORD@git-r3lab.uni.lu/R3-core/outreach/theme.git + - git submodule update --recursive --init -pages: - stage: deploy script: - bash .ci/deploy.sh - artifacts: - expire_in: 1 week - paths: - - public +production: + stage: deploy + image: alpine:3.1 + before_script: + - 'which ssh-agent || ( apk add --update openssh )' + - eval $(ssh-agent -s) + - echo "$B64SSHPRIVKEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null + - mkdir -p ~/.ssh && chmod 700 ~/.ssh + - 'echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - echo "$KNOWNHOSTS" > ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + script: + - ssh -p $SSHPORT $SSHCONNECT "rm -rf ~/web/latest/*" + - scp -P $SSHPORT -r public/* $SSHCONNECT:~/web/latest -- GitLab