Skip to content

Commit

Permalink
SONAR-24200 Add new required annotation in DCE for GCP apps
Browse files Browse the repository at this point in the history
  • Loading branch information
carminevassallo committed Jan 24, 2025
1 parent 5f78296 commit 62e2be8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .cirrus/multi-arch-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export DOCKER_BUILDKIT=1
for i in $(seq 1 3); do
if docker buildx build --platform linux/amd64,linux/arm64 --tag "$1:$2" --label "com.googleapis.cloudmarketplace.product.service.name=services/sonarqube-dce" --push $3; then
if docker buildx build --platform linux/amd64,linux/arm64 --tag "$1:$2" --push $3; then
echo "[Success]: Buildx, attempt ${i}"
exit 0
fi
Expand Down
28 changes: 4 additions & 24 deletions .cirrus/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ multi_arch_build_gcp_prod_task:
- echo -e "FROM ${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}/sonarqube-dce-search:${CURRENT_MINOR_VERSION}\nLABEL com.googleapis.cloudmarketplace.product.service.name=services/sonarqube-dce" | docker build -t ${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}"
- docker inspect "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}:${CURRENT_VERSION}"
- docker inspect "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}:${CURRENT_MINOR_VERSION}"
- docker inspect "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}/sonarqube-dce-search:${CURRENT_VERSION}"
- docker inspect "${GCLOUD_REGISTRY}/${GCLOUD_PRODUCT_NAME}/sonarqube-dce-search:${CURRENT_MINOR_VERSION}"

multi_arch_build_gcp_staging_task:
only_if: $CIRRUS_CRON == 'nightly-mend-scan' || $TRIGGER == 'PUSH_GCP_STAGING_IMAGES'
Expand All @@ -90,8 +86,6 @@ multi_arch_build_gcp_staging_task:
- echo "Build and promote the ${STAGING_IMAGE_NAME}:${NEXT_VERSION} and ${STAGING_IMAGE_NAME}:${NEXT_MINOR_VERSION} image supporting two architectures, linux/amd64 and linux/arm64"
- .cirrus/multi-arch-build.sh ${STAGING_IMAGE_NAME} $NEXT_VERSION ${version}
- .cirrus/multi-arch-build.sh ${STAGING_IMAGE_NAME} $NEXT_MINOR_VERSION ${version}
- docker inspect ${STAGING_IMAGE_NAME}:${NEXT_VERSION}
- docker inspect ${STAGING_IMAGE_NAME}:${NEXT_MINOR_VERSION}

multi_arch_build_task_template: &multi_arch_build_task_template
ec2_instance:
Expand Down Expand Up @@ -129,29 +123,15 @@ multi_arch_build_2025_x_task:
skip: "!changesInclude('2025.1/**/*') && !changesInclude('.cirrus/*')"
env:
matrix:
- version: ${NEXT_VERSION}/developer
- version: 2025.1/developer
tag: ${NEXT_VERSION}-developer
- version: ${NEXT_VERSION}/enterprise
- version: 2025.1/enterprise
tag: ${NEXT_VERSION}-enterprise
- version: ${NEXT_VERSION}/datacenter/app
- version: 2025.1/datacenter/app
tag: ${NEXT_VERSION}-datacenter-app
- version: ${NEXT_VERSION}/datacenter/search
- version: 2025.1/datacenter/search
tag: ${NEXT_VERSION}-datacenter-search

multi_arch_build_task_template: &multi_arch_build_task_template
ec2_instance:
<<: *VM_TEMPLATE
login_script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
setup_script:
- docker run -t --rm --privileged tonistiigi/binfmt --install all
- docker buildx create --name multibuilder --driver docker-container
- docker buildx use multibuilder
- docker buildx inspect --bootstrap
build_script:
- echo "Build the ${STAGING_IMAGE_NAME}:${tag} image supporting two architectures, linux/amd64 and linux/arm64"
- .cirrus/multi-arch-build.sh ${STAGING_IMAGE_NAME} ${tag} ${version}

multi_arch_build_community_build_task:
<<: *multi_arch_build_task_template
skip: "!changesInclude('community-build/*') && !changesInclude('.cirrus/*')"
Expand Down
1 change: 1 addition & 0 deletions 2025.1/datacenter/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LABEL io.openshift.min-memory=2048M
LABEL io.openshift.non-scalable=false
LABEL io.openshift.tags=sonarqube,static-code-analysis,code-quality,clean-code
LABEL org.opencontainers.image.url=https://github.com/SonarSource/docker-sonarqube
LABEL com.googleapis.cloudmarketplace.product.service.name=services/sonarqube-dce

ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US:en' \
Expand Down
1 change: 1 addition & 0 deletions 2025.1/datacenter/search/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LABEL io.openshift.min-memory=2048M
LABEL io.openshift.non-scalable=false
LABEL io.openshift.tags=sonarqube,static-code-analysis,code-quality,clean-code
LABEL org.opencontainers.image.url=https://github.com/SonarSource/docker-sonarqube
LABEL com.googleapis.cloudmarketplace.product.service.name=services/sonarqube-dce

ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US:en' \
Expand Down
8 changes: 4 additions & 4 deletions release.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Release of a new version of the official SonarQube Server Docker images is made
1. Set the new version of SonarQube Server (`SONARQUBE_VERSION`) to be released in the Dockerfiles. In case of community build, please remember to update `community-build/Dockerfile` only.
2. If you are releasing a new LTA, set `CURRENT_LTA_VERSION` in `.cirrus/tasks.yml`. Otherwise, if you are releasing a Community build, set `COMMUNITY_BUILD_VERSION` only. In all the other cases where a paid edition is about to be releases, set `CURRENT_VERSION` (please note that the nightly build will fail before the public image becomes available).
3. Update the docker hub SonarQube Server's documentation (if applicable)
4. Add a GIT tag for the new version
1. If you are releasing a SonarQube Server version, you need to [Draft a New Release](https://github.com/SonarSource/docker-sonarqube/releases/new), where the name matches "SonarQube Server 2025.", followed by the month version, i.e., "SonarQube Server 2025.1".
2. Likewise, if you are releasing a Community Build, the release name should match "Community Build", followed by the month version, i.e., "Community Build 25.1".
5. Update Docker Hub's SonarQube Server images
4. Update Docker Hub's SonarQube Server images
5. Add a GIT tag for the new version (This needs to be done after the images become available on DockerHub)
1. If you are releasing a SonarQube Server version, you need to [Add a New Release](https://github.com/SonarSource/docker-sonarqube/releases/new), where the name matches "SonarQube Server", followed by the release version, e.g., "SonarQube Server 2025.1.0".
2. Likewise, if you are releasing a Community Build, the release name should match "Community Build", followed by the release version, e.g., "Community Build 25.1.102122".

## Bump the version of SonarQube Server in Dockerfiles

Expand Down

0 comments on commit 62e2be8

Please sign in to comment.