From 5796b2d18b10f60ac6dc4eaa9c71fd191f84f774 Mon Sep 17 00:00:00 2001 From: Veerabhadra <123445559+vr029@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:50:37 +0530 Subject: [PATCH] Add latest service bot changes to 7.2.x (#69) * chore: update repo semaphore config * chore: update repo semaphore task * chore: update repo semaphore task --------- Co-authored-by: veerabhadra --- .semaphore/cp_dockerfile_build.yml | 18 +++++++++++++++--- .semaphore/cp_dockerfile_promote.yml | 15 ++++++++------- .semaphore/semaphore.yml | 13 +++++++++++-- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.semaphore/cp_dockerfile_build.yml b/.semaphore/cp_dockerfile_build.yml index be8123709..47e67e582 100644 --- a/.semaphore/cp_dockerfile_build.yml +++ b/.semaphore/cp_dockerfile_build.yml @@ -86,8 +86,17 @@ global_job_config: - export AMD_ARCH=.amd64 - export ARM_ARCH=.arm64 blocks: - - name: Build, Test, & Scan AMD + - name: Validation dependencies: [] + run: + when: "branch = 'master'" + task: + jobs: + - name: Validation + commands: + - . sem-pint -c + - name: Build, Test, & Scan AMD + dependencies: ["Validation"] run: # don't run the tests on non-functional changes... when: "change_in('/', {exclude: ['/.deployed-versions/', '.github/']})" @@ -145,7 +154,7 @@ blocks: - docker tag $DEV_IMAGE_FULL $PROD_IMAGE_NAME:$LATEST_PUSH_TAG - docker push $PROD_IMAGE_NAME:$LATEST_PUSH_TAG - name: Build & Test ARM - dependencies: [] + dependencies: ["Validation"] run: # don't run the tests on non-functional changes... when: "change_in('/', {exclude: ['/.deployed-versions/', '.github/']})" @@ -214,7 +223,10 @@ blocks: - export DOCKER_PROD_IMAGE_NAME=$DOCKER_PROD_REGISTRY${DOCKER_REPOS// / $DOCKER_PROD_REGISTRY} - ci-tools ci-update-version - ci-tools ci-push-tag - - echo "Skipping Maven Deploy" + - |- + if [[ ! $IS_RELEASE && ! $IS_PREVIEW ]]; then + mvn -Dmaven.wagon.http.retryHandler.count=3 --batch-mode -P jenkins,docker -DaltDeploymentRepository=confluent-codeartifact-internal::default::https://confluent-519856050701.d.codeartifact.us-west-2.amazonaws.com/maven/maven-snapshots/ -DrepositoryId=confluent-codeartifact-internal deploy -DskipTests -Ddocker.skip-build=true -Ddocker.skip-test=true + fi # Create manifest - >- for image in $DOCKER_PROD_IMAGE_NAME; diff --git a/.semaphore/cp_dockerfile_promote.yml b/.semaphore/cp_dockerfile_promote.yml index de6c8be1d..558eab74e 100644 --- a/.semaphore/cp_dockerfile_promote.yml +++ b/.semaphore/cp_dockerfile_promote.yml @@ -56,8 +56,8 @@ blocks: commands: - export OS_TYPE="ubi8" - export DOCKER_REPO="confluentinc/cp-kcat" - - if [[ "$OS_TYPE" =~ "$PROMOTE_OS_TYPE*" || ! "$OS_TYPE" ]]; then export OS_TAG=""; else export OS_TAG="-$OS_TYPE"; fi - - export INTERNAL_IMAGE_TAG="$BRANCH_TAG-$PACKAGING_BUILD_NUMBER$OS_TAG" + - if [[ ! "$OS_TYPE" ]]; then export OS_TAG=""; elif [[ "$OS_TYPE" =~ $PROMOTE_OS_TYPE* ]]; then export OS_TAG="-$OS_TYPE"; fi + - export INTERNAL_IMAGE_TAG="$BRANCH_TAG-$PACKAGING_BUILD_NUMBER$OS_TAG$AMD_ARCH" - export PROMOTED_TAG="$PROMOTED_TAG_PREFIX$OS_TAG$AMD_ARCH" - docker pull $DOCKER_PROD_REGISTRY$DOCKER_REPO:$INTERNAL_IMAGE_TAG - docker tag $DOCKER_PROD_REGISTRY$DOCKER_REPO:$INTERNAL_IMAGE_TAG $DOCKER_REPO:$PROMOTED_TAG @@ -65,7 +65,7 @@ blocks: - if [[ ! "$STAGING_CHECK_SUCCEED" ]]; then echo "Detected there was a staging repo in image $DOCKER_REPO:$PROMOTED_TAG refusing to promote." && exit 1; fi - docker push $DOCKER_REPO:$PROMOTED_TAG - >- - if [[ ! "$OS_TYPE" ]] || [[ "$OS_TYPE" =~ "ubi*" ]]; then + if [[ ! "$OS_TYPE" ]] || [[ "$OS_TYPE" =~ ubi* ]]; then export APPLY_TAG=$CONFLUENT_VERSION$AMD_ARCH docker tag $DOCKER_PROD_REGISTRY$DOCKER_REPO:$INTERNAL_IMAGE_TAG $DOCKER_REPO:$APPLY_TAG docker push $DOCKER_REPO:$APPLY_TAG @@ -88,8 +88,8 @@ blocks: commands: - export OS_TYPE="ubi8" - export DOCKER_REPO="confluentinc/cp-kcat" - - if [[ "$OS_TYPE" =~ "$PROMOTE_OS_TYPE*" || ! "$OS_TYPE" ]]; then export OS_TAG=""; else export OS_TAG="-$OS_TYPE"; fi - - export INTERNAL_IMAGE_TAG="$BRANCH_TAG-$PACKAGING_BUILD_NUMBER$OS_TAG" + - if [[ ! "$OS_TYPE" ]]; then export OS_TAG=""; elif [[ "$OS_TYPE" =~ $PROMOTE_OS_TYPE* ]]; then export OS_TAG="-$OS_TYPE"; fi + - export INTERNAL_IMAGE_TAG="$BRANCH_TAG-$PACKAGING_BUILD_NUMBER$OS_TAG$ARM_ARCH" - export PROMOTED_TAG="$PROMOTED_TAG_PREFIX$OS_TAG$ARM_ARCH" - docker pull $DOCKER_PROD_REGISTRY$DOCKER_REPO:$INTERNAL_IMAGE_TAG - docker tag $DOCKER_PROD_REGISTRY$DOCKER_REPO:$INTERNAL_IMAGE_TAG $DOCKER_REPO:$PROMOTED_TAG @@ -97,7 +97,7 @@ blocks: - if [[ ! "$STAGING_CHECK_SUCCEED" ]]; then echo "Detected there was a staging repo in image $DOCKER_REPO:$PROMOTED_TAG refusing to promote." && exit 1; fi - docker push $DOCKER_REPO:$PROMOTED_TAG - >- - if [[ ! "$OS_TYPE" ]] || [[ "$OS_TYPE" =~ "ubi*" ]]; then + if [[ ! "$OS_TYPE" ]] || [[ "$OS_TYPE" =~ ubi* ]]; then export APPLY_TAG=$CONFLUENT_VERSION$ARM_ARCH docker tag $DOCKER_PROD_REGISTRY$DOCKER_REPO:$INTERNAL_IMAGE_TAG $DOCKER_REPO:$APPLY_TAG docker push $DOCKER_REPO:$APPLY_TAG @@ -119,12 +119,13 @@ blocks: - name: Create Manifest confluentinc/cp-kcat ubi8 commands: - export OS_TYPE="ubi8" + - if [[ ! "$OS_TYPE" ]]; then export OS_TAG=""; elif [[ "$OS_TYPE" =~ $PROMOTE_OS_TYPE* ]]; then export OS_TAG="-$OS_TYPE"; fi - export DOCKER_REPO="confluentinc/cp-kcat" - export PROMOTED_TAG="$PROMOTED_TAG_PREFIX$OS_TAG" - docker manifest create $DOCKER_REPO:$PROMOTED_TAG $DOCKER_REPO:$PROMOTED_TAG$AMD_ARCH $DOCKER_REPO:$PROMOTED_TAG$ARM_ARCH - docker manifest push $DOCKER_REPO:$PROMOTED_TAG - >- - if [[ ! "$OS_TYPE" ]] || [[ "$OS_TYPE" =~ "ubi*" ]]; then + if [[ ! "$OS_TYPE" ]] || [[ "$OS_TYPE" =~ ubi* ]]; then docker manifest create $DOCKER_REPO:$CONFLUENT_VERSION $DOCKER_REPO:$CONFLUENT_VERSION$AMD_ARCH $DOCKER_REPO:$CONFLUENT_VERSION$ARM_ARCH docker manifest push $DOCKER_REPO:$CONFLUENT_VERSION export APPLIED="true" diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 8ad1189ab..6cddcca4b 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -79,8 +79,17 @@ global_job_config: - export AMD_ARCH=.amd64 - export ARM_ARCH=.arm64 blocks: - - name: Build, Test, & Scan AMD + - name: Validation dependencies: [] + run: + when: "branch = 'master'" + task: + jobs: + - name: Validation + commands: + - . sem-pint -c + - name: Build, Test, & Scan AMD + dependencies: ["Validation"] run: when: "pull_request =~ '.*'" task: @@ -110,7 +119,7 @@ blocks: - artifact push workflow target/test-results - artifact push workflow target --destination target-AMD - name: Build & Test ARM - dependencies: [] + dependencies: ["Validation"] run: when: "pull_request =~ '.*'" task: