diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index a2cd7ced3..205c0957f 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -74,6 +74,28 @@ blocks: commands: - git clone --branch master --single-branch git@github.com:confluentinc/connect-releases.git - ./connect-releases/tasks/release-connect-plugins/generate-connect-changelogs.sh + - name: Connector Jar KDP Tests Gating + dependencies: [] + run: + # Run this block only for pull requests + when: "pull_request =~ '.*'" + task: + jobs: + - name: Trigger and wait for Connect Jar KDP Test Task + commands: + # Don't run this block if target branch for PR is not a nightly branch or master 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 feature or master branch. Triggering connector-jar-build task."; \ + sem-trigger -p connect-ci-cd-pipelines \ + -t run-connector-jar-tests \ + -b master \ + -i "REPO_NAME:$(basename $SEMAPHORE_GIT_REPO_SLUG)" \ + -i "BRANCH_NAME:${SEMAPHORE_GIT_PR_BRANCH}" \ + -w + else \ + echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is not feature or master branch. Skipping connector-jar-build task."; \ + fi; after_pipeline: task: