"tests/git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "48d990258549ca626fcf8c34488c00ed6fce108a"
Unverified Commit a3e00c44 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[CI] refine stage logic (#4565)

* [CI] refine stage logic

* refine

* refine
parent 795371ad
...@@ -136,7 +136,7 @@ def is_admin(name) { ...@@ -136,7 +136,7 @@ def is_admin(name) {
pipeline { pipeline {
agent any agent any
triggers { triggers {
issueCommentTrigger('@dgl-bot .*') issueCommentTrigger('@dgl-bot.*')
} }
stages { stages {
// Below 2 stages are to authenticate the change/comment author. // Below 2 stages are to authenticate the change/comment author.
...@@ -157,9 +157,7 @@ pipeline { ...@@ -157,9 +157,7 @@ pipeline {
def prOpenTriggerCause = currentBuild.getBuildCauses('jenkins.branch.BranchEventCause') def prOpenTriggerCause = currentBuild.getBuildCauses('jenkins.branch.BranchEventCause')
def first_run = prOpenTriggerCause && env.BUILD_ID == '1' def first_run = prOpenTriggerCause && env.BUILD_ID == '1'
if (author && !is_authorized(author)) { if (author && !is_authorized(author)) {
if (first_run) {
pullRequest.comment("Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment: \n - `@dgl-bot`") pullRequest.comment("Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment: \n - `@dgl-bot`")
}
error("Authentication failed.") error("Authentication failed.")
} }
if (first_run) { if (first_run) {
...@@ -201,6 +199,15 @@ pipeline { ...@@ -201,6 +199,15 @@ pipeline {
checkout scm checkout scm
script { script {
def comment = env.GITHUB_COMMENT def comment = env.GITHUB_COMMENT
def command_lists = comment.split(' ')
if (command_lists.size() == 1) {
// CI command, not for regression
return
}
if (command_lists.size() != 5) {
pullRequest.comment('Cannot run the regression test due to unknown command')
error('Unknown command')
}
def author = env.GITHUB_COMMENT_AUTHOR def author = env.GITHUB_COMMENT_AUTHOR
echo("${env.GIT_URL}") echo("${env.GIT_URL}")
echo("${env}") echo("${env}")
...@@ -212,14 +219,8 @@ pipeline { ...@@ -212,14 +219,8 @@ pipeline {
userRemoteConfigs: [[credentialsId: 'github', url: 'https://github.com/dglai/DGL_scripts.git']]]) userRemoteConfigs: [[credentialsId: 'github', url: 'https://github.com/dglai/DGL_scripts.git']]])
} }
sh('cp benchmark_scripts_repo/benchmark/* benchmarks/scripts/') sh('cp benchmark_scripts_repo/benchmark/* benchmarks/scripts/')
def command_lists = comment.split(' ')
def instance_type = command_lists[2].replace('.', '') def instance_type = command_lists[2].replace('.', '')
if (command_lists.size() != 5) {
pullRequest.comment('Cannot run the regression test due to unknown command')
error('Unknown command')
} else {
pullRequest.comment("Start the Regression test. View at ${RUN_DISPLAY_URL}") pullRequest.comment("Start the Regression test. View at ${RUN_DISPLAY_URL}")
}
def prNumber = env.BRANCH_NAME.replace('PR-', '') def prNumber = env.BRANCH_NAME.replace('PR-', '')
dir('benchmarks/scripts') { dir('benchmarks/scripts') {
sh('python3 -m pip install boto3') sh('python3 -m pip install boto3')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment