From 325e30c4bd10ce4d5c28bd9c93e42dcdfd3fadc8 Mon Sep 17 00:00:00 2001 From: laurentheirendt <laurent.heirendt@uni.lu> Date: Wed, 1 Jul 2020 17:59:30 +0200 Subject: [PATCH] swap version --- .ci/deploy.sh | 10 +++++++++- .gitlab-ci.yml | 12 +----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.ci/deploy.sh b/.ci/deploy.sh index fd7f55c5..3dfb425e 100644 --- a/.ci/deploy.sh +++ b/.ci/deploy.sh @@ -9,6 +9,14 @@ echo $rootDir rm -rf $rootDir/public mkdir $rootDir/public +if [[ $CI_COMMIT_BRANCH == "develop" ]]; then + version="latest"; +elif [[ $CI_COMMIT_BRANCH == "master" ]]; then + version="stable"; +else + version="unstable"; +fi + # loop through all the presentations nBlades=0 for d in $(find . -maxdepth 1 -type d) @@ -44,7 +52,7 @@ do yarn install grunt dist - mv public/* $rootDir/public/$BLADE/. + mv public/* $rootDir/public/$BLADE/$version/. echo " > latest built for file set ${BLADE}" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8ffe0c2d..634598f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,14 +25,6 @@ production: stage: deploy image: alpine:3.1 before_script: - # define the branch - - if [[ $CI_COMMIT_BRANCH == "develop" ]]; then - version="latest"; - elif [[ $CI_COMMIT_BRANCH == "master" ]]; then - version="stable"; - else - version="unstable"; - fi - 'which ssh-agent || ( apk add --update openssh )' - eval $(ssh-agent -s) - echo "$B64SSHPRIVKEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null @@ -43,6 +35,4 @@ production: rules: - if: '$CI_COMMIT_BRANCH == "develop"' script: - - ssh -p $SSHPORT $SSHCONNECT "rm -rf ~/web/latest/*" - - ssh -p $SSHPORT $SSHCONNECT "mkdir ~/web/latest/$version" - - scp -P $SSHPORT -r public/* $SSHCONNECT:~/web/latest/$version + - scp -P $SSHPORT -r public/* $SSHCONNECT:~/web/latest -- GitLab