-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
80 lines (64 loc) · 1.56 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
image: docker:19.03.13
variables:
DOCKER_TLS_CERTDIR: "/certs"
services:
- docker:19.03.13-dind
before_script:
- echo $CI_BUILD_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
stages:
- preparation
- deploy-stage
- integration-tests
- deploy-prod
unit-tests:
stage: preparation
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/utest:$CI_COMMIT_REF_SLUG
script:
- docker pull $IMAGE_TAG || true
- docker build --cache-from $IMAGE_TAG -t $IMAGE_TAG -f build/container-image-utest/Dockerfile .
- docker push $IMAGE_TAG
- docker run $IMAGE_TAG
build:
stage: preparation
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- docker pull $IMAGE_TAG || true
- docker build --cache-from $IMAGE_TAG -t $IMAGE_TAG -f ./build/container-image/Dockerfile .
- docker push $IMAGE_TAG
integration-tests:
stage: integration-tests
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/itest:$CI_COMMIT_REF_SLUG
script:
- echo todo
deploy_stage:
stage: deploy-stage
needs: ["build"]
environment:
name: stage
url: https://stage.webgrinch.8qfx1ai5.de
script:
- echo todo
only:
- master
deploy_prod:
stage: deploy-prod
environment:
name: production
url: https://stage.webgrinch.8qfx1ai5.de
script:
- echo todo
when: manual
only:
- master
deploy_review:
stage: deploy-stage
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://$CI_COMMIT_REF_SLUG.stage.webgrinch.8qfx1ai5.de
script:
- echo todo
only:
- merge_requests