Re: How to prevent concurrent builds across all branches in a multibranch pipeline project?

2017-08-14 Thread Mark Allison
ll fit your needs > https://wiki.jenkins.io/display/JENKINS/Lockable+Resources+Plugin > > 2017-08-14 12:37 GMT+02:00 Mark Allison > > : > >> I have tried to use >> >> properties[(disableConcurrentBuilds)] >> >> but that only prevents concurrent builds wi

How to prevent concurrent builds across all branches in a multibranch pipeline project?

2017-08-14 Thread Mark Allison
I have tried to use properties[(disableConcurrentBuilds)] but that only prevents concurrent builds within one branch in a multibranch pipeline project. Is there a way to prevent concurrent builds across all branches in a project? Thanks -- You received this message because you are subscribe

Re: How to only build one directory in a pipeline job?

2017-06-14 Thread Mark Allison
It's still building both projects. Anyone got any ideas? On Wednesday, 14 June 2017 14:36:06 UTC+1, Mark Allison wrote: > > I just noticed a potential bug. > > I changed these: > >Included Regions: Project1\/.+ >Excluded Regions: > > On Wednesday, 1

Re: How to only build one directory in a pipeline job?

2017-06-14 Thread Mark Allison
I just noticed a potential bug. I changed these: Included Regions: Project1\/.+ Excluded Regions: On Wednesday, 14 June 2017 11:44:43 UTC+1, Mark Allison wrote: > > I have a github repo called multibranch-test with two sub-directories > Project1, Project2. > > PS C:\Re

Re: How to set environment variable in multibranch pipeline?

2017-06-14 Thread Mark Allison
stage('build') { > steps { > sh 'env | grep REPO_URL' > } > } > } > } > > Jenkinsfiles apply to all branches in a repo, so that part is handled > implicitly. > > Hope this helps, > KB > > > On Tuesday, J

How to only build one directory in a pipeline job?

2017-06-14 Thread Mark Allison
I have a github repo called multibranch-test with two sub-directories Project1, Project2. PS C:\Repos\multibranch-test> tree . Folder PATH listing for volume Windows Volume serial number is 2085-6D3D C:\REPOS\MULTIBRANCH-TEST ├───Project1 └───Project2 Each sub-directory has a Jenkinsfile and th

How to set environment variable in multibranch pipeline?

2017-06-13 Thread Mark Allison
I have a Jenkins multibranch pipeline project and I want to set an environment variable for all branches. Is this possible? I could only see a way to do it with the environment injector plugin at the branch level. I want to be able to do this at the project level because I want new feature bran

Re: Can't see any GIT_ environment variables in my pipeline script

2017-06-01 Thread Mark Allison
> include some possible work-around techniques. > > Mark Waite > > On Thu, Jun 1, 2017 at 4:28 AM Mark Allison > wrote: > >> I am using the git plugin and use a Jenkinsfile, however none of the GIT >> environment variables are being set according to the git plugin

Can't see any GIT_ environment variables in my pipeline script

2017-06-01 Thread Mark Allison
I am using the git plugin and use a Jenkinsfile, however none of the GIT environment variables are being set according to the git plugin documentation here: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin in section Environment variables. Jenkins is installed on Windows Server 2012 R2 an

Re: How to clone a directory from a remote repo in a Jenkins pipeline script?

2017-05-31 Thread Mark Allison
> > > > On Wed, May 24, 2017 at 9:01 AM Mark Allison > wrote: > >> On Wednesday, 24 May 2017 13:29:58 UTC+1, Daniel Beck wrote: >> >>> >>> > On 24. May 2017, at 09:23, Mark Allison wrote: >>> > >>> > I know I probab

Re: How to clone a directory from a remote repo in a Jenkins pipeline script?

2017-05-24 Thread Mark Allison
On Wednesday, 24 May 2017 13:29:58 UTC+1, Daniel Beck wrote: > > > > On 24. May 2017, at 09:23, Mark Allison > wrote: > > > > I know I probably need to use sparse and/or shallow checkouts, but can't > seem to work out how to configure that in a Jenkins pip

How to clone a directory from a remote repo in a Jenkins pipeline script?

