Skip to content

Commit 21d9a13

Browse files
patrick-premontrahejaprinceConfluentSemaphore
authored
CPBR-1680: adding cp-jar-build block for PR builds (confluentinc#492) (confluentinc#3)
Co-authored-by: Prince Raheja <114437476+rahejaprince@users.noreply.github.com> Co-authored-by: ConfluentSemaphore <40306929+ConfluentSemaphore@users.noreply.github.com>
1 parent 6155191 commit 21d9a13

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.semaphore/semaphore.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,32 @@ blocks:
6161
- 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/
6262
-DrepositoryId=confluent-codeartifact-internal deploy -DskipTests
6363

64+
- name: CP Jar Build CI Gating
65+
dependencies: [ ]
66+
run:
67+
# Run this block only for pull requests
68+
when: "pull_request =~ '.*'"
69+
task:
70+
env_vars:
71+
- name: COMPONENT_NAME
72+
value: rest-utils
73+
jobs:
74+
- name: Trigger and wait for CP Jar Build Task
75+
commands:
76+
# Don't run this block if target branch for PR is not a nightly branch or master branch
77+
# cp-jar-build today doesn't support other branches
78+
- |
79+
if [[ "$SEMAPHORE_GIT_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$SEMAPHORE_GIT_BRANCH" == "master" ]] ; then \
80+
echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is CP nightly or master branch. Triggering cp-jar-build task."; \
81+
sem-trigger -p packaging \
82+
-t cp-jar-build \
83+
-b $SEMAPHORE_GIT_BRANCH \
84+
-d "|" -i "CUSTOM_BRANCH_COMPONENTS|${COMPONENT_NAME}=${SEMAPHORE_GIT_WORKING_BRANCH}" \
85+
-w; \
86+
else \
87+
echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is not CP nightly or master branch. Skipping cp-jar-build task."; \
88+
fi;
89+
6490
after_pipeline:
6591
task:
6692
agent:

0 commit comments

Comments
 (0)