Skip to content

Commit

Permalink
Merge pull request PixarAnimationStudios#453 from autodesk-forks/adsk…
Browse files Browse the repository at this point in the history
…/internal-only/feature/pipeline_adsk

Update Pipeline of adsk/dev
  • Loading branch information
zhangha182 authored and GitHub Enterprise committed Jun 15, 2023
2 parents b02c2ea + 6562fff commit 60c2a52
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ if (isDevBranch()) {
git reset ${conflictCommitId}
git reset --hard HEAD^
git checkout resolve/dev
git merge --no-commit --no-ff dev --allow-unrelated-histories || true
"""
def newMergeMsg = COMMONSHELL.capture_script_output("git merge --no-commit --no-ff dev --allow-unrelated-histories || true")
if (newMergeMsg.contains("Already up to date"))
{
echo "There is nothing to merge."
return
}
COMMONSHELL.shell """\
git commit -m "Merge branch origin/dev into resolve/dev"
"""
emailext body: gitMergeMsg,
Expand All @@ -198,14 +205,27 @@ if (isDevBranch()) {
def headBranch = 'resolve/dev'
def baseBranch = "adsk/dev"
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'github_access_token_with_user', usernameVariable: 'git_user', passwordVariable: 'git_token']]) {
COMMONSHELL.shell """\
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${env.git_token}"\
${baseUrl} \
-d '{"title":"$title","head":"$headBranch","base":"$baseBranch","body":"$body"}'
"""
def resp = COMMONSHELL.capture_script_output """\
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${env.git_token}"\
${baseUrl} \
-d '{"title":"$title","head":"$headBranch","base":"$baseBranch","body":"$body"}'
"""
if (resp.contains("\"state\": \"open\""))
{
def matcher = resp =~ /"url": "(.*)"/
String url = matcher[0][1]
COMMONSHELL.shell """\
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${env.git_token}"\
${url}/requested_reviewers \
-d '{"reviewers":["wangfr","fanc","zhangha"]}'
"""
}
}
}
}
Expand Down

0 comments on commit 60c2a52

Please sign in to comment.