Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
howto-cards
Commits
315e29ee
Commit
315e29ee
authored
Jul 24, 2020
by
Jacek Lebioda
Browse files
Merge branch 'automate-index' into 'develop'
Automate index See merge request
!161
parents
baccec14
860cd61c
Pipeline
#30292
failed with stages
in 19 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
315e29ee
...
...
@@ -2,10 +2,63 @@
image
:
git-r3lab.uni.lu:4567/r3/docker/jekyll-lcsb:1.6
stages
:
-
prepare
-
save
-
build
-
generate
-
deploy
# prepare
# ------------------------------------------------------------------------------------
prepare:index:
image
:
python
stage
:
prepare
rules
:
-
if
:
$CI_COMMIT_BRANCH
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"
&&
$CI_COMMIT_MESSAGE
!~
/tmpBranch/
&&
$CI_COMMIT_MESSAGE
!~
/Update
index/'
script
:
-
python .ci/generateIndex.py
-
mkdir .tmp
-
cp index.md .tmp/.
artifacts
:
expire_in
:
1 day
paths
:
-
.tmp
# save
# ------------------------------------------------------------------------------------
save:commitIndex:
image
:
name
:
alpine/git:latest
entrypoint
:
[
"
"
]
stage
:
save
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"
&&
$CI_COMMIT_MESSAGE
!~
/tmpBranch/
&&
$CI_COMMIT_MESSAGE
!~
/Update
index/'
before_script
:
-
apk add git-lfs
-
git fetch --all
-
url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
-
git remote set-url origin "https://$GIT_ACCESS_USER:$GIT_ACCESS_TOKEN@${url_host}"
-
git config user.name $GIT_ACCESS_USER
-
git config user.email $GIT_ACCESS_EMAIL
script
:
# copy the index and remove the temporary directory
-
cp .tmp/index.md .
-
rm -rf .tmp
# commit
-
git branch -D tmpBranch ||
true
-
git checkout -b tmpBranch
-
git add --all
-
git commit -m "Update index"
-
git checkout $CI_COMMIT_REF_NAME
-
git pull origin $CI_COMMIT_REF_NAME
-
git merge tmpBranch --ff
-
git push origin $CI_COMMIT_REF_NAME ||
true
-
git branch -D tmpBranch
# build
# ------------------------------------------------------------------------------------
...
...
index.md
View file @
315e29ee
...
...
@@ -64,4 +64,4 @@ The How-to cards are intended to provide practical guidance in implementing Data
</ul>
</div>
</div>
</div>
\ No newline at end of file
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