[JIRA] (JENKINS-57265) SCM Skip doesn't abort my docker builds until much later

10 views
Skip to first unread message

bryce.schober@gmail.com (JIRA)

unread,
Apr 30, 2019, 3:52:03 PM4/30/19
to jenkinsc...@googlegroups.com
Bryce Schober created an issue
 
Jenkins / Bug JENKINS-57265
SCM Skip doesn't abort my docker builds until much later
Issue Type: Bug Bug
Assignee: Gregor Plavčak
Components: scmskip-plugin
Created: 2019-04-30 19:51
Environment: Latest LTS Jenkins & plugins
SCM Skip v1.01
Priority: Minor Minor
Reporter: Bryce Schober

My declarative pipeline builds don't get aborted until much later, for some reason that I don't understand. My Jenkinsfile looks something like:

pipeline {

  // Any SkyView Docker agent can build this.
  agent {
    docker {
     label 'docker-host'
      image '...'
      ...
    }
  }

  options {
    timestamps()
    disableConcurrentBuilds()
    buildDiscarder ...
  }

  environment {
    ...
  }

  stages {

    stage('Prepare') {
      steps {
        // Set some options that can't be done in multibranch config GUI, like code browser
        checkout(...)
        scmSkip(deleteBuild: true, skipPattern: '.*\\[(ci skip|skip ci)\\].*')
      }
    }

    stage ('Unit Tests') {
      steps {
        ...
      }
    }

    stage ('Build') {
      steps {
        // run the long build script that also  commits build number/version files with "[skip ci]"
      }
    }

    stage ('Integration Tests') {
      steps {
        ...
      }
    }

  } // stages
  // Post-build steps
  post {
    always {
      // Notify rules
    }
    success {
      archiveArtifacts ...
      // Trigger downstream job(s)
    }
  }
}

My build output looks something like:

...
[Pipeline] Start of Pipeline
[Pipeline] node
Running on <server> in <workspace>
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
...
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withDockerRegistry
$ docker login -u gitlab+deploy-token-35921 -p ******** https://registry.gitlab.com/dynonavionics/docker
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Agent Setup)
[Pipeline] sh
+ docker pull ...
Status: Image is up to date for <image>
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
+ docker inspect ...
[Pipeline] withDockerContainer
<server> does not seem to be running inside a container
$ docker run ...
[Pipeline] {
[Pipeline] withCredentials
...
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] timestamps
[Pipeline] {
$ docker top ...
[Pipeline] stage
[Pipeline] { (Prepare)
[Pipeline] checkout
cleanup, update, etc...
[Pipeline] scmSkip
11:39:48.620  SCM Skip: Pattern .*\[(ci skip|skip ci)\].* matched on message: Preparing for version 15.5.A3, build 05321. [skip ci]
[Pipeline] }
[Pipeline] stage
[Pipeline] { (Unit Tests)
...
[Pipeline] }
[Pipeline] stage
[Pipeline] { (Build)
... running the entire long build script successfully
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Integration Tests)
[Pipeline] echo
11:52:38.374  TODO: Subsume down-stream test jobs and make this a complete pipeline!
[Pipeline] }
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
...[Pipeline] step
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }

As you can see, it continued with the entire build, but it just deleted it at the end instead of aborting. What am I doing wrong? Is that the behavior I should expect when I set deleteBuild: true? I assumed that it would abort the run and delete it...

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

tamerlaha@gmail.com (JIRA)

unread,
Jul 30, 2019, 2:20:02 PM7/30/19
to jenkinsc...@googlegroups.com
ipleten commented on Bug JENKINS-57265
 
Re: SCM Skip doesn't abort my docker builds until much later

I have the same issue with kubernetes plugin.

ScmSkip matches the pattern but still continues with pipeline!

tamerlaha@gmail.com (JIRA)

unread,
Jul 30, 2019, 2:24:02 PM7/30/19
to jenkinsc...@googlegroups.com

tamerlaha@gmail.com (JIRA)

unread,
Jul 30, 2019, 2:25:02 PM7/30/19
to jenkinsc...@googlegroups.com
ipleten commented on Bug JENKINS-57265
 
Re: SCM Skip doesn't abort my docker builds until much later

I can't find any "hacky" approach how to exclude commit from build. 

tamerlaha@gmail.com (JIRA)

unread,
Jul 30, 2019, 2:26:02 PM7/30/19
to jenkinsc...@googlegroups.com
ipleten edited a comment on Bug JENKINS-57265
I can't find any non- "hacky" approach how to exclude commit from build on message content None of plugins seems work with multibranch pipelines.
Reply all
Reply to author
Forward
0 new messages