Skip to content

Commit

Permalink
add skip ci pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
pxLi committed Sep 4, 2020
1 parent 26c22a0 commit c754550
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/security-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ name: security check

on:
pull_request_target:
branches:
- branch-*
types: [opened, reopened, synchronize]

jobs:
Expand Down
27 changes: 27 additions & 0 deletions jenkins/Jenkinsfile-blossom.premerge
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ spec:
def githubHelper // blossom github helper
def IMAGE_PREMERGE // temp image for premerge test
def PREMERGE_TAG
def skipped = false

pipeline {
agent {
Expand Down Expand Up @@ -123,11 +124,26 @@ pipeline {
steps {
script {
githubHelper = GithubHelper.getInstance("${GITHUB_TOKEN}", githubData)
def title = githubHelper.getIssue().title

if (title ==~ /.*\[skip ci\].*/) {
githubHelper.updateCommitStatus("$BUILD_URL", "Skipped", GitHubCommitState.SUCCESS)
currentBuild.result == "SUCCESS"
skipped = true
return
}
}
}
}

stage('Build docker image') {
when {
beforeAgent true
expression {
!skipped
}
}

agent {
kubernetes {
label "premerge-docker-${BUILD_TAG}"
Expand Down Expand Up @@ -178,6 +194,13 @@ pipeline {

// TODO: support parallel testing for different spark versions
stage('Premerge Test') {
when {
beforeAgent true
expression {
!skipped
}
}

agent {
kubernetes {
label "premerge-test-${BUILD_TAG}"
Expand Down Expand Up @@ -219,6 +242,10 @@ pipeline {
post {
always {
script {
if (skipped) {
return
}

deleteDockerTempTag(PREMERGE_TAG) // clean premerge temp image
if (currentBuild.currentResult == "SUCCESS") {
githubHelper.updateCommitStatus("$BUILD_URL", "Success", GitHubCommitState.SUCCESS)
Expand Down

0 comments on commit c754550

Please sign in to comment.