Skip to content

Commit

Permalink
[CI] Require Manual Approval for the Build Stage (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
junrushao authored Sep 17, 2023
1 parent ba82a8d commit 8d45f00
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/trigger-jenkins-build.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions ci/jenkins/mlc_jenkinsfile.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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_*
Expand Down

0 comments on commit 8d45f00

Please sign in to comment.