Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mark Waite
    @MarkEWaite
    I'm in today
    steven-terrana
    @steven-terrana
    i can join
    Liam Newman
    @bitwiseman
    Liam Newman
    @bitwiseman
    @/all We’re looking for more feedback on Plugin Development: https://groups.google.com/g/jenkinsci-dev/c/ZN0sSRMzVn0?pli=1
    Oleg Nenashev
    @oleg-nenashev
    @bitwiseman @steven-terrana FTR the hacktoberfest planning thread is here: https://groups.google.com/g/jenkinsci-dev/c/pz3kqPnC2wA/m/EOUTnBQeAQAJ . We have not really started updating the Hacktoberfest page yet :(
    Paul Dragoonis
    @dragoonis
    Hey Folks! :)
    @bitwiseman .. oleg sent me here to have a chat with you :)
    Can you ping me once you're awake? I realise you're in Seattle and probably still asleep right now :-)
    Paul Dragoonis
    @dragoonis

    Meanwhile, perhaps someone here knows the answer to this? It's a Declarative flow question, I'm not sure Declarative is flexible to work the way I need it to, so I'm keen to find out, before I tell the customer they have to stick with Scripted pipeline.

    Link: https://gist.github.com/dragoonis/d775b91f42afdb69279172673dcc3b31

    1) I'm getting a syntax error immediately, saying I'm missing a node{} block, but this should be working by Line 25, where I use agent {} ..

    2) k8s_env.name, is actually not known at pipeline execution, and instead mont_blanc_deploy() has a callback, and this callback populates the variable k8s_env.{id,name,..etc} which I then pass to.

    What I need here is the ability to use declarative pipeline, but then invoke mont_blanc_deploy(), and in the callback to it, then specify the agent{}, stage{}, steps{} ... in the callback function

    In my understanding of Declarative pipelines is it's quite strict and I need to do:

    pipeline { stages { stage(x) { 
      agent {}  
      steps { script { mont_blanc_deploy() } }
    } } }

    And what I need to do is:

    def purchaseTests(k8s_env) { 
    
         stage('Purchase Tests') { 
             agent k8s_env.name
             steps { ..... }
    }
    
    def billingTests(k8s_env) { 
    
         stage('Billing Tests') { 
             agent k8s_env.name
             steps { ..... }
    }
    pipeline {
        stages {
            parallel {
                  script {
                       mont_blanc_deploy(this.&purchaseTests)
                  }
                  script {
                       mont_blanc_deploy(this.&billingTests)
                  }
            }
        }
    }
    I hope it's making sense, thanks!
    Liam Newman
    @bitwiseman
    @dragoonis We need a little more of the error to know what step you’re using that depends on Node being present.
    @dragoonis Ah.
    Here it is: choice(choices: mont_blanc_envs("gke-preprod env: prod"),
    Liam Newman
    @bitwiseman
    Parameters get evaluated before there an environment that can be set.
    You’re already using a shared library. It sounds like what you want to do is set have the library hold state for you in @Field variables.
    It is not a scenario that I encourage, but it can work.
    @dragoonis Are you already using a shared library?
    Liam Newman
    @bitwiseman
    @dragoonis I feel like I’m looking at half the problem. I might be answering your question and unblocking you, but there might be a better way to do this altogether…
    Where is this.&purchaseExpenseTests coming from?
    Paul Dragoonis
    @dragoonis
    Hey @bitwiseman thanks for replying! mont_blanc_envs() is coming from the Shared lib. So is mont_blanc_deploy()
    @bitwiseman purchaseExpenseTests, is basically the def() examples I gave you in this gitter. It's just a small function that does "runTests" which is "mvn test" command.
    I converted the pipeline back to Scripted until we can figure out why it was saying there was a missing node() block.
    Perhaps you're onto something with the mont_blanc_envs(), that is a dropdown and I presume it grabs its list from doing some kind of kubectl command, which indeed would need a Node.
    @bitwiseman here's my scripted pipeline that I've developed, I'd much prefer to make this declarative. As you can see it's executing a function montblanc*() from the shared lib, which then invokes my callback &this.testsFunc() - https://gist.github.com/dragoonis/576d2cb01013e1e9da9132a30ac3b7a6
    Paul Dragoonis
    @dragoonis
    From digesting what you said about the parameters needing a Node{} and also mont_blanc_deploy() will also need a Node, then I could have some kind of initial agent, which would execute params and _deploy() func, but then separate nodes are selected for each of the parallel steps ... is this how Declarative should be done ?
    Liam Newman
    @bitwiseman
    @dragoonis sorry, have to step away. I’ll respond when I get back.
    Paul Dragoonis
    @dragoonis
    @bitwiseman it's okay, it's 6pm here and i'll be around later today and back at this tomorrow, so do your stuff, and I look forward to hearing your opinion when you're free. Thanks! <3
    Liam Newman
    @bitwiseman
    @dragoonis What you’re having is a common problem: you’re treating pipeline groovy like you would regular groovy and trying to create a program in the same way as you would in a programming language.
    I know that sounds strange but the less you try to do in pipeline the better off you’ll be. The fewer groovy features you use the more stable your pipeline will be.
    Liam Newman
    @bitwiseman
    So, you have this.&variable - I hadn’t seen that used before. That should tell you how little groovy we expect people to use in pipeline. :)
    Liam Newman
    @bitwiseman
    @/all I am expecting my first child in a couple weeks. after this Friday’s meeting, I’ll be on leave for at least a month.
    6 replies
    Mark Waite
    @MarkEWaite
    I won't be able to attend tomorrow's meeting due to a dental appointment.
    Marky Jackson
    @markyjackson-taulia
    I can help run the meetings
    Oleg Nenashev
    @oleg-nenashev
    We are going to IKEA tomorrow. I doubt I have any chance to escape from it by 6PM :)
    Marky Jackson
    @markyjackson-taulia
    I could live in that place
    Liam Newman
    @bitwiseman
    Thanks @markyjackson-taulia .
    Marky Jackson
    @markyjackson-taulia
    :heart:
    steven-terrana
    @steven-terrana
    unable to attend today’s SIG meeting. work conflicts :(
    Marky Jackson
    @markyjackson-taulia
    Ok, I think it is safe to cancel
    Liam Newman
    @bitwiseman
    Okay, cancel it is.
    👤🧍‍♀️🧍‍♂️📸📺
    @i_got_grace_twitter
    Hello, I have a question on classpaths in shared libraries: I'm currently running some groovy scripts that use an external classpath, which are called by a jenkins shell command. I'd integrate these scripts into jenkins if I knew how to add a local classpath to jenkins or just to the shared library. I know there's Grab, but how does that work with a local directory of jar files? Can anyone point me to some documentation?
    5 replies
    Mark Waite
    @MarkEWaite
    I won't be able to attend today's pipeline authoring SIG meeting. I need to complete the Jenkins 2.249.2 changelog and upgrade guide so that it can be review early next week in preparation for the release next Wednesday
    Gavin Mogan
    @halkeye
    you could write a json file, then read it into the pipeline?
    Gavin Mogan
    @halkeye
    oh wait, your in pipeline authoring special interests group channel, i recommend the general #jenkinsci/jenkins channel
    Sunish Surendran
    @sunishsurendran_twitter
    During Jenkins pipeline Jobs running any one got the missing workspace error?
    i have observed it in my older version of jenkins , but not in the latest Jenkins ver. 2.222.4 . Is this Issue Still exist?
    Mark Waite
    @MarkEWaite
    I will miss today's pipeline authoring SIG so that I can assist at the Harmony Technology Camp for Girls.
    Mark Waite
    @MarkEWaite
    I don't have any topics for today's pipeline authoring SIG meeting.
    prabhapoojary
    @prabhapoojary
    i want to change workflow status based on jenkins build with project name and status. can anyone please help me out on this.
    I am able to do as below: with story-id
    def transitionInput = [transition: [id: '41']]
    //def comment = [ body: 'Build successfully completed' ]
    //jiraAddComment idOrKey: 'MSDP-198', input: comment, site: 'JIRA'
    jiraTransitionIssue idOrKey: 'MSDP-198', input: transitionInput, site: 'JIRA' but i need to list story id based on project name and status
    Gavin Mogan
    @halkeye
    @prabhapoojary #jenkinsci/jenkins is the support channel, this is the special interest group for developing the specification