-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
66 lines (60 loc) · 1.69 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
include:
- project: "backend/ci-templates"
ref: 0.2.18
file:
- "/templates/autoversion.gitlab-ci.yml"
- "/helm/.gitlab-ci.yml"
variables:
APP_NAME: "rerun"
REGISTRY_NAME: "wandelbots.azurecr.io/nova-apps/rerun"
GIT_USER: "pycop-bot"
GIT_TOKEN: $PYCOP_ACCESS_TOKEN
stages:
- version
- test
- build
- deploy
.docker:
image: container-registry.wabo.run/docker-hub/library/docker:27
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ''
services:
- name: container-registry.wabo.run/docker-hub/library/docker:25-dind
alias: docker
command: [ "--tls=false" ]
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# harbor still needed for the docker builds as we might pull images from this mirror
- docker login -u $HARBOR_ROBOT_USER -p $HARBOR_ROBOT_TOKEN container-registry.wabo.run
- docker login -u $PUBLIC_REGISTRY_CI_SCOPE_NOVA_APPS_USERNAME -p $PUBLIC_REGISTRY_CI_SCOPE_NOVA_APPS_PASSWORD $PUBLIC_REGISTRY_HOST
bump-version:
extends: .autoversion-bump-push
stage: version
build-docker:
stage: build
extends: .docker
except:
- main
dependencies:
- bump-version
script:
- !reference [.autoversion-version-var]
- image="${REGISTRY_NAME}:${version}"
- echo "building image ${image}"
- docker image build --tag ${image} .
build_and_push_docker:
stage: build
extends: .docker
only:
- main
dependencies:
- bump-version
script:
- !reference [.autoversion-version-var]
- image="${REGISTRY_NAME}:${version}"
- echo "building image ${image}"
- docker build --tag ${image} .
- docker push ${image}