Skip to content

Commit bd2d8bd

Browse files
committed
Merge branch 'nv-release' into 'master'
[CI] duplicate releases to docker hub See merge request nvidia/kubernetes/device-plugin!57
2 parents 2c19a67 + 49427e7 commit bd2d8bd

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

.nvidia-ci.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
---
22
##
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):
44
## CI_REGISTRY
55
## CI_REGISTRY_IMAGE
66
## CI_REGISTRY_USER
77
## CI_REGISTRY_PASSWORD
88
##
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
1419
##
1520

1621
default:
@@ -34,6 +39,7 @@ stages:
3439
- scan
3540
- deploy
3641
- release
42+
- release_dockerhub
3743

3844
.builddep_setup: &builddep_setup
3945
- apk add --no-cache bash findutils libmagic curl make git
@@ -56,8 +62,11 @@ stages:
5662
- docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}-centos7 ${CI_PROJECT_NAME}:${CI_COMMIT_SHA}-centos7
5763
- docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}-ubi8 ${CI_PROJECT_NAME}:${CI_COMMIT_SHA}-ubi8
5864

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}"'
6170

6271
.build_action: &build_action
6372
- make IMAGE="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHA}" all
@@ -80,10 +89,16 @@ stages:
8089
- python3 contamer.py -ls --fail-on-non-os --suppress-vulns CVE-2020-14352 CVE-2020-15888 -- ${CI_PROJECT_NAME}:${CI_COMMIT_SHA}-ubi8
8190

8291
.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
87102

88103
build:
89104
stage: build
@@ -122,5 +137,14 @@ release:
122137
script:
123138
- 'echo Commit Tag: $CI_COMMIT_TAG ; [[ -n "$CI_COMMIT_TAG" ]] || exit 1'
124139
- *builddep_setup
125-
- *releasedockerlogin_setup
140+
- *ngc_release_login
126141
- *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

Comments
 (0)