#jenkins

/

      • tang^
        a possibility: it's showing you pushes in total regardless of whether all pushes were for the branch in question
      • px3 has quit
      • stephend
        I must just be daft - can't find where "restrict where this job can be run" is in a Pipeline build type
      • er, job type
      • abayer
        stephend: Nope, 'cos that isn't a thing in Pipeline.
      • tang^
        that's part of the pipeline itself
      • stephend
        we've got 3 Jenkins architectures in-house, and it's driving me batty trying to switch among them all
      • abayer
        Since a Pipeline run doesn't actually, y'know, run anywhere until it enters a node block (or in declarative, there's an agent configured, etc)
      • hashar joined the channel
      • stephend nods
      • stephend
        yeah, I realized it soon after typing, le sigh
      • jlucci has quit
      • abayer
        =)
      • martinda
        does the openstack jenkins-job-builder support the Pipeline DSL?
      • I want to treat jenkins jobs like cattle, not like pets, or worse, exotic fish.
      • jalberts
        thx for the help
      • hkais has quit
      • martinda
        do the multi-branch plugins support multiple .jenkinsfile ? e.g. prbuilder.jenkinsfile, unittests.jenkinsfile, inttests.jenkinsfile, deploy.jenkinsfile, etc
      • poagester
        could you check out that gist above and see if you can spot a syntax error? i dont see one
      • tang^
        poagester: what does jenkins claim is the error?
      • poagester
        WorkflowScript: 33: Expected a step @ line 33, column 9.
      • martinda
        poagester: I do not see anything obviously wrong with it.
      • poagester
        do either of you know of a parser/linter that i can use?
      • hrmpw
        you can’t use `if` in a Declarative Pipeline
      • poagester
        oi
      • hrmpw
        you have to put it in a `script` if you want to use imperative controls
      • poagester
        hrmpw: how do you do flow control in a declarative pipeline? i thought that i had seen an example with it in it
      • hrmpw
        script { if…}
      • tang^
        I read slow, but I see hrmpw got to the answer first
      • hrmpw
        or use a `when` block
      • before steps{} you can do when { expression { …}}
      • poagester
        am i reading the wrong documentation? https://jenkins.io/doc/book/pipeline/syntax/
      • nevermind, i didnt pay attention to the heading
      • just above the if example is scripted pipeline
      • hrmpw
        yes
      • poagester
        so just wrap it in a script and should be good to go?
      • hrmpw
        hsould be
      • poagester
        thanks a million
      • alanoe has quit
      • curious_corn joined the channel
      • clp207 has quit
      • jordanlc
        martinda: have just one entry point Jenkinsfile, in it you can `load` unittests.groovy, inttests.groovy, etc.
      • plinio has quit
      • netcho has quit
      • tfennelly has quit
      • Cargo23 has quit
      • martinda
        jordanlc: If I understand correctly, multi-branch plugins will create a Jenkins Job for each branch where a Jenkinsfile is found. This creates one Pipeline per Git branch.
      • tfennelly joined the channel
      • jordanlc: I would like many Pipelines per branch.
      • jordanlc: hence my question, if that makes sense.
      • jordanlc
        yeah, it does
      • i'll tell you what i'm doing
      • i've got a multibranch set up for every "flow" I'd like to run
      • in the Jenkinsfile, I check the name of the job, and decide which *.groovy to load accordingly
      • frechdachs69 joined the channel
      • martinda
        that's an interesting way of doing it.
      • jordanlc
        i'm an interesting person
      • =)
      • martinda
        I don't doubt it :-)
      • jordanlc
        could maybe use an env param instead of the job name to be more flexible i guess? but meh
      • tfennelly has quit
      • martinda
        so jobs are grouped by type of "flow", rather than by "git repo"/project name
      • jordanlc
        well, both
      • martinda
        both?
      • jordanlc
        oh, no, sorry
      • i've only got 1 repo
      • so
      • jimklimov joined the channel
      • sabre1041 has quit
      • martinda
        my idea was to construct folders like this -> bitbucketProjectName/gitRepoName/ivyOrgName/ivyModuleName/branchName/jobType
      • users easily identify themselves to the ivyModuleName, then they would see master and the LTS branches.
      • under there would be prbuilder, unittests, inttest, etc.
      • whereas I think you have something like
      • livingstn has quit
      • recampbell has quit
      • jordanlc
        yeah, was looking for a way to do something similar to that, but couldn't find a way
      • multibranch isn't very flexible structurally
      • sabre1041 joined the channel
      • maybe this could be achieved with views somehow?
      • martinda
        views don't visually scale well above a few rows... say above 20 to 30 tabs, it looks messy
      • so if I follow well, your folder structure has the "flow name" higher up the folder path, and the git repo name further down
      • bannakaffalatta has quit
      • jordanlc
        my company has only the 1 repo
      • vjuranek_ has quit
      • so it's
      • flow/branch
      • m4rkmckenna joined the channel
      • and i'm using the git source, not bitbucket org folder
      • martinda
        ok. Maybe stephenc would be interested in entertaining the branch/flow approach in addition to the flow/branch...
      • would have been a nice GSoC project :-(
      • livingstn joined the channel
      • oleg-nenashev: ^
      • hobodave joined the channel
      • hobodave has quit
      • ahuang
        martinda: jenkins isnt doing gsoc this year
      • frechdachs69 has quit
      • fredg02 joined the channel
      • jwd has quit
      • ldnunes has quit
      • TETOFILO has quit
      • _flow__ has quit
      • awb joined the channel
      • ImuMotive has quit
      • _flow_ joined the channel
      • sga has quit
      • frechdachs69 joined the channel
      • hkais joined the channel
      • recampbell joined the channel
      • px3 joined the channel
      • jordanlc
        *THIS WAS SUPPOSED TO BE THE SUMMER OF CODE*
      • rdutra1 has quit
      • m4rkmckenna has quit
      • duckpupp1 joined the channel
      • farosas has quit
      • maudat has quit
      • duckpupp1 has quit
      • tfennelly joined the channel
      • tfennelly has quit
      • tfennelly joined the channel
      • gaieges
        in a DSL pipeline, is it possible to set an environment var in part of the steps? need to basically run an sh command to get info about the local git checkout. i've tried to perform `env.VAR = myfunction()` with no luck, and `environment { VAR = myfunction() }` tells me that there's no `myfunction` avaialble
      • martinda
      • gaieges: look for withEnv on that page
      • gaieges
        martinda: that's great! Thanks so much.
      • i actually just stumbled upon it, tried it out, and it looks like it does exactly what I want! You're great!
      • px3 has quit
      • ninjada has quit