Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Martin Ringehahn
    @chrono
    We've already removed / consolidated a lot of fine-grained (short) steps that were running in highly parallel branches, because there was serialized execution behaviour visible around those, even though they "should" be parallel.
    JohnLussmyer
    @JohnLussmyer
    @JohnLussmyer Seems we just had to trigger the build manually, at least twice.
    Jim Persson
    @blejdfist
    Hi guys, question about the graphical pipeline editor. Does anyone have any experience, or know how to deal with, review? We use gerrit for code review and would like to utilize the graphical editor while at the same time maintaining the same code review workflow.
    Can this be achieved easily?
    Martin Ringehahn
    @chrono

    I've narrowed down my issues to the docker plugin:

    #!/usr/bin/groovy
    
    def parallelize(n, task) {
        def tasks = [:]
        for (int i = 0; i < n; i++) {
            def num = i // http://blog.freeside.co/2013/03/29/groovy-gotcha-for-loops-and-closure-scope/
            tasks["${num}"] = {
                node('bulk') {
                    task(num)
                }
            }
        }
        parallel(tasks)
    }
    
    timestamps {
        def threads = 80
        parallelize(threads) { id ->
            stage("plain ${id}") {
                sh 'docker pull busybox && docker run --rm busybox /bin/sleep 1'
            }
        }
        parallelize(threads) { id ->
            stage("withDockerContainer ${id}") {
                sh 'docker pull busybox'
                withDockerContainer('busybox') {
                    sleep(1)
                }
            }
        }
    }

    for threads = 5, the plain stages take <3s and the `withDockerContainer` stages run in <20s. For `threads = 80`, the runtimes are <10s and >4min respectively. I used withDockerContainer instead of image.inside since it is used internally anyway and does slightly less work than image.inside.

    JohnLussmyer
    @JohnLussmyer
    Odd History issue with our Pipeline jobs.
    If you cancel the job, commit more changes, then run the job - the history shows 0 commits. It won't start showing commits again until the next time you commit/run.
    JohnLussmyer
    @JohnLussmyer
    Pipeline doesn't capture console output?
    Our Ant script invokes a small java program that writes status to the console (System.out). In our older Jenkins jobs, this output appears in the captured Console of the job. In the new Pipeline job, the console output is NOT captured.
    How can I get the console output to be captured in a Pipeline job?
    Stancu Florin
    @StancuFlorin
    Hi guys. I have 2 stages like this in my pipeline. How can I add the condition on a step to have only 1 stage?
            stage('Deploy Zip') {
                when {
                    expression { params.ZIP_FILE == true }
                }
                steps {
                    sh 'zip -r $ZIP_FILE_NAME $FILES'
                    sh 'ncftpput -z -R -u $FTP_USER -p $FTP_PASS $FTP_HOST / $ZIP_FILE_NAME'
                }
            }
            stage('Deploy') {
                when {
                    expression { params.ZIP_FILE == false }
                }
                steps {
                    sh 'echo $FILES | xargs ncftpput -z -R -u $FTP_USER -p $FTP_PASS $FTP_HOST /'
                }
            }
    Code Raguet
    @code-sur
    Hi, there!
    I have a couple of question about implicit vs explicit checkout between agents within a Jenkinsfile
    can anyone help me?
    Liam Newman
    @bitwiseman
    Sure.
    If you haven’t already gotten that help. :)
    rajkumar g
    @rajkuma76525512_twitter
    Hi
    There
    I have doubt on creating approval job for UAT in Jenkins pipeline script
    can anyone help me?
    Gavin Mogan
    @halkeye
    Try #jenkinsci/jenkins this is more the development of the plugin
    Oleg Nenashev
    @oleg-nenashev
    Threads have been enabled in this room
    steven-foster
    @steven-foster
    was there a new pipeline engine in the works at some point or was I imagining things
    Oleg Nenashev
    @oleg-nenashev
    @/all Hi all. Next Wednesday there will be a Jenkins Online Meetup about the POET Pipeline Library/Framework: https://www.meetup.com/Jenkins-online-meetup/events/266238572/ . Please join if you are inetersted!
    Liam Newman
    @bitwiseman
    @steven-foster New pipeline engine? In what sense?
    Craig Rodrigues
    @rodrigc

    @oleg-nenashev from https://opensource.t-mobile.com/blog/posts/a-lean-mean-pipeline-machine/ :

    Jenkins Groovy code is limited, error-prone, and difficult to incorporate with 3rd party libraries.

    That is a pretty strong statement. I do understand the frustration of using Jenkins Groovy for the language of pipeline.

    Gavin Mogan
    @halkeye
    yea, shell out don't use groovy!
    Craig Rodrigues
    @rodrigc
    The problem with shelling out sh("") inside groovy is that if you have a shell script which uses variables, groovy uses the $ to denote a variable as well, so you need to keep track of if your variable should be expanded by Groovy or /bin/sh
    Also for pipeline, if you have a Jenkins plugin and you want to expose that functionality to a pipeline, what is normally done is to expose a function which can be called from groovy. So you cannot avoid groovy
    Looks like T-Mobile has open sourced their library, which is great! https://github.com/tmobile/POET-pipeline-library
    Liam Newman
    @bitwiseman
    @rodrigc You can use ''' strings in groovy to avoid that issue.
    steven-foster
    @steven-foster
    @bitwiseman I believe it was something to do with an alternative pipeline execution engine to the current CPS engine. I can't remember when I read about this. Perhaps it was referring to tekton...
    Liam Newman
    @bitwiseman
    @steven-foster They might have been talking about Jenkins X then?
    Gavin Mogan
    @halkeye
    i was going to mention JX, but i thought it was a dirty word
    steven-foster
    @steven-foster
    yeah I think it was way back here https://jenkins.io/blog/2018/08/31/shifting-gears/
    "Continued evolution of Jenkins Pipeline
    There’s an effort going on to remove CPS execution of Pipeline and isolate any failures during pipeline execution."
    I guess that could be what Jenkins X is nowadays
    I think there was an elaboration in some other blog post or dev mailing list post, but I can't track it down
    Stefan Wolf
    @wolfs
    I am going to add a new column to the pipeline steps for for showing build scan links for Gradle builds: https://github.com/jenkinsci/gradle-plugin/pull/87/files#diff-8f710debc185415c60312bdc58cf74b0
    Is that a good idea or should I do something else instead?
    llll2003
    @llll2003
    Hey all, I was curious if the load($MYPATH/file.groovy) is limited to a node { } block or if it should be ok to use outside? I do see an Alternative of using something like this:
    def constants = evaluate readTrusted('constants.groovy')
    But it expects constants.groovy to live in the @scipts folder.
    JohnLussmyer
    @JohnLussmyer
    I'm using Jenkins on Ubuntu. I need to do some builds and testing of my application - using Java 13.
    Since Jenkins won't run with Java 13, I need to define a Tool JDK for Java 13.
    I installed Zulu JDK 13 via "apt install". I've left JDK 8 as the default for Jenkins.
    When I attempt to create a Jenkins Tool definition for JDK 13, it gives me this error for the JDK JAVA_HOME:
    " /usr/lib/jvm/zulu-13-amd64 is not a directory on the Jenkins master (but perhaps it exists on some agents)"
    The path is correct. that path contains the bin directory.
    I'm guessing that Jenkins can't access it since all the JVM's are owned by root. Though at the command line, you can use the default JVM.
    Any ideas on how to make this work?
    Gavin Mogan
    @halkeye
    since jenkins can no longer auto install jdk's, I'm assuming its complaining that the directory doesn't exist on either the master and/or the agents?
    JohnLussmyer
    @JohnLussmyer
    Master in this case, where the JVM IS installed. I think that they don't have a way to handle the permissions issues on Ubuntu.
    Gavin Mogan
    @halkeye
    yea maybe the jenkins user can't read that directory
    su - jenkins -c 'ls -ld /usr/lib/jvm/zulu-13-amd64'
    oh wait, su will be jenkins password
    sudo -u jenkins ls -ld /usr/lib/jvm/zulu-13-amd64
    JohnLussmyer
    @JohnLussmyer
    All JVM files are owned by root. Even those for the default JVM that Jenkins is using.
    As an experiment, I copied the JDK 13 to a new directory and let Jenkins own it.
    At least the manage tools panel can find it now.
    JohnLussmyer
    @JohnLussmyer
    Has anyone made an Eclipse-Pipeline editor plugin?
    borisivan
    @borisivan
    came across the strangest thing today, wanted to see if anyone has seen this before: in a scripted pipeline w shared libraries, we define our params in the shared library vars/jobParams.groovy. Those are consumed in the Jenkinsfile in the parameters section. Been working for months. We had an incorrect value for an IP address as one of the params, and fixed via merging a PR to vars/jobParams.groovy. But the next execution of the pipeline (launched via a timer) used the unchanged value. If I click on that build (which I would have thought would use the updated value), and click 'parameters', sure enough it's the old value. BUT here's the kicker: no builds have run since then, and if I click 'build with parameters' now, the jenkins UI shows all the params and what it thinks it should use for default values (which should just be what was used in the last build) --- the value has the correct changed IP address. So in summary, the build kicked off 11 pm last night didn't use the updated value in the shared library, but yet Jenkins seems to be aware, as 'build with params' is now showing it correctly updated, which I thought it just blindly showed values as used by the previous build.
    Oleg Nenashev
    @oleg-nenashev
    steven-foster
    @steven-foster
    ooh, fancy