From 2a2a18f1fca75d3a6b8da836f515546f52933c0d Mon Sep 17 00:00:00 2001 From: laurentheirendt <laurent.heirendt@uni.lu> Date: Wed, 1 Jul 2020 14:44:01 +0200 Subject: [PATCH] simplify deploy script --- .ci/deploy.sh | 54 +++++++-------------------------------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/.ci/deploy.sh b/.ci/deploy.sh index 34afa749..ffe716af 100644 --- a/.ci/deploy.sh +++ b/.ci/deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -PAGEURL="https://r3.pages.uni.lu/school/courses" +PAGEURL="https://courses.lcsb.uni.lu/" rootDir=$(pwd) echo $rootDir @@ -10,10 +10,10 @@ rm -rf $rootDir/public mkdir $rootDir/public # create img folders -mkdir $rootDir/public/img -mkdir $rootDir/public/img/unstable -mkdir $rootDir/public/img/latest -mkdir $rootDir/public/img/stable +#mkdir $rootDir/public/img +#mkdir $rootDir/public/img/unstable +#mkdir $rootDir/public/img/latest +#mkdir $rootDir/public/img/stable # loop through all the presentations nBlades=0 @@ -26,16 +26,15 @@ do do if [[ ${#d1} -ge 2 ]]; then let "nBlades+=1" - #blades[$nBlades]="$tutorial" BLADE=${d1:2} echo " > -----------------------------------------------------" echo "Building ... ${d1}" # create the required folders in public mkdir $rootDir/public/$BLADE - mkdir $rootDir/public/$BLADE/unstable + #mkdir $rootDir/public/$BLADE/unstable mkdir $rootDir/public/$BLADE/latest - mkdir $rootDir/public/$BLADE/stable + #mkdir $rootDir/public/$BLADE/stable # change to the blade directory to be built cd $BLADE @@ -50,51 +49,12 @@ do ln -s ../../theme theme # install npm - #npm install -g npm@latest yo grunt-cli generator-reveal - #npm install yarn global add grunt-cli generator-reveal yarn install - grunt dist - mv public/* $rootDir/public/$BLADE/unstable/. - - # link to the img directory - mv $rootDir/public/$BLADE/unstable/slides/img/* $rootDir/public/img/unstable/. - rm -rf $rootDir/public/$BLADE/unstable/slides/img - ln -s ../../../img/unstable $rootDir/public/$BLADE/unstable/slides/img - - echo " > unstable built for file set ${BLADE}" - - # build the master version into stable - git fetch --tags - latestTag=$(git describe --tags `git rev-list --tags --max-count=1`) - git stash - git checkout $latestTag - git submodule update --init - grunt dist - mv public/* $rootDir/public/$BLADE/stable/. - - # link to the img directory - mv $rootDir/public/$BLADE/stable/slides/img/* $rootDir/public/img/stable/. - rm -rf $rootDir/public/$BLADE/stable/slides/img - ln -s ../../../img/stable $rootDir/public/$BLADE/stable/slides/img - - echo " > stable built for file set ${BLADE}" - - # build the develop version into latest - git stash - git checkout -f develop - git fetch origin develop - git reset --hard origin/develop - git submodule update --init grunt dist mv public/* $rootDir/public/$BLADE/latest/. - # link to the img directory - mv $rootDir/public/$BLADE/latest/slides/img/* $rootDir/public/img/latest/. - rm -rf $rootDir/public/$BLADE/latest/slides/img - ln -s ../../../img/latest $rootDir/public/$BLADE/latest/slides/img - echo " > latest built for file set ${BLADE}" # auto redirect file to the stable version -- GitLab