Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .azuredevops/rocm_ci_caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
trigger: none
pr:
branches:
include:
- release/rocm-rel-*
drafts: false

variables:
- group: internal
- name: REPOSITORY_NAME
value: '$(Build.Repository.Name)'
- name: HEAD_SHA
value: '$(system.pullRequest.sourceCommitId)'
- name: PR_NUM
value: '$(system.pullRequest.pullRequestNumber)'
- name: PR_URL
value: '$(system.pullRequest.sourceRepositoryUri)/pull/$(PR_NUM)'
- name: BASE_REF
value: '$(system.pullRequest.TargetBranch)'
- name: EVENT_TYPE
value: 'pull_request'
- name: GH_PAT
value: '$(svc_acc_org_secret)'
jobs:
- job: Trigger_Pipeline
displayName: 'Trigger Pipeline'
pool: rocm-ci-caller
steps:
- checkout: none
- script: |
rm -rf $(repo_name)
git clone $(gh_repo)
displayName: Checkout Code
- script: |
set -e
echo "Calling jenkins_api.py for PR #$(PR_NUM)"
cd $(repo_name)
docker run \
-v "$PWD:/src" \
-w /src \
-e GH_TOKEN="$(svc_acc_org_secret)" \
-e svc_acc_org_secret="$(svc_acc_org_secret)" \
$(base_image) \
bash -c "echo 'Fetching PR title from GitHub API...' && \
echo 'repos/$(REPOSITORY_NAME)/pulls/$(PR_NUM)' && \
export TITLE=\$(gh api repos/$(REPOSITORY_NAME)/pulls/$(PR_NUM) | jq -r .title) && \
python3 jenkins_api.py \
-ghr '$(REPOSITORY_NAME)' \
-ghsha '$(HEAD_SHA)' \
-ghprn '$(PR_NUM)' \
-ghpru '$(PR_URL)' \
-ghprt \"\$TITLE\" \
-ghpat '$(GH_PAT)' \
-br '$(BASE_REF)' \
-et '$(EVENT_TYPE)'" > /dev/null 2>&1
displayName: Invoke jenkins_api.py in Docker
env:
svc_acc_org_secret: $(svc_acc_org_secret)