Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
school
courses
Commits
f2edad60
Commit
f2edad60
authored
Apr 25, 2019
by
Laurent Heirendt
✈
Browse files
deployment for all branches
parent
78737bd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
.ci/deploy.sh
View file @
f2edad60
...
...
@@ -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
...
...
.gitlab-ci.yml
View file @
f2edad60
...
...
@@ -2,11 +2,7 @@ image: digitallyseamless/nodejs-bower-grunt
pages
:
stage
:
deploy
only
:
-
develop
-
master
script
:
# install npm
-
bash .ci/deploy.sh
artifacts
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment