-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
62 lines (55 loc) · 1.53 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
include:
- project: 'strowi/ci-templates'
file: '/build.yml'
- project: 'strowi/ci-templates'
file: '/tests.yml'
variables:
CODE_QUALITY_DISABLED: "true"
stages:
- build
- test
- release
build:
extends: .build
stage: build
script:
- build_image
container_scanning:
extends: .container_scanning
dgoss:varnish:
extends: .dgoss
stage: test
variables:
GOSS_SLEEP: 10s
script:
- docker_setup
- dgoss run
-e BIND_PORT=":80"
-e VCL_CONFIG="/etc/varnish/default.vcl"
-e CACHE_SIZE="512m"
-e VARNISHD_PARAMS="-p feature=+http2 -p default_ttl=120 -p default_grace=3600 -S /etc/varnish/secret -T 127.0.0.1:6082"
${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA} > goss.xml
release_docker_com:
extends: .build
stage: release
script:
- docker pull "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
- docker tag "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}" "strowi/varnish:${CI_COMMIT_REF_SLUG}"
- echo $DOCKER_TOKEN | docker login -u strowi --password-stdin
- docker push "strowi/varnish:${CI_COMMIT_REF_SLUG}"
rules:
- if: $CI_COMMIT_BRANCH
when: always
- when: never
release:
extends: .build
stage: release
script:
- release_latest
- docker tag "${CI_REGISTRY_IMAGE}" "strowi/varnish"
- echo $DOCKER_TOKEN | docker login -u strowi --password-stdin
- docker push "strowi/varnish"
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- when: never