Skip to content

Lay groundwork to release QA image to Dockerhub

Balasankar 'Balu' C requested to merge release-qa-image-to-dockerhub into master

What does this MR do and why?

As part of publishing QA images on tag pipelines, release them to Dockerhub also.

Images corresponding to the latest tag are pushed as latest and rc also.

Closes: #372633 (closed)

Related to &8661

Testing

# Enable dry run and other project related variables
$ export QA_IMAGE_BUILD_DRY_RUN=true
$ export CI_PROJECT_NAMESPACE="gitlab-org"
$ export CI_REGISTRY="registry.gitlab.com"
$ export CI_PROJECT_NAME="gitlab"
$ export CI_PROJECT_PATH="gitlab-org/gitlab"

## 1. Testing branch builds
$ export CI_COMMIT_SHA="c81d22a5fd57fac3ece66690e98504bf6d97c37a"
$ export CI_COMMIT_REF_SLUG="release-qa-image-to-dockerhub"
$ bash scripts/build_qa_image
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:release-qa-image-to-dockerhub --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd5

## 2. Testing tag builds without feature flag variable
## See how pushes to Dockerhub aren't present
$ export RELEASE_QA_IMAGE_TO_DOCKERHUB="false"
$ export CI_COMMIT_TAG="v15.8.0-ee"
$ export CI_COMIT_REF_SLUG="v15-8-0-ee"
$ bash scripts/build_qa_image
RELEASE_QA_IMAGE_TO_DOCKERHUB not set to true. Not releasing to Dockerhub.
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:15.8.0-ee --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd5

## 3. Testing EE tag builds with feature flag variable
$ export RELEASE_QA_IMAGE_TO_DOCKERHUB="true"

### 3.1 Latest stable tag
### See how version, rc, and latest tags are pushed to Dockerhub
$ export CI_COMMIT_TAG="v15.8.0-ee"
$ export CI_COMIT_REF_SLUG="v15-8-0-ee"
$ bash scripts/build_qa_image
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:15.8.0-ee --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd5 --tag gitlab/gitlab-ee-qa:15.8.0-ee --tag gitlab/gitlab-ee-qa:rc --tag gitlab/gitlab-ee-qa:latest

### 3.2 Backport tag
### See how neither rc nor latest tags are pushed to Dockerhub. Only version tag is pushed to Dockerhub.
$ export CI_COMMIT_TAG="v15.4.0-ee"
$ export CI_COMIT_REF_SLUG="v15-4-0-ee"
$ bash scripts/build_qa_image
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:15.4.0-ee --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd5 --tag gitlab/gitlab-ee-qa:15.4.0-ee

### 3.3 Latest RC tag
### See how only version and rc tags are pushed to Dockerhub. latest tag is not pushed to Dockerhub.
#### Make the RC tag the latest one by deleting the latest tag
$ git tag -d v15.8.0-ee
$ export CI_COMMIT_TAG="v15.8.0-rc43-ee"
$ export CI_COMIT_REF_SLUG="v15-8-0-ee-rc43-ee"
$ bash scripts/build_qa_image
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:15.8.0-rc42-ee --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:c81d22a5fd5 --tag gitlab/gitlab-ee-qa:15.8.0-rc42-ee --tag gitlab/gitlab-ee-qa:rc

## 4. Testing CE tag builds with feature flag variable
# Do this in a clone of gitlab-foss project with the script replaced with the one from this MR
$ export QA_IMAGE_BUILD_DRY_RUN=true
$ export CI_PROJECT_NAMESPACE="gitlab-org"
$ export CI_REGISTRY="registry.gitlab.com"
$ export CI_PROJECT_NAME="gitlab-foss"
$ export CI_PROJECT_PATH="gitlab-org/gitlab-foss"
$ export RELEASE_QA_IMAGE_TO_DOCKERHUB="true"

### 4.1 Latest stable tag
### See how version, rc, and latest tags are pushed to Dockerhub
$ export CI_COMMIT_TAG="v15.8.0"
$ export CI_COMIT_REF_SLUG="v15-8-0"
$ bash scripts/build_qa_image
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:15.8.0 --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:c81d22a5fd5 --tag gitlab/gitlab-ce-qa:15.8.0 --tag gitlab/gitlab-ce-qa:rc --tag gitlab/gitlab-ce-qa:latest

### 4.2 Backport tag
### See how neither rc nor latest tags are pushed to Dockerhub. Only version tag is pushed to Dockerhub.
$ export CI_COMMIT_TAG="v15.4.0"
$ export CI_COMIT_REF_SLUG="v15-4-0"
$ bash scripts/build_qa_image
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:15.4.0 --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:c81d22a5fd5 --tag gitlab/gitlab-ce-qa:15.4.0

### 4.3 Latest RC tag
### See how only version and rc tags are pushed to Dockerhub. latest tag is not pushed to Dockerhub.
#### Make the RC tag the latest one by deleting the latest tag
$ git tag -d v15.8.0
$ export CI_COMMIT_TAG="v15.8.0-rc43"
$ export CI_COMIT_REF_SLUG="v15-8-0-rc43"
$ bash scripts/build_qa_image
Building QA image for destinations: --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:c81d22a5fd57fac3ece66690e98504bf6d97c37a --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:15.8.0-rc42 --tag registry.gitlab.com/gitlab-org/gitlab/gitlab-ce-qa:c81d22a5fd5 --tag gitlab/gitlab-ce-qa:15.8.0-rc42 --tag gitlab/gitlab-ce-qa:rc

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Balasankar 'Balu' C

Merge request reports