Re: can i use variable to specify the agent label in my declarative pipeline ?

2017-10-17 Thread ishan jain
Hi Robert, How did you resolve it ? I could never get it working with anything. On Wednesday, 11 October 2017 23:01:19 UTC+2, Robert Hales wrote: > > I posted a reply to this. It was a head twister, but I think I solved the > problem and learned some interesting things. > > On Tuesday, October

Re: Mixing declarative and scripted pipeline syntax in one Jenkinsfile ...

2017-10-05 Thread ishan jain
Hi, It is very much possible, as mentioned in the documentation. In fact it is very much required in my case. On Wednesday, 4 October 2017 09:00:37 UTC+2, Eric Tan wrote: > > Hi, > > Is it possible to mix declarative and scripted pipeline syntax in one > Jenkinsfile ? > > For example, there is

Re: Best way to reload job settings from Jenkinsfile without triggering a build

2017-09-22 Thread ishan jain
xing scan from kicking off a new build when it finds changes. > > On Tuesday, September 12, 2017 at 8:56:32 AM UTC-6, ishan jain wrote: >> >> Hi all, >> >> I keep my Jenkinsfile in a git repo. For features and fixes, i create >> branches on this repo, each hav

How can i call global function defined in Jenkinsfile from inside the external groovy script loaded with 'load' step ?

2017-09-15 Thread ishan jain
Hi, My Jenkinsfile is getting rather large and i want to break it down into different groovy scripts for easy maintenance. Here is a sample code structure. externalScripts = '' pipeline { agent master stages { stage('first') { agent { label 'master' } steps { script

How are you using the the docker pipeline plugin ? Is it useful enough for you ? Can i think of scaling with it by starting slave containers on remote docker hosts ?

2017-09-13 Thread ishan jain
Hi, My project consists of a number of services and i have a build-deploy-test pipeline for each. The infrastructure consists of an array of docker hosts where applications are deployed and tested and i have no shortage of them. The build part (mostly maven) happens on Jenkins master node

Best way to reload job settings from Jenkinsfile without triggering a build

2017-09-12 Thread ishan jain
Hi all, I keep my Jenkinsfile in a git repo. For features and fixes, i create branches on this repo, each having a slightly different Jenkinsfile. I have a jenkins job of type multibranch pipeline, scanning these pipelines as i create a branch. Assuming i have the basic declarative pipeline

Re: can i use variable to specify the agent label in my declarative pipeline ?

2017-05-05 Thread ishan jain
luated, but it is not set. Possibly a > variable scoping issue? Can you post the exact code? > > On 5/4/2017 4:23 AM, ishan jain wrote: > > Hi Eric, > > I tried putting the var in double quotes but still it is not able to > resolve it. I get *'*There are no nodes with the lab

Re: can i use variable to specify the agent label in my declarative pipeline ?

2017-05-04 Thread ishan jain
to do here ? On Wednesday, 3 May 2017 17:51:21 UTC+2, Eric Pyle wrote: > > It should work if you use double quotes around your agent variable. > Variable resolution will not happen within single quotes. > > On 5/3/2017 10:58 AM, ishan jain wrote: > > I am using declarati

Declarative pipeline - How can i use multiple agents within a stage executing in a sequence ?

2017-05-03 Thread ishan jain
I am using declarative pipeline and in some of my stages, i need to use multiple agents while still ensuring the steps are executed in sequence (not parallel). I don't find a nice way to use multiple agents (maybe multiple steps) within a stage. something like: pipeline { agent none

can i use variable to specify the agent label in my declarative pipeline ?

2017-05-03 Thread ishan jain
I am using declarative syntax to build my pipeline. I am loading several variables from a properties file in the beginning and i now i would like to control the 'on which slave node something executes' via variables. But i cannot figure out how to use variable as a agent label. The following is

Re: Load properties from a properties file and make it available anywhere in the pipeline

2017-05-03 Thread ishan jain
in > <https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Utility+Steps+Plugin> > that has among others a readProperties > <https://github.com/jenkinsci/pipeline-utility-steps-plugin/blob/master/docs/STEPS.md> > > step. > > /B > > On Tuesday, May 2,

Load properties from a properties file and make it available anywhere in the pipeline

2017-05-02 Thread ishan jain
Hi all, My requirement is simple, i just want to externalize some 'values' to make my Jenkinsfile more re usable and for this i need to* load the properties from a file which is going to be right next to Jenkinsfile, and make sure that these properties are available anywhere in the code*. I am

Even after having 'wipe out repository & force clone' option, my workspace is not fresh

2017-04-20 Thread ishan jain
I am selecting below option in my build pipeline, where internally i would checkout a repo and work on it. But the worspace with the repository clone is still there in every job execution and this is creating problems for me. I have to manually delete the worspace on the server everytime to

Declarative pipeline - Repeating a stage after getting some input

2017-04-11 Thread ishan jain
I am using declarative pipeline syntax to implement continuous integration and here is a part of the pipeline stage ('Tag') { when { expression { return releaseVersion() } } agent { label 'master' } steps { script { // tag some stuff } } } stage ('Promote') { agent

How to call a function defined within my Jenkinsfile

2017-03-21 Thread ishan jain
Probably i am being silly, but seriously i am not able to call a function which i have defined in my Jenkinsfile from within a step. Here is a sample: *def meta = "something"* *stage (build) {* * buildProject(meta)* *}* *def buildProject(meta) {* *return {* * node {* *