-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
44 lines (42 loc) · 1.83 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
include:
# - remote: 'https://gitlab.miracum.org/miracum/dqa/dqa_base_image/-/raw/master/importable.gitlab-ci.yml'
- project: miracum/dqa/dqa_base_image
file: importable.gitlab-ci.yml
variables:
R_PKG_NAME: 'miRacumDQA'
## Additionaly create a new commit in the repo 'dqatool_deployment'
## to trigger building a new release of the DQA-tool:
build_release_image:
stage: deploy
image: docker:git
when: on_success
before_script:
- apt-get update && apt-get install git -y --no-install-recommends
script:
- mkdir ci_tmp
- cd ci_tmp
- git clone https://gitlab.miracum.org/miracum/dqa/miRacumDQA.git
- cd miRacumDQA
- miRacumDQA_tag=$(git describe --tags `git rev-list --tags --max-count=1`) # gets tags across all branches, not just the current branch
- miRacumDQA_tag_no_prefix=$(echo ${miRacumDQA_tag} | sed "s/v//") # Replaces every 'v' in the tag with a blank ''.
- echo "DIZutils_tag ${DIZutils_tag}"
- echo "DQAstats_tag ${DQAstats_tag}"
- echo "DQAgui_tag ${DQAgui_tag}"
- echo "miRacumDQA_tag ${miRacumDQA_tag}"
- echo "miRacumDQA_tag_no_prefix ${miRacumDQA_tag_no_prefix}"
- cd ../
- git clone https://oauth2:${GITLAB_DQATOOL_DEPLOYMENT_TOKEN}@gitlab.miracum.org/miracum/dqa/dqatool_deployment.git dqatool_deployment
- cd dqatool_deployment
- sed -i -e 's/IMAGE_TAG=[0-9]\.[0-9]\.[0-9]/IMAGE_TAG='"${miRacumDQA_tag_no_prefix}"'/' deploy/.env
- git add deploy/.env
- git config --global user.email "[email protected]"
- git config --global user.name "Release Bot"
- git commit -m "[Autocommit from miRacumDQA] Version updated to ${miRacumDQA_tag_no_prefix}"
- git push origin master
- git tag -a ${miRacumDQA_tag} -m "Release ${miRacumDQA_tag}"
- git push origin ${miRacumDQA_tag}
- cd ../../
- rm -rf ci_tmp
only:
refs:
- tags