forked from HumanBrainProject/okd_postgresql_backups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
52 lines (46 loc) · 1.13 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
45
46
47
48
49
50
51
52
variables:
# you need to use $$ to escape $ in the variable
docker_registry_user: "robot$$gitlab"
# increment the tag for new release
DOCKER_IMAGE_TAG: "1.1"
stages:
- build
- release
#
# BUILD
#
build_dev:
stage: build
script:
- docker build -t docker-registry.ebrains.eu/okd_tools/postgresql_backups:dev.$CI_PIPELINE_ID .
only:
- devel
tags:
- shell-runner-1
build_prod:
stage: build
script:
- docker build -t docker-registry.ebrains.eu/okd_tools/postgresql_backups:$DOCKER_IMAGE_TAG .
only:
- master
tags:
- shell-runner-1
#
# RELEASE
#
release_dev:
stage: release
script:
- docker login -u $docker_registry_user -p $docker_registry_prod_token docker-registry.ebrains.eu
- docker push docker-registry.ebrains.eu/okd_tools/postgresql_backups:dev.$CI_PIPELINE_ID
tags:
- shell-runner-1
when: manual
release_prod:
stage: release
script:
- docker login -u $docker_registry_user -p $docker_registry_prod_token docker-registry.ebrains.eu
- docker push docker-registry.ebrains.eu/okd_tools/postgresql_backups:$DOCKER_IMAGE_TAG
tags:
- shell-runner-1
when: manual