diff --git a/.ci/deploy.sh b/.ci/deploy.sh index fd7f55c5e9d8b5bb952976f651e880bdd9331da5..3dfb425ed344e2afdcd18d3fe3a56522292eed79 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 8ffe0c2d6d861602706438d4f4ef6235cd373a2c..634598f1f53a0d306c7d983716fac8dbe4e8e77c 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