1
1
---
2
2
# #
3
- # # Variables that control where build artifacts are places for scanning and testing:
3
+ # # Variables that control the CI artifacts (private registry, for scanning and testing) :
4
4
# # CI_REGISTRY
5
5
# # CI_REGISTRY_IMAGE
6
6
# # CI_REGISTRY_USER
7
7
# # CI_REGISTRY_PASSWORD
8
8
# #
9
- # # Variables that control where release artifacts go:
10
- # # RELEASE_REGISTRY
11
- # # RELEASE_REGISTRY_IMAGE
12
- # # RELEASE_REGISTRY_USER
13
- # # RELEASE_REGISTRY_PASSWORD
9
+ # # Variables that control where NGC release artifacts go:
10
+ # # NGC_REGISTRY
11
+ # # NGC_REGISTRY_IMAGE
12
+ # # NGC_REGISTRY_USER
13
+ # # NGC_REGISTRY_TOKEN
14
+ # #
15
+ # # Variables that control where Docker Hub release artifacts go:
16
+ # # REGISTRY_TOKEN
17
+ # # REGISTRY_USER
18
+ # # DOCKERHUB_REGISTRY_IMAGE
14
19
# #
15
20
16
21
default :
@@ -34,6 +39,7 @@ stages:
34
39
- scan
35
40
- deploy
36
41
- release
42
+ - release_dockerhub
37
43
38
44
.builddep_setup : &builddep_setup
39
45
- apk add --no-cache bash findutils libmagic curl make git
@@ -56,8 +62,11 @@ stages:
56
62
- docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}-centos7 ${CI_PROJECT_NAME}:${CI_COMMIT_SHA}-centos7
57
63
- docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}-ubi8 ${CI_PROJECT_NAME}:${CI_COMMIT_SHA}-ubi8
58
64
59
- .releasedockerlogin_setup : &releasedockerlogin_setup
60
- - ' docker login -u "${RELEASE_REGISTRY_USER}" -p "${RELEASE_REGISTRY_PASSWORD}" "${RELEASE_REGISTRY}"'
65
+ .ngc_release_login : &ngc_release_login
66
+ - ' docker login -u "${NGC_REGISTRY_USER}" -p "${NGC_REGISTRY_TOKEN}" "${NGC_REGISTRY}"'
67
+
68
+ .dockerhub_login : &dockerhub_login
69
+ - ' docker login -u "${REGISTRY_USER}" -p "${REGISTRY_TOKEN}"'
61
70
62
71
.build_action : &build_action
63
72
- make IMAGE="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHA}" all
@@ -80,10 +89,16 @@ stages:
80
89
- python3 contamer.py -ls --fail-on-non-os --suppress-vulns CVE-2020-14352 CVE-2020-15888 -- ${CI_PROJECT_NAME}:${CI_COMMIT_SHA}-ubi8
81
90
82
91
.release_action : &release_action
83
- - make IMAGE="${RELEASE_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" all
84
- - make IMAGE="${RELEASE_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push
85
- - make IMAGE="${RELEASE_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push-short
86
- - make IMAGE="${RELEASE_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push-latest
92
+ - make IMAGE="${NGC_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" all
93
+ - make IMAGE="${NGC_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push
94
+ - make IMAGE="${NGC_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push-short
95
+ - make IMAGE="${NGC_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push-latest
96
+
97
+ .dockerhub_release_action : &dockerhub_release_action
98
+ - make IMAGE="${DOCKERHUB_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" all
99
+ - make IMAGE="${DOCKERHUB_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push
100
+ - make IMAGE="${DOCKERHUB_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push-short
101
+ - make IMAGE="${DOCKERHUB_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_TAG}" push-latest
87
102
88
103
build :
89
104
stage : build
@@ -122,5 +137,14 @@ release:
122
137
script :
123
138
- ' echo Commit Tag: $CI_COMMIT_TAG ; [[ -n "$CI_COMMIT_TAG" ]] || exit 1'
124
139
- *builddep_setup
125
- - *releasedockerlogin_setup
140
+ - *ngc_release_login
126
141
- *release_action
142
+
143
+ release_dockerhub :
144
+ stage : release_dockerhub
145
+ only :
146
+ - tags
147
+ script :
148
+ - *builddep_setup
149
+ - *dockerhub_login
150
+ - *dockerhub_release_action
0 commit comments