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, 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:\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 the code for that project.
>>
>> I Jenkins I have two multibranch pipeline jobs - one for Project1 and one 
>> for Project2. In the configuration for Project1 I don't want a push 
>> notification or polling to build Project1 if a commit was pushed in 
>> sub-directory for Project2.
>>
>> So in Project1 I have configured Additional Behaviours:
>> *Advanced clone behaviours*
>> Shallow clone is checked
>> *Sparse checkout path *is set to Project1
>> *Polling ignores commits in certain paths*
>>Included Regions: Project1/*
>>Excluded Regions: *
>>
>> *Build Configuration*
>> Script Path: Project1/Jenkinsfile
>>
>> What is happening is if I push a commit to master in sub-directory 
>> Project2, Project1 and Project2 jobs get built. I only want Project2 to 
>> build. Can someone point out what I'm doing wrong?
>>
>> Jenkinsfiles for both Projects are similar and look like:
>>
>> #!groovy
>> node {
>> stage ('checkout') {
>> checkout scm
>> }
>> stage ('build') {
>> dir ('Project1') {
>> bat 'powershell -Command gci'
>> bat 'powershell -Command gci env:'
>> bat 'powershell -File .\\Project1.ps1'
>> }
>> }
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2808c506-7e41-4e4a-8880-b806f337434d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to set environment variable in multibranch pipeline?

2017-06-14 Thread Dan Tran
Please vote for this  https://issues.jenkins-ci.org/browse/JENKINS-42906


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/36cd9f53-c899-4faa-aa7c-4616b2b99543%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to set environment variable in multibranch pipeline?

2017-06-14 Thread Cuong Tran
Why?

On Wednesday, June 14, 2017 at 5:33:26 AM UTC-7, Mark Allison wrote:
>
> Thanks for the reply, but I need to set the variable outside the pipeline 
> script similar to the Environment Injector plugin. Is there a way to do 
> that?
>
> On Tuesday, 13 June 2017 13:36:07 UTC+1, Kevin Burnett wrote:
>>
>> here's an example Jenkinsfile that sets an environment variable 
>> (REPO_URL) that applies to all stages. you can also use the withEnv step to 
>> set an environment variable for a certain block.
>>
>> pipeline {
>>   agent { label 'docker' }
>>   environment {
>> REPO_URL = 'www.my.repo'
>>   }
>>   stages {
>> 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, June 13, 2017 at 3:53:33 AM UTC-4, Mark Allison wrote:
>>>
>>> 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 
>>> branches to automatically inherit some environment variables.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3f7e72cf-a497-4976-a7f4-03cf80dbc635%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SSH Slave crashing immediately after start

2017-06-14 Thread Peter Berghold
Changing the version of Java to 1.8 did the trick.  The slave is back
online.

On Wed, Jun 14, 2017 at 7:53 AM Peter Berghold 
wrote:

> Okay I guess I'm going to have to investigate how to get the newer version
> of Java on Redhat. Redhat 6 at that. Thanks for the pointers.
>
> On Wed, Jun 14, 2017, 07:04 James Nord  wrote:
>
>> > java -version returned 1.7.0_75.
>>
>>
>> Jenkins 2.58+ only support java8 or higher, this includes your agents JVM.
>>
>>
>> /James
>>
>>
>> On Tuesday, June 13, 2017 at 9:05:40 PM UTC+1, Peter Berghold wrote:
>>>
>>> I'm trying to re-establish connectivity to an SSH slave that used to
>>> work when I was running a much older version of Jenkins.  Currently I'm
>>> using v2.65. What I'm seeing (somewhat trimmed) in the log is the following:
>>>
>>> [06/13/17 20:04:05] [SSH] Checking java version of java
>>> [06/13/17 20:04:05] [SSH] java -version returned 1.7.0_75.
>>> [06/13/17 20:04:05] [SSH] Starting sftp client.
>>> [06/13/17 20:04:05] [SSH] Copying latest slave.jar...
>>> [06/13/17 20:04:05] [SSH] Copied 719,269 bytes.
>>> Expanded the channel window size to 4MB
>>> [06/13/17 20:04:05] [SSH] Starting slave process: cd "/data/jenkins-slave" 
>>> && java  -jar slave.jar
>>> <===[JENKINS REMOTING CAPACITY]===>channel started
>>> Slave JVM has not reported exit code. Is it still running?
>>> [06/13/17 20:04:09] Launch failed - cleaning up connection
>>> [06/13/17 20:04:09] [SSH] Connection closed.
>>> ERROR: Connection terminated
>>> java.io.EOFException
>>> at 
>>> java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2353)
>>> at 
>>> java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2822)
>>> at 
>>> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)
>>> at java.io.ObjectInputStream.(ObjectInputStream.java:301)
>>> at 
>>> hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:48)
>>> at 
>>> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
>>> at 
>>> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:59)
>>> Caused: java.io.IOException: Unexpected termination of the channel
>>> at 
>>> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:73)
>>>
>>>
>>> At a loss...
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/ea6f2611-da6f-448d-9065-2e23fdf29a85%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAArvnv3PpjCKWS%2BpLpUhHiRePx6hTwtEe2Y0HGo9jMR%2BymYZxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can environment directive be used in post?

2017-06-14 Thread Kevin Burnett
i don't believe you can use the environment instruction in post, no.

but you can use 
withEnv: 
https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-withenv-code-set-environment-variables

On Wednesday, June 14, 2017 at 8:43:43 AM UTC-4, Idan Adar wrote:
>
> In a stage I can do the following: 
>
> stage ("Merge pull request") {
>  environment {
> JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
>  }
>  ...
>  ...
>  steps {
>   
>  }
> }
>
> Can this done also in post?
>
> post {
>  success {
>  environment { 
>  JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
>  }
>
>  script {
>  
>  }
>   }
> }
> 
>
> Or is there any other way to ahchieve this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a3beb8eb-353f-41cb-ada9-dccbe889b189%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blue Ocean and NGiNX

2017-06-14 Thread Cliff Meyers
Hi Robson,

Some other users have reported a similar issue which we are tracking in
JIRA here:

https://issues.jenkins-ci.org/browse/JENKINS-44881

We're investigating the issue now; perhaps if you join in the conversation
there we can help reproduce the issue faster.

Thanks,
Cliff


On Wed, Jun 14, 2017 at 11:30 AM, Robson Peixoto 
wrote:

> Hi,
>
> When I try to access the Blue Ocean it start a infinite loop =/
> This screenshot show the browser error:
>
>
> 
> Info about plugins version, jenkins version, command line configuration
> and more are on this gist:
> https://gist.github.com/robsonpeixoto/7502666d3b5de654a0bed66529c448a2
>
> I'm using 2 containers:
> - a container running jenkins
> - a container running nginx
>
> Can anyone help-me with it, please?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/a36e5df4-0071-45e7-a7fe-323c1b51b218%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAFm%3D0hdmbL-NE66%2BZTuCTTKcuMcy%3D%2Bv%2BDgqwfWB2GdhZuq3R%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Job Scheduling per 10 secs

2017-06-14 Thread Ashish Kaushik
This worked like charm. Thanks for sharing this. It saved my loads of time 
as I decided to write a wrapper script to handle of this. Pipeline plugin 
came to rescue. 
Thanks again Bill!

On Thursday, June 8, 2017 at 3:53:16 PM UTC+5:30, Bill Dennis wrote:
>
> I don' t think the Jenkins CRON spec has seconds resolution.
>
> You can build an orchestrater job that is scheduled to run every 1 minute.
>
> Then in that job, loop 6 times with a sleep of 10 seconds and build 
> another job.
>
> Also use the do not allow concurrent builds.
>
> Something like this:
>
> pipeline {
>
>
> agent any
>
>
> options {
> disableConcurrentBuilds()
> timestamps()
> }
>
>
> triggers {
> // Default triggering on a schedule every 1 minute or you can get 
> from ENV
> cron("${env.CRON_SCHEDULE?:'* * * * *'}")
> }
>
>
> stages {
>
>
> stage('Trigger Job Every 10s') {
> steps {
> script {
> for(int i = 0;i < 6;i++) {
>
>
> build job:'foo', wait: false
>
>
> sleep 10
> }
> }
> }
> }
> }
> }
>
> Have fun!
>
> --Bill
>
>
> On Wednesday, 7 June 2017 17:07:35 UTC+1, Ashish Kaushik wrote:
>>
>> Hi, 
>> I am looking for a solution which allow me schedule a job which can run 
>> every 10 secs and also the job should not run if the previous instance has 
>> not yet finished. 
>>
>> I have checked the plugin store but can't find anything that supports 
>> this requirements. Any pointers would be greatly appreciated. 
>>
>> Thanks
>>
>> --
>> * Ashish *Kaushik
>>  SourceFuse Technologies
>>
>> --
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/79fdecf1-0aac-40fc-94f7-f8e95457b8ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Blue Ocean and NGiNX

2017-06-14 Thread Robson Peixoto
Hi,

When I try to access the Blue Ocean it start a infinite loop =/
This screenshot show the browser error:


Info about plugins version, jenkins version, command line configuration and 
more are on this gist:
https://gist.github.com/robsonpeixoto/7502666d3b5de654a0bed66529c448a2

I'm using 2 containers:
- a container running jenkins
- a container running nginx

Can anyone help-me with it, please?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a36e5df4-0071-45e7-a7fe-323c1b51b218%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: AWS Simple AD Issue

2017-06-14 Thread Hafizullah Nikben
Experiencing the same issue as you Brian! :( 
any insight will be appreciated.

I have raised  ticket with AWS to see if anything have changed on their 
side.

On Wednesday, 7 June 2017 08:21:05 UTC+1, Brian Mills wrote:
>
> I've been using Active Directory plugin for years in an AWS environment, 
> using AWS Simple AD as a back end. 
>
> Today for no apparent reason the AD auth plugin stopped being able to 
> communicate to Simple AD. Some updates were done yesterday to Jenkins 
> plugins, but I don't believe AD was one of them, I also have tried rolling 
> back the plugin to 2 previous versions with no success in resolving the 
> issue. 
>
> I haven't found any similar issues in the jenkins-ci.org tracker, one 
> report https://issues.jenkins-ci.org/browse/JENKINS-43967 suggests 
> inconsistent behaviour, in my case it doesn't work at all. 
>
> It fails every time with a java exception Any Domain Controller is 
> reachable java.net.SocketException: Socket closed at
>
> I haven't really managed to work out a way to debug it other than the fact 
> I have have other applications that are communicating with Simple AD fine 
> (you can log out of those applications, and back in again with no problem). 
>
> Any help would be appreciated. 
>
> Cheers,
> Brian
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fa4bbde0-8b00-44a5-80a8-464f8dd97bbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Locking doesn't work across multiple nodes?

2017-06-14 Thread Thomas Rambrant
I have the same problem so I'm very interested in a solution... 

I have tried everything I can think of. I'm currently locking on the 
outmost level, so that every stage and node blocks is inside the lock. I 
previously had it inside a node block  but got the impression that the lock 
only worked on the same node. But setting it on the outmost level still 
fails sometimes, even for jobs execited on the same node...

So I think this is a bug somehow...

/Thomas

Den fredag 7 april 2017 kl. 17:24:32 UTC+2 skrev Jonathan del Strother:
>
> Are pipeline locks expected to behave when used by two nodes 
> simultaneously?
>
> My Jenkinsfile defines the following helper - 
>
> def log(msg) {
>   echo((new Date().format("-MM-dd'T'HH:mm:ss: ")) + msg)
> }
>
> def lockDB(number, callback) {
>   try {
> log "${number}: Acquiring lock ..."
> lock(resource: "boom-test-database-${number}", inversePrecedence: 
> true) {
>   log "${number}: Acquired!"
>   callback()
>   log "${number}: Releasing..."
> }
>   } finally {
> log "${number}: Released!"
>   }
> }
>
>
> I somewhat frequently see two nodes manage to acquire the same lock 
> simultaneously, as in the following example, where master locked a resource 
> from 14:45:57 -> 14:52:04, and the slave locked the same resource 
> from 14:51:24 -> 14:56:43.
>
>
> [featureTests] Running on master in 
> /var/jenkins_home/workspace/BoomMultiPipeline_master-YRHUUT2RENAD5FNHS4YJ5GQKTJDN2M7B3KGAU3ELBWX7MZ2AEKBA
> [featureTests] 2017-04-07T14:40:44: 1: Acquiring lock ...
> [Pipeline] [featureTests] lock
> [featureTests] Trying to acquire lock on [boom-test-database-1]
> [featureTests] Found 0 available resource(s). Waiting for correct amount: 
> 1.
> [featureTests] [boom-test-database-1] is locked, waiting...
> [featureTests] Lock acquired on [boom-test-database-1]
> [featureTests] 2017-04-07T14:45:57: 1: Acquired!
> ... running tests
> [featureTests] Lock released on resource [boom-test-database-1]
> [featureTests] 2017-04-07T14:52:04: 1: Released!
>
>
>
>
> [featureTests] Running on slave in 
> /var/jenkins_home/workspace/eline_tb_remaining_indices2-DTE7IMSYRVCF6GO3T5IRRR52R4YQ3GSRFNEEKCRH7FGSUBQB4SFQ
> [featureTests] 2017-04-07T14:49:33: 1: Acquiring lock ...
> [Pipeline] [featureTests] lock
> [featureTests] Trying to acquire lock on [boom-test-database-1]
> [featureTests] Found 0 available resource(s). Waiting for correct amount: 
> 1.
> [featureTests] [boom-test-database-1] is locked, waiting...
> [featureTests] Lock acquired on [boom-test-database-1]
> [featureTests] 2017-04-07T14:51:24: 1: Acquired!
> ... running tests
> [featureTests] Lock released on resource [boom-test-database-1]
> [featureTests] 2017-04-07T14:56:43: 1: Released!
>
>
>
> Is this a bug, or am I misunderstanding how locking is supposed to work in 
> Jenkins?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d69d5018-5d55-4766-8978-f6b1fd00b197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


JIRA-Plugin comments huge loads of issues since Update

2017-06-14 Thread Dieter Guthmann
Hello there,

 

we've got problems with the JIRA-Plugin for Jenkins since we've updated our Jenkins-Master from 1.609.3 to 2.46.3 (both LTS).

We've updated also the JIRA-Plugin-Version to 2.3.1.

 

For many of our Jobs the Post-Build-Action "JIRA: Update relevant issues" is enabled (in our previous used JIRA-Plugin-Version nothing has to be configured there, now an "issue selector" can be choosen here - I've used the "Default selector").

Since the Update to Jenkins 2 the PostBuild-Action comments a huge amount of JIRA-Issues when a build is finished, which had "Changes in Dependencies". When a build is finished which was started due to a repository change in the 'main repository' no problem occours (Issues are commented properly, if an Issue-Key was mentioned in the SVN-Commit-Message).

 

I've attached a build-console-Output below.

 

We use Subversion as Code Repository - for libraries are also "subversion externals" in use (= Dependencies). For all Repositories a SVN Post-Commit-Hook is enabled which triggers Jenkins.

And we use subversion externals also as a replacement for "symbolic links" with the following notation:

svn:externals = ../other/directory/in/the/same/repository/file.txt file.txt

 

From which sources does the JIRA-Plugin extracts those issues? There are more issues commented, than svn:externals are existent - and many of the externals most recent commit messages doesn't contain a JIRA-Issue-Key at all...

 

Thanks in Advance.

 

Rgds

Dieter Guthmann

 

- Build Console Output 

[WARNINGS] Parsing warnings in console log with parser GNU C Compiler 4 (gcc)
[WARNINGS] Computing warning deltas based on reference build #3311
[WARNINGS] Plug-in Result: Success - no threshold has been exceeded
Archiving artifacts
Recording fingerprints
[JIRA] Updating issue JIRA-2940
[JIRA] Updating issue JIRA-2976
[JIRA] Updating issue JIRA-2646
[JIRA] Updating issue JIRA-2772
[JIRA] Updating issue JIRA-2791
[JIRA] Updating issue JIRA-2755
[JIRA] Updating issue JIRA-2771
[JIRA] Updating issue JIRA-2120
[JIRA] Updating issue JIRA-2236
[JIRA] Updating issue JIRA-2689
[JIRA] Updating issue JIRA-1141
[JIRA] Updating issue JIRA-2215
[JIRA] Updating issue JIRA-2337
[JIRA] Updating issue JIRA-2562
[JIRA] Updating issue JIRA-2523
[JIRA] Updating issue JIRA-1680
[JIRA] Updating issue JIRA-1270
[JIRA] Updating issue JIRA-2386
[JIRA] Updating issue JIRA-2379
[JIRA] Updating issue JIRA-2040
[JIRA] Updating issue JIRA-2052
[JIRA] Updating issue JIRA-2030
[JIRA] Updating issue JIRA-2347
[JIRA] Updating issue JIRA-2346
[JIRA] Updating issue JIRA-1724
[JIRA] Updating issue JIRA-1595
[JIRA] Updating issue JIRA-1883
[JIRA] Updating issue JIRA-1754
[JIRA] Updating issue JIRA-1871
[JIRA] Updating issue JIRA-1858
[JIRA] Updating issue JIRA-939
[JIRA] Updating issue JIRA-1793
[JIRA] Updating issue JIRA-1770
[JIRA] Updating issue JIRA-281
[JIRA] Updating issue JIRA-1642
[JIRA] Updating issue JIRA-1473
[JIRA] Updating issue JIRA-1537
[JIRA] Updating issue JIRA-1307
[JIRA] Updating issue JIRA-1263
[JIRA] Updating issue JIRA-1048
[JIRA] Updating issue JIRA-1470
[JIRA] Updating issue JIRA-1436
[JIRA] Updating issue JIRA-1237
[JIRA] Updating issue JIRA-1303
[JIRA] Updating issue JIRA-1328
[JIRA] Updating issue JIRA-1306
[JIRA] Updating issue JIRA-1309
[JIRA] Updating issue JIRA-1281
[JIRA] Updating issue JIRA-1261
[JIRA] Updating issue JIRA-1262
[JIRA] Updating issue STMM-38
[JIRA] Updating issue JIRA-633
[JIRA] Updating issue JIRA-838
[JIRA] Updating issue JIRA-1179
[JIRA] Updating issue JIRA-1177
[JIRA] Updating issue JIRA-1098
[JIRA] Updating issue JIRA-933
[JIRA] Updating issue JIRA-1065
[JIRA] Updating issue JIRA-965
[JIRA] Updating issue JIRA-59
[JIRA] Updating issue JIRA-1056
[JIRA] Updating issue JIRA-849
[JIRA] Updating issue JIRA-923
[JIRA] Updating issue JIRA-1265
[JIRA] Updating issue JIRA-3296
[JIRA] Updating issue JIRA-3272
[JIRA] Updating issue JIRA-3297
[JIRA] Updating issue JIRA-3312
[JIRA] Updating issue JIRA-3322
[JIRA] Updating issue JIRA-2750
[JIRA] Updating issue JIRA-3300
[JIRA] Updating issue JIRA-3317
Recording plot data



-- 
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/trinity-7bfde448-19a6-4550-9db5-f9fd09028a28-1497451689348%403capp-gmx-bs75.
For more options, visit https://groups.google.com/d/optout.


Re: SonarQube and Declarative Pipeline

2017-06-14 Thread Kirill Peskov
OK, I went a bit further, wrapping scripted pipeline syntax pieces in
script{} pseudo-step, so I actually created this:


stage('Submit the sources to SonarQube') {
environment {
SONAR_SCANNER_OPTS = "-Xmx2G -Xms256m"
}
steps {
script {
def scannerHome = tool 'SonarQube Scanner';
withSonarQubeEnv('SonarQube Local') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
}

But later on I stuck again, because the agent was not able to find the
sonar-scanner, despite properly formed path to it. I fiddled with that a
bit and found, that the path actually existed on the agent only (docker
host), but was never exposed to the container, where the scanner suppose
to be started according to Mr. Jenkins logic (actually I see no point to
start the sonar-scanner from within the container, checkout happens on
the docker host anyway, so firing up the scanner on the docker host
itself would be much more elegant). So I added 'arg' to my dockerfile
part of the pipeline:

 agent {
dockerfile {
dir 'ubuntu-xenial-mysql'
args '-v /Jenkins-CI/tools:/Jenkins-CI/tools'
}
}

So the tools would become available not only on 'persistent' docker host
agent machine, but inside the container as well. For now — submission
has been successful, waiting the analysis and if webhook would work.

Cheers,
Kirill


On 14.06.17 13:31, Kirill Peskov wrote:
> Hi All!
>
> Has anyone manage to get SonarQube Scanner and Quality Gateway working
> in a Declarative Pipeline? I'm actually stuck with that, because the
> only examples on both Jenkins and SonarQube docs are examples for the
> scripted pipeline, not declarative one...
>
>
> SonarQube document:
> https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
> Jenkins document: https://jenkins.io/doc/pipeline/steps/sonar/
>
>
> Both examples are for scripted pipeline (documentation bug/lint?) and
> neither of them explains what is actually necessary inside the block
> withSonarQubeEnv{} and how to start the scanner (which is located on the
> agent in the 'tools' subfolder. Even more — Jenkins does not recognize
> withSonarQubeEnv{} as 'step' at all :(
>
>
> I think one working example would be enough to understand... To add
> another 5 cents, I have to pass extra -Xms and -Xmx parameters to the
> scanner, otherwise it crashes with OOM (I tested it in a 'freestyle' job).
>
>
> Cheers,
> Kirill
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/75e23dc3-afab-8546-4e1e-e70313419732%40paranoid.email.
For more options, visit https://groups.google.com/d/optout.


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:\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 the code for that project.
>
> I Jenkins I have two multibranch pipeline jobs - one for Project1 and one 
> for Project2. In the configuration for Project1 I don't want a push 
> notification or polling to build Project1 if a commit was pushed in 
> sub-directory for Project2.
>
> So in Project1 I have configured Additional Behaviours:
> *Advanced clone behaviours*
> Shallow clone is checked
> *Sparse checkout path *is set to Project1
> *Polling ignores commits in certain paths*
>Included Regions: Project1/*
>Excluded Regions: *
>
> *Build Configuration*
> Script Path: Project1/Jenkinsfile
>
> What is happening is if I push a commit to master in sub-directory 
> Project2, Project1 and Project2 jobs get built. I only want Project2 to 
> build. Can someone point out what I'm doing wrong?
>
> Jenkinsfiles for both Projects are similar and look like:
>
> #!groovy
> node {
> stage ('checkout') {
> checkout scm
> }
> stage ('build') {
> dir ('Project1') {
> bat 'powershell -Command gci'
> bat 'powershell -Command gci env:'
> bat 'powershell -File .\\Project1.ps1'
> }
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2d93af03-096e-49ff-a66b-29672a53324e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can environment directive be used in post?

2017-06-14 Thread Idan Adar
In a stage I can do the following: 

stage ("Merge pull request") {
 environment {
JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
 }
 ...
 ...
 steps {
  
 }
}

Can this done also in post?

post {
 success {
 environment { 
 JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
 }

 script {
 
 }
  }
}


Or is there any other way to ahchieve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3dbaa1ef-96c3-4067-8cc3-00d3a1b8452b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to set environment variable in multibranch pipeline?

2017-06-14 Thread Mark Allison
Thanks for the reply, but I need to set the variable outside the pipeline 
script similar to the Environment Injector plugin. Is there a way to do 
that?

On Tuesday, 13 June 2017 13:36:07 UTC+1, Kevin Burnett wrote:
>
> here's an example Jenkinsfile that sets an environment variable (REPO_URL) 
> that applies to all stages. you can also use the withEnv step to set an 
> environment variable for a certain block.
>
> pipeline {
>   agent { label 'docker' }
>   environment {
> REPO_URL = 'www.my.repo'
>   }
>   stages {
> 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, June 13, 2017 at 3:53:33 AM UTC-4, Mark Allison wrote:
>>
>> 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 
>> branches to automatically inherit some environment variables.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/67fe426e-5c0d-4019-8972-d9ac24167fce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SSH Slave crashing immediately after start

2017-06-14 Thread Peter Berghold
Okay I guess I'm going to have to investigate how to get the newer version
of Java on Redhat. Redhat 6 at that. Thanks for the pointers.

On Wed, Jun 14, 2017, 07:04 James Nord  wrote:

> > java -version returned 1.7.0_75.
>
>
> Jenkins 2.58+ only support java8 or higher, this includes your agents JVM.
>
>
> /James
>
>
> On Tuesday, June 13, 2017 at 9:05:40 PM UTC+1, Peter Berghold wrote:
>>
>> I'm trying to re-establish connectivity to an SSH slave that used to work
>> when I was running a much older version of Jenkins.  Currently I'm using
>> v2.65. What I'm seeing (somewhat trimmed) in the log is the following:
>>
>> [06/13/17 20:04:05] [SSH] Checking java version of java
>> [06/13/17 20:04:05] [SSH] java -version returned 1.7.0_75.
>> [06/13/17 20:04:05] [SSH] Starting sftp client.
>> [06/13/17 20:04:05] [SSH] Copying latest slave.jar...
>> [06/13/17 20:04:05] [SSH] Copied 719,269 bytes.
>> Expanded the channel window size to 4MB
>> [06/13/17 20:04:05] [SSH] Starting slave process: cd "/data/jenkins-slave" 
>> && java  -jar slave.jar
>> <===[JENKINS REMOTING CAPACITY]===>channel started
>> Slave JVM has not reported exit code. Is it still running?
>> [06/13/17 20:04:09] Launch failed - cleaning up connection
>> [06/13/17 20:04:09] [SSH] Connection closed.
>> ERROR: Connection terminated
>> java.io.EOFException
>>  at 
>> java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2353)
>>  at 
>> java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2822)
>>  at 
>> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)
>>  at java.io.ObjectInputStream.(ObjectInputStream.java:301)
>>  at 
>> hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:48)
>>  at 
>> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
>>  at 
>> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:59)
>> Caused: java.io.IOException: Unexpected termination of the channel
>>  at 
>> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:73)
>>
>>
>> At a loss...
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/ea6f2611-da6f-448d-9065-2e23fdf29a85%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAArvnv0VePW0gp4SzHtnJ7PggcViiRcZQj1%3DtjgT%2BOx0FfPEnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


SonarQube and Declarative Pipeline

2017-06-14 Thread Kirill Peskov
Hi All!

Has anyone manage to get SonarQube Scanner and Quality Gateway working
in a Declarative Pipeline? I'm actually stuck with that, because the
only examples on both Jenkins and SonarQube docs are examples for the
scripted pipeline, not declarative one...


SonarQube document:
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
Jenkins document: https://jenkins.io/doc/pipeline/steps/sonar/


Both examples are for scripted pipeline (documentation bug/lint?) and
neither of them explains what is actually necessary inside the block
withSonarQubeEnv{} and how to start the scanner (which is located on the
agent in the 'tools' subfolder. Even more — Jenkins does not recognize
withSonarQubeEnv{} as 'step' at all :(


I think one working example would be enough to understand... To add
another 5 cents, I have to pass extra -Xms and -Xmx parameters to the
scanner, otherwise it crashes with OOM (I tested it in a 'freestyle' job).


Cheers,
Kirill

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/318625e3-6f19-9818-6a23-9ed4edd5add2%40paranoid.email.
For more options, visit https://groups.google.com/d/optout.


Re: SSH Slave crashing immediately after start

2017-06-14 Thread James Nord


> java -version returned 1.7.0_75.


Jenkins 2.58+ only support java8 or higher, this includes your agents JVM.


/James


On Tuesday, June 13, 2017 at 9:05:40 PM UTC+1, Peter Berghold wrote:
>
> I'm trying to re-establish connectivity to an SSH slave that used to work 
> when I was running a much older version of Jenkins.  Currently I'm using 
> v2.65. What I'm seeing (somewhat trimmed) in the log is the following:
>
> [06/13/17 20:04:05] [SSH] Checking java version of java
> [06/13/17 20:04:05] [SSH] java -version returned 1.7.0_75.
> [06/13/17 20:04:05] [SSH] Starting sftp client.
> [06/13/17 20:04:05] [SSH] Copying latest slave.jar...
> [06/13/17 20:04:05] [SSH] Copied 719,269 bytes.
> Expanded the channel window size to 4MB
> [06/13/17 20:04:05] [SSH] Starting slave process: cd "/data/jenkins-slave" && 
> java  -jar slave.jar
> <===[JENKINS REMOTING CAPACITY]===>channel started
> Slave JVM has not reported exit code. Is it still running?
> [06/13/17 20:04:09] Launch failed - cleaning up connection
> [06/13/17 20:04:09] [SSH] Connection closed.
> ERROR: Connection terminated
> java.io.EOFException
>   at 
> java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2353)
>   at 
> java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2822)
>   at 
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)
>   at java.io.ObjectInputStream.(ObjectInputStream.java:301)
>   at 
> hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:48)
>   at 
> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
>   at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:59)
> Caused: java.io.IOException: Unexpected termination of the channel
>   at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:73)
>
>
> At a loss...
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ea6f2611-da6f-448d-9065-2e23fdf29a85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 the code for that project.

I Jenkins I have two multibranch pipeline jobs - one for Project1 and one 
for Project2. In the configuration for Project1 I don't want a push 
notification or polling to build Project1 if a commit was pushed in 
sub-directory for Project2.

So in Project1 I have configured Additional Behaviours:
*Advanced clone behaviours*
Shallow clone is checked
*Sparse checkout path *is set to Project1
*Polling ignores commits in certain paths*
   Included Regions: Project1/*
   Excluded Regions: *

*Build Configuration*
Script Path: Project1/Jenkinsfile

What is happening is if I push a commit to master in sub-directory 
Project2, Project1 and Project2 jobs get built. I only want Project2 to 
build. Can someone point out what I'm doing wrong?

Jenkinsfiles for both Projects are similar and look like:

#!groovy
node {
stage ('checkout') {
checkout scm
}
stage ('build') {
dir ('Project1') {
bat 'powershell -Command gci'
bat 'powershell -Command gci env:'
bat 'powershell -File .\\Project1.ps1'
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/da14d74a-1786-4959-a9aa-0eef857282a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


stdout is null when executing a command from a shared library

2017-06-14 Thread Francis Pereira
When executing commands from a shared library, stdout is always null. How 
do I get an handle on it ? This only happens when calling the shared 
library from a pipeline. If I run it in the 'Script Console' (with 
modification to make it execute), I get content from stdout. 

Example:

*Shared library:*

// CodeDeploy.groovy
class CodeDeploy {

Script script

def executeOnShell(String... command) {
script.println "About to execute: " + command
def process = new ProcessBuilder(command)
process.redirectOutput()
process.redirectErrorStream(true)
def shell = process.start()
InputStream shellIn = shell.getInputStream()
BufferedReader reader = new BufferedReader(new 
InputStreamReader(shellIn))
StringBuilder builder = new StringBuilder()
String line = null;
shell.waitFor()
while ((line = reader.readLine()) != null) {
builder.append(line);
builder.append("\n");
}


script.println('Output from command: ' + builder.toString())

int shellExitStatus = shell.exitValue();
script.println('Exit value: ' + shellExitStatus)

return builder.toString();
}
}

*Pipeline Usage:*
//Jenkinsfile

@Library('jenkins-pipeline-libraries')
import com.wizrocket.jenkins.CodeDeploy

pipeline {

agent any

options {
timestamps()
buildDiscarder(logRotator(numToKeepStr: ''))
disableConcurrentBuilds()
timeout(time: 1, unit: 'HOURS')
}

stages {
stage('lost output') {
steps {
script {
CodeDeploy cd = new CodeDeploy(script: this)
cd.executeOnShell('time', 'sleep', '10')
}
}
}
}

post {
always {
deleteDir()
echo 'I will always say Hello again!'
}
}
}

*Output:*

[Pipeline] }[Pipeline] // stage[Pipeline] timestamps[Pipeline] {[Pipeline] 
timeout*14:00:49* Timeout set to expire in 1 hr 0 min[Pipeline] {[Pipeline] 
stage[Pipeline] { (lost output)[Pipeline] script[Pipeline] {

[Pipeline] echo*14:00:49* About to execute: [time, sleep, 10][Pipeline] 
echo*14:00:59* Output from command: [Pipeline] echo*14:00:59* Exit value: 
0[Pipeline] }[Pipeline] // script[Pipeline] }[Pipeline] // stage[Pipeline] 
stage[Pipeline] { (Declarative: Post Actions)[Pipeline] deleteDir[Pipeline] 
echo*14:00:59* I will always say Hello again![Pipeline] }[Pipeline] // 
stage[Pipeline] }[Pipeline] // timeout[Pipeline] }[Pipeline] // 
timestamps[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineFinished: 
SUCCESS



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/df48a7c7-0e52-4206-9352-92d2fd238b18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.