Skip to content

Commit

Permalink
Merge branch 'ci-fix-release' into 'master'
Browse files Browse the repository at this point in the history
[ci] fix and clean up release jobs

See merge request nvidia/kubernetes/gpu-operator!166
  • Loading branch information
shivamerla committed May 17, 2021
2 parents 8c7a64b + cc74b02 commit dbfc75b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 29 deletions.
11 changes: 8 additions & 3 deletions .common-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
variables:
DOCKERHUB: nvidia/gpu-operator
NVCRIO: nvcr.io/nvstaging/cloud-native/gpu-operator
TF_VAR_FILE: "$CI_PROJECT_DIR/tests/terraform.tfvars"
GIT_SUBMODULE_STRATEGY: recursive

Expand Down Expand Up @@ -99,6 +98,9 @@ unit-tests:
image: docker:stable
services:
- docker:stable-dind
except:
variables:
- $SKIP_TESTS =~ /^y/

script:
- apk add --update make
Expand All @@ -109,9 +111,12 @@ unit-tests:

.scan:
stage: scan
image: docker:stable
services:
- docker:dind
image: docker:dind
- docker:stable-dind
except:
variables:
- $SKIP_SCANS =~ /^y/
before_script:
- source .VERSION_INFO
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
Expand Down
15 changes: 13 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ include:
e2e_tests:
stage: e2e_tests
image: alpine
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-end-to-end-tests/
- $SKIP_TESTS =~ /^y/
- $CI_PIPELINE_SOURCE == "schedule"
script:
- source .VERSION_INFO
- source aws-kube-ci/hostname
Expand All @@ -27,9 +32,15 @@ e2e_tests:
aws_kube_setup:
extends: .aws_kube_setup
except:
- schedules
variables:
- $CI_COMMIT_MESSAGE =~ /skip-end-to-end-tests/
- $SKIP_TESTS =~ /^y/
- $CI_PIPELINE_SOURCE == "schedule"

aws_kube_clean:
extends: .aws_kube_clean
except:
- schedules
variables:
- $CI_COMMIT_MESSAGE =~ /skip-end-to-end-tests/
- $SKIP_TESTS =~ /^y/
- $CI_PIPELINE_SOURCE == "schedule"
54 changes: 30 additions & 24 deletions .nvidia-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,56 +22,64 @@ contamer:

release:ngc:
stage: release
image: docker:dind
dependencies:
- build-image
- versioning
image: docker:stable
services:
- docker:dind
- docker:stable-dind
variables:
GIT_STRATEGY: clone
only:
refs:
- master
- /^\d+\.\d+\.\d+$/
script:
- source .VERSION_INFO
- docker login -u "${NGC_REGISTRY_USER}" -p "${NGC_REGISTRY_TOKEN}" "${NGC_REGISTRY}"
- docker pull ${CI_REGISTRY_IMAGE}:${VERSION}
- docker tag ${CI_REGISTRY_IMAGE}:${VERSION} ${NGC_PROD_IMAGE}:${VERSION}
- docker tag ${CI_REGISTRY_IMAGE}:${VERSION} ${NGC_PROD_IMAGE}:latest
- docker pull "${CI_REGISTRY_IMAGE}:${VERSION}"
- docker tag "${CI_REGISTRY_IMAGE}:${VERSION}" "${NGC_PROD_IMAGE}:${VERSION}"
- docker tag "${CI_REGISTRY_IMAGE}:${VERSION}" "${NGC_PROD_IMAGE}:latest"
- docker push ${NGC_PROD_IMAGE}:${VERSION}
- docker push ${NGC_PROD_IMAGE}:latest

release:dockerhub:
stage: release
dependencies:
- build-image
- versioning
only:
- tags
- /^\d+\.\d+\.\d+$/

release:dockerhub:
image: docker:stable
services:
- docker:stable-dind
stage: release
variables:
GIT_STRATEGY: clone
only:
- master
- tags
refs:
- master
- /^\d+\.\d+\.\d+$/
script:
# Push Container to Dockerhub
- source .VERSION_INFO
- docker login -u "${REGISTRY_USER}" -p "${REGISTRY_TOKEN}" "${NGC_REGISTRY}"
- docker pull "$CI_REGISTRY_IMAGE:$VERSION"
- docker tag "$CI_REGISTRY_IMAGE:$VERSION" "$DOCKERHUB:$VERSION"
- docker tag "$CI_REGISTRY_IMAGE:$VERSION" "$DOCKERHUB:latest"
- docker login -u "${REGISTRY_USER}" -p "${REGISTRY_TOKEN}" "${REGISTRY}"
- docker pull "${CI_REGISTRY_IMAGE}:${VERSION}"
- docker tag "${CI_REGISTRY_IMAGE}:${VERSION}" "${DOCKERHUB}:${VERSION}"
- docker tag "${CI_REGISTRY_IMAGE}:${VERSION}" "${DOCKERHUB}:latest"
- docker push "${DOCKERHUB}:${VERSION}"
- docker push "${DOCKERHUB}:latest"
dependencies:
- versioning

release:helm:
stage: release
dependencies:
- versioning
image: docker:stable
services:
- docker:stable-dind
stage: release
variables:
GIT_STRATEGY: clone
only:
- master
- tags
refs:
- master
- /^\d+\.\d+\.\d+$/
script:
- source .VERSION_INFO
- apk add --update curl openssl bash git openssh make
Expand Down Expand Up @@ -102,5 +110,3 @@ release:helm:
- git remote set-url --push origin "${PUSH_REPO}"
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- git push origin gh-pages
dependencies:
- versioning

0 comments on commit dbfc75b

Please sign in to comment.