Verified Commit 2a2a18f1 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

simplify deploy script

parent fc3e45c3
#!/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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment