Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONAR-21721 Package the Datacenter Docker images for GCP #669

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ env:

DOCKER_USERNAME: VAULT[development/kv/data/docker/sonardockerrw data.username]
DOCKER_PASSWORD: VAULT[development/kv/data/docker/sonardockerrw data.access_token_rwd]
DOCKER_GCLOUD_SA_KEY: VAULT[development/team/sonarqube/kv/data/gcp-marketplace-registry-staging data.key]

WS_PRODUCTNAME: SonarSource/docker-sonarqube
STAGING_IMAGE_NAME: sonarsource/sonarqube
PUBLIC_IMAGE_NAME: sonarqube
GCLOUD_REGISTRY: gcr.io/sonarqube-marketplace-provider
GCLOUD_PRODUCT_NAME: sonarqube-dce
CURRENT_LTS_VERSION: 9.9.4
CURRENT_VERSION: 10.4.1
NEXT_VERSION: 10.5.0
Expand All @@ -21,6 +24,29 @@ vm_instance_template: &VM_TEMPLATE
region: eu-central-1
subnet_id: ${CIRRUS_AWS_SUBNET}

multi_arch_build_gcp_task:
only_if: $CIRRUS_CRON == 'nightly-mend-scan'
ec2_instance:
<<: *VM_TEMPLATE
pull_public_images_script:
- echo "Pull the ${PUBLIC_IMAGE_NAME} datacenter public images"
- docker pull "${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-app"
- docker pull "${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-search"
login_to_gcr_script:
- export DOCKER_GCLOUD_PASSWORD=$(echo ${DOCKER_GCLOUD_SA_KEY} | base64 -d)
- docker login -u _json_key -p "$DOCKER_GCLOUD_PASSWORD" https://${GCLOUD_REGISTRY}
tag_and_promote_script:
- export CURRENT_MINOR_VERSION=$(echo ${CURRENT_VERSION} | cut -d '.' -f 1,2)
- echo "Promote the ${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-app images supporting two architectures (linux/amd64 and linux/arm64) to the GCP registry ${GCLOUD_REGISTRY}"
- docker tag "${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-app" "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}:${CURRENT_VERSION}"
- docker tag "${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-app" "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}:${CURRENT_MINOR_VERSION}"
- docker push "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}:${CURRENT_VERSION}"
- docker push "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}:${CURRENT_MINOR_VERSION}"
- echo "Promote the ${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-search images supporting two architectures (linux/amd64 and linux/arm64) to the GCP registry ${GCLOUD_REGISTRY}"
- docker tag "${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-search" "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}/sonarqube-dce-search:${CURRENT_VERSION}"
- docker tag "${PUBLIC_IMAGE_NAME}:${CURRENT_VERSION}-datacenter-search" "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}/sonarqube-dce-search:${CURRENT_MINOR_VERSION}"
- docker push "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}/sonarqube-dce-search:${CURRENT_VERSION}"
- docker push "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}/sonarqube-dce-search:${CURRENT_MINOR_VERSION}"

multi_arch_build_task:
env:
Expand Down Expand Up @@ -152,3 +178,4 @@ multi_arch_test_task:
- ulimit -n 131072 # set the recommended number of opened file descriptors for ES
- ./run-tests.sh "${STAGING_IMAGE_NAME}:${tag}" "${test_name}"
depends_on: multi_arch_build

Loading