From 8d45f00c0440f69e0c12ef344cf49ae327b20c32 Mon Sep 17 00:00:00 2001 From: Junru Shao Date: Sat, 16 Sep 2023 22:01:12 -0700 Subject: [PATCH] [CI] Require Manual Approval for the Build Stage (#292) --- .github/workflows/trigger-jenkins-build.yml | 37 +++++++++++++++++++++ ci/jenkins/mlc_jenkinsfile.groovy | 4 +++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/trigger-jenkins-build.yml diff --git a/.github/workflows/trigger-jenkins-build.yml b/.github/workflows/trigger-jenkins-build.yml new file mode 100644 index 0000000000..9ae3438bab --- /dev/null +++ b/.github/workflows/trigger-jenkins-build.yml @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +name: Trigger Jenkins Build + +on: + issue_comment: + types: [created] + +jobs: + trigger-jenkins-test: + if: contains(github.event.comment.html_url, '/pull/') + runs-on: ubuntu-latest + steps: + - name: Trigger Jenkins Test + if: startsWith(github.event.comment.body, '\test') + run: | + echo say hello + JENKINS_URL=https://ci.mlc.ai/job/mlc/ + JENKINS_USER=junrushao + JENKINS_TOKEN=119c459c1b1c53d0e584cbaabe9e2de2cc + JENKINS_JOB=$JENKINS_URL/job/PR-${{ github.event.pull_request.number }} + BUILD_NUMBER=$(curl -s -X GET $JENKINS_JOB/lastBuild/buildNumber) + curl -X POST -u $JENKINS_USER:$JENKINS_TOKEN $JENKINS_JOB/$BUILD_NUMBER/input/1/proceedEmpty diff --git a/ci/jenkins/mlc_jenkinsfile.groovy b/ci/jenkins/mlc_jenkinsfile.groovy index 6c767cb72a..7beb2f9bd4 100644 --- a/ci/jenkins/mlc_jenkinsfile.groovy +++ b/ci/jenkins/mlc_jenkinsfile.groovy @@ -113,6 +113,10 @@ def unpack_lib(name, libs) { cancel_previous_build() +stage('Approval') { + input id: '1', message: 'Pending. Please reply "\\test" on GitHub to continue.' +} + stage('Prepare') { node('JUNRU-CPU-SMALL') { // When something is provided in ci_*_param, use it, otherwise default with ci_*