Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Nene Barry
markdown
Commits
05990371
Verified
Commit
05990371
authored
Nov 05, 2019
by
Laurent Heirendt
✈
Browse files
include deploy ci script
parent
e6ccbeff
Changes
2
Hide whitespace changes
Inline
Side-by-side
.ci/deploy.sh
0 → 100644
View file @
05990371
#!/bin/bash
PAGEURL
=
"https://r3.pages.uni.lu/templates/outreach/presentation"
rootDir
=
$(
pwd
)
echo
$rootDir
# clean previous builds
rm
-rf
$rootDir
/public
mkdir
$rootDir
/public
# loop through all the presentations
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
" > -----------------------------------------------------"
echo
"Building ...
${
d1
}
"
# create the required folders in public
mkdir
$rootDir
/public/
$BLADE
mkdir
$rootDir
/public/
$BLADE
/unstable
mkdir
$rootDir
/public/
$BLADE
/latest
mkdir
$rootDir
/public/
$BLADE
/stable
# change to the blade directory to be built
cd
$BLADE
# build the unstable version - can be optimized
git config submodule.theme.url https://
$CI_DEPLOY_USER
:
$CI_DEPLOY_PASSWORD
@git-r3lab.uni.lu/R3-core/outreach/theme.git
git submodule update
--recursive
--init
# run contribute
cp
../../template/Gruntfile.coffee
.
ln
-s
../../theme/package.json package.json
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/.
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/.
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/.
echo
" > latest built for file set
${
BLADE
}
"
# auto redirect file to the stable version
echo
'<html>\n
<head>\n
<meta http-equiv="refresh" content="0; url='
$PAGEURL
'/'
$BLADE
'/stable"/>\n
</head>\n
<body>\n
</bod>\n
</html>\n'
>
$rootDir
/public/
$BLADE
/index.html
echo
"autoredirect file set"
# move back out
cd
..
echo
" > -----------------------------------------------------"
fi
done
fi
done
.gitlab-ci.yml
0 → 100644
View file @
05990371
image
:
git-r3lab.uni.lu:4567/r3/docker/nodejs-yarn-grunt
pages
:
stage
:
deploy
script
:
-
bash .ci/deploy.sh
artifacts
:
expire_in
:
1 week
paths
:
-
public
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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