-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (47 loc) · 1.36 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
include:
- project: 'strowi/ci-templates'
file: '/build.yml'
- project: 'strowi/ci-templates'
file: '/tests.yml'
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
- project: 'strowi/ci-templates'
file: 'workflow.yml'
variables:
CODE_QUALITY_DISABLED: "true"
PLATFORMS: linux/amd64,linux/arm64
stages:
- build
- test
- release
build:
extends: .build
stage: build
script:
- build_image
dgoss:
extends: .dgoss
script:
- dgoss_run -t --entrypoint sh $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}
container_scanning:
extends: .container_scanning
release_branch:
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/ansible:${CI_COMMIT_REF_SLUG}"
- echo $DOCKER_TOKEN | docker login -u strowi --password-stdin
- docker push "strowi/ansible:${CI_COMMIT_REF_SLUG}"
release:
extends: .build
stage: release
script:
- release_latest
- test -n ${CI_COMMIT_TAG} && release_tag
- echo $DOCKER_TOKEN | docker login -u strowi --password-stdin
- docker push "strowi/$CI_PROJECT_NAME"
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- when: never