From 39c6213525dcdd95ac9d4d27cfa189410be279c3 Mon Sep 17 00:00:00 2001 From: Emma Humber <87994408+ehumber@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:46:34 +0100 Subject: [PATCH 1/2] CPBR-1680: adding cp-jar-build block for PR builds (#492) (#8) (#10) Co-authored-by: Prince Raheja <114437476+rahejaprince@users.noreply.github.com> Co-authored-by: ConfluentSemaphore <40306929+ConfluentSemaphore@users.noreply.github.com> --- .semaphore/semaphore.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index fa94b690cb..a33ccf3635 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -61,6 +61,32 @@ blocks: - mvn -U -Dmaven.wagon.http.retryHandler.count=10 --batch-mode -DaltDeploymentRepository=confluent-codeartifact-internal::default::https://confluent-519856050701.d.codeartifact.us-west-2.amazonaws.com/maven/maven-snapshots/ -DrepositoryId=confluent-codeartifact-internal deploy -DskipTests + - name: CP Jar Build CI Gating + dependencies: [ ] + run: + # Run this block only for pull requests + when: "pull_request =~ '.*'" + task: + env_vars: + - name: COMPONENT_NAME + value: rest-utils + jobs: + - name: Trigger and wait for CP Jar Build Task + commands: + # Don't run this block if target branch for PR is not a nightly branch or master branch + # cp-jar-build today doesn't support other branches + - | + if [[ "$SEMAPHORE_GIT_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$SEMAPHORE_GIT_BRANCH" == "master" ]] ; then \ + echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is CP nightly or master branch. Triggering cp-jar-build task."; \ + sem-trigger -p packaging \ + -t cp-jar-build \ + -b $SEMAPHORE_GIT_BRANCH \ + -d "|" -i "CUSTOM_BRANCH_COMPONENTS|${COMPONENT_NAME}=${SEMAPHORE_GIT_WORKING_BRANCH}" \ + -w; \ + else \ + echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is not CP nightly or master branch. Skipping cp-jar-build task."; \ + fi; + after_pipeline: task: agent: From 4d75cf1e9ecc43f778199f64fe219bb5f0f09aac Mon Sep 17 00:00:00 2001 From: Emma Humber <87994408+ehumber@users.noreply.github.com> Date: Wed, 11 Sep 2024 17:41:56 +0100 Subject: [PATCH 2/2] skipping cp jar builds on master branch PRs (#11) (#12) Co-authored-by: Prince Raheja <114437476+rahejaprince@users.noreply.github.com> --- .semaphore/semaphore.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index a33ccf3635..dd50134ca2 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -73,18 +73,17 @@ blocks: jobs: - name: Trigger and wait for CP Jar Build Task commands: - # Don't run this block if target branch for PR is not a nightly branch or master branch - # cp-jar-build today doesn't support other branches + # Don't run this block if target branch for PR is not a CP nightly branch - | - if [[ "$SEMAPHORE_GIT_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$SEMAPHORE_GIT_BRANCH" == "master" ]] ; then \ - echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is CP nightly or master branch. Triggering cp-jar-build task."; \ + if [[ "$SEMAPHORE_GIT_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]] ; then \ + echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is CP nightly branch. Triggering cp-jar-build task."; \ sem-trigger -p packaging \ -t cp-jar-build \ -b $SEMAPHORE_GIT_BRANCH \ -d "|" -i "CUSTOM_BRANCH_COMPONENTS|${COMPONENT_NAME}=${SEMAPHORE_GIT_WORKING_BRANCH}" \ -w; \ else \ - echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is not CP nightly or master branch. Skipping cp-jar-build task."; \ + echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is not CP nightly branch. Skipping cp-jar-build task."; \ fi; after_pipeline: