Skip to content
Snippets Groups Projects
Commit a7c61b53 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

loop in deploy

parent e6ae3354
No related branches found
No related tags found
No related merge requests found
......@@ -3,44 +3,56 @@
rootDir=$(pwd)
echo $rootDir
# define the directory to the blade
cd 2019
BLADE="template"
# create the required folders in public
mkdir $rootDir/public
mkdir $rootDir/public/$BLADE
mkdir $rootDir/public/$BLADE/stable
mkdir $rootDir/public/$BLADE/latest
# change to the blade directory to be built
cd $BLADE
# install npm
npm install -g npm@latest yo grunt-cli generator-reveal
npm install
# build the master version into stable
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
grunt dist
mv public/* $rootDir/public/$BLADE/stable/.
# build the develop version into latest
git checkout -f develop
git fetch origin develop
git reset --hard origin/develop
grunt dist
mv public/* $rootDir/public/$BLADE/latest/.
# auto redirect file
echo '<html>\n
<head>\n
<meta http-equiv="refresh" content="0; url=https://r3.pages.uni.lu/school/'$BLADE'/stable"/>\n
</head>\n
<body>\n
</bod>\n
</html>\n' > $rootDir/public/$BLADE/index.html
nBlades=0
for d in $(find . -maxdepth 1 -type d)
do
if [[ "${d}" == *20* ]]; then
cd "${d}"
echo "changed to ${d}"
for d1 in $(find . -maxdepth 1 -type d)
do
if [[ ${#d1} -ge 2 ]]; then
let "nBlades+=1"
#blades[$nBlades]="$tutorial"
BLADE=${d1:2}
echo "Building ... ${d1}"
# create the required folders in public
mkdir $rootDir/public
mkdir $rootDir/public/$BLADE
mkdir $rootDir/public/$BLADE/stable
mkdir $rootDir/public/$BLADE/latest
# change to the blade directory to be built
cd $BLADE
# install npm
npm install -g npm@latest yo grunt-cli generator-reveal
npm install
# build the master version into stable
#git fetch --tags
#latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
#git checkout $latestTag
#grunt dist
#mv public/* $rootDir/public/$BLADE/stable/.
# build the develop version into latest
git checkout -f develop
git fetch origin develop
git reset --hard origin/develop
grunt dist
mv public/* $rootDir/public/$BLADE/latest/.
# auto redirect file
echo '<html>\n
<head>\n
<meta http-equiv="refresh" content="0; url=https://r3.pages.uni.lu/school/'$BLADE'/stable"/>\n
</head>\n
<body>\n
</bod>\n
</html>\n' > $rootDir/public/$BLADE/index.html
fi
done
fi
done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment