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

deployment for all branches

parent 78737bd8
No related branches found
No related tags found
No related merge requests found
......@@ -22,8 +22,18 @@ do
# create the required folders in public
mkdir $rootDir/public
mkdir $rootDir/public/$BLADE
mkdir $rootDir/public/$BLADE/stable
mkdir $rootDir/public/$BLADE/latest
# determine the folder of the branch
if [[ $CI_COMMIT_REF_NAME == "develop"]]; then
dirName="latest"
elif [[ $CI_COMMIT_REF_NAME == "master"]]; then
dirName="stable"
else
dirName="unstable"
fi
# make the local folder
mkdir $rootDir/public/$BLADE/$dirName
# change to the blade directory to be built
cd $BLADE
......@@ -32,22 +42,29 @@ do
npm install -g npm@latest yo grunt-cli generator-reveal
npm install
if [[ $dirName == "unstable"]]; then
git submodule update --init
grunt dist
mv public/* $rootDir/public/$BLADE/$dirName/.
fi
# 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/.
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
git submodule update --init
grunt dist
mv public/* $rootDir/public/$BLADE/$dirName/.
# build the develop version into latest
#git checkout -f develop
#git fetch origin develop
#git reset --hard origin/develop
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/.
mv public/* $rootDir/public/$BLADE/$dirName/.
# auto redirect file
# auto redirect file to the stable version
echo '<html>\n
<head>\n
<meta http-equiv="refresh" content="0; url='$PAGEURL'/'$BLADE'/stable"/>\n
......
......@@ -2,11 +2,7 @@ image: digitallyseamless/nodejs-bower-grunt
pages:
stage: deploy
only:
- develop
- master
script:
# install npm
- bash .ci/deploy.sh
artifacts:
......
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