2017-05-24 Thread Mark Allison
Hi, I have a large repo in GitHub Enterprise and need to clone a sub-directory from it on my Jenkins build server and just build that sub-directory. I am using a pipeline script and have this right now: node { stage ('checkout') { git url: 'git@github.devops.mycompany.local:Org/MyLa

What version of Jenkins was stage blocks introduced?

2017-01-27 Thread Mark Allison
I am building some pipeline projects and want to use the new stage blocks feature as the old way is now deprecated. e.g. stage ('build') { // my block of code to do the build } Trouble is our current Jenkins version (2.7) doesn't support stage blocks, does anyone know what version they were

Re: Is it possible to echo the ${JOB_NAME} excluding the folder/

2017-01-26 Thread Mark Allison
I worked this out with def jobBaseName = "${env.JOB_NAME}".split('/').last() echo "Job Name (excl. path): ${jobBaseName}" Thanks Dirk for the code snippet that helped speed up the solution! On Wednesday, 25 January 2017 10:38:32 UTC, Mark Allison wrote: &g

Re: How to load variables from file into windows environment variables in Jenkins pipeline?

2017-01-26 Thread Mark Allison
Thanks, simply using double quotes instead of single works fine. bat "echo MYKEY is %MYKEY%" On Thu, 26 Jan 2017 at 14:25 Daniel Beck wrote: > > > On 26.01.2017, at 12:57, Mark Allison wrote: > > > > How can I load variables from a file in a Windows job

How to load variables from file into windows environment variables in Jenkins pipeline?

2017-01-26 Thread Mark Allison
I have the following Jenkinsfile node { stage 'checkout' deleteDir() checkout scm load 'LoadTheseVariables.txt' echo "MYKEY: ${MYKEY}" echo "REPO: ${REPO}" bat 'echo MYKEY is %MYKEY%' bat 'echo REPO is %REPO%' } The file *LoadThes

Re: Is it possible to echo the ${JOB_NAME} excluding the folder/

2017-01-25 Thread Mark Allison
Thanks for the reply. I am using a pipeline job, so can I just put this in my pipeline script? JOB_BASE_NAME: JOB_NAME.split('/').last() On Wed, 25 Jan 2017 at 10:59 Dirk Heinrichs wrote: > Am 25.01.2017 um 11:38 schrieb Mark Allison: > > I want to use the ${JO

Is it possible to echo the ${JOB_NAME} excluding the folder/

2017-01-25 Thread Mark Allison
I want to use the ${JOB_NAME} environment variable on my Windows slave, however my project is in a folder in Jenkins and I want to exclude the folder. How can I use %JOB_NAME% without the folder name? Thanks -- Sent from my phone -- You received this message because you are subscribed to the G

Re: How to trigger Jenkins build with parameters from Gitlab webhook?

2017-01-12 Thread Mark Allison
) wrote: > > It should be “echo MYPARAM: ${env.MYPARAM}” in pipeline > > > > > > *From: *> on behalf of Mark > Allison > > *Reply-To: *"jenkins...@googlegroups.com " < > jenkins...@googlegroups.com > > *Date: *Wednesday, January 11, 2017 a

Re: How to trigger Jenkins build with parameters from Gitlab webhook?

2017-01-11 Thread Mark Allison
wrote: > > I'm not sure if this matters, but did you define that parameter in the > pipeline job? > > On Mon, Jan 9, 2017 at 3:02 AM, Mark Allison > wrote: > > I have GitLab Community Edition 8.15.2 successfully trigger pipeline > > projects in Jenkins 2.32.1 usi

Re: How to use Jenkinsfile in pipeline builds?

2017-01-11 Thread Mark Allison
Actually this works fine, ignore. I had misconfigured something. On Wednesday, 11 January 2017 20:10:36 UTC, Mark Allison wrote: > > I have a pipeline build and I want to move it to source control. I've > copied out the script from the the project into a Jenkinsfile and added it &

How to use Jenkinsfile in pipeline builds?

2017-01-11 Thread Mark Allison
I have a pipeline build and I want to move it to source control. I've copied out the script from the the project into a Jenkinsfile and added it to git. In my pipeline I have code like this: #!groovy​ node { stage('checkout') { deleteDir() git 'http://git.server

How to trigger Jenkins build with parameters from Gitlab webhook?

2017-01-09 Thread Mark Allison
I have GitLab Community Edition 8.15.2 successfully trigger pipeline projects in Jenkins 2.32.1 using a webhook (but without any parameters). I want the gitlab push to trigger a build with parameters but the parameter value is null when it comes through to Jenkins so the build fails. The gitlab

Re: Any PowerShell people can help with DSC in Jenkins?

2017-01-03 Thread Mark Allison
Running Jenkins as a 64-bit process solved the issue. See http://stackoverflow.com/a/34030153/38211 On Tuesday, 3 January 2017 11:54:23 UTC, Mark Allison wrote: > > I have a Windows Server 2016 Jenkins build box. I want to run some > powershell in a Jenkins job. > > As a test I h

Any PowerShell people can help with DSC in Jenkins?

2017-01-03 Thread Mark Allison
I have a Windows Server 2016 Jenkins build box. I want to run some powershell in a Jenkins job. As a test I have set the job to do this in a `Execute Windows batch command` build step: powershell -command Get-DscResource -module xhyper-v I get this output: D:\Jenkins\workspace\build-wind