How can I get inject environment from a freestyle job in pipeline job

2017-06-27 Thread stanley . shen
Hello, all

I am trying to trigger a freestyle job in pipeline and need to get a inject 
environment from that job.
Before with flow job, we can use thing like 

c = build("test job1")
uuid = c.build.properties["environment"]["uuid"]

But I didn't find a way to do this similar in pipeline script.

Is there any hint on it?

-- 
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/fa73e7a7-ea85-4eee-8f8e-037689bff630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git plugin issue in pipeline

2017-06-27 Thread Mark Waite


On Tuesday, June 27, 2017 at 5:01:46 PM UTC-6, Mark Waite wrote:
>
> I suspect you're encountering a conflict between the git plugin 
> maintaining compatibility with old behavior, and the desire to support 
> branch names which contain slashes.
>
> Refer to the online help in the git plugin for alternate ways to define a 
> branch name.  The format "word/word" is (unfortunately) ambiguous since it 
> can be interpreted as either the local branch "feature/branch" or as a 
> branch named "branch" on a remote named "feature".
>
> If you'll ask for "remote/feature/branch", I think you'll get the result 
> you want.
>
>
As in, "origin/feature/branch" if you're using the default remote name, 
"origin".

 

> Refer to https://issues.jenkins-ci.org/browse/JENKINS-14026 for more 
> history on the issue.
>
> Mark Waite 
>
> On Tuesday, June 27, 2017 at 3:53:07 PM UTC-6, Abhijith Reddy wrote:
>>
>> Whenever i specify a branch with GitSCM i see the following issue
>> Couldn't find any revision to build. Verify the repository and branch 
>> configuration for this job.
>>
>> Here's my Jenkinsfile
>>
>> node {
>>
>> deleteDir()
>> checkout([$class: 'GitSCM', branches: [[name: 'feature/my-branch]], 
>> doGenerateSubmoduleConfigurations: false, extensions: [[$class: 
>> 'CleanBeforeCheckout'],[$class: 'PruneStaleBranch']], submoduleCfg: [], 
>> userRemoteConfigs: [[credentialsId: 'aaa-aaa-aaa-aaa', url: GIT_URL]]])
>> }
>>
>>
>> and here is the error
>>
>>
>> Checking out git ssh://g...@stash.com:7999/capt/jenkins-pipelines.git to 
>> read Jenkinsfile-pull-request
>> Wiping out workspace first.
>> Cloning the remote Git repository
>> Cloning repository ssh://g...@stash.com:7999/capt/jenkins-pipelines.git 
>> 
>>  > git init 
>> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline@script
>>  
>> # timeout=10
>> Fetching upstream changes from ssh://
>> g...@stash.com:7999/capt/jenkins-pipelines.git
>>  > git --version # timeout=10
>> using GIT_SSH to set credentials automated repo access
>>  > git fetch --tags --progress ssh://
>> g...@stash.com:7999/capt/jenkins-pipelines.git 
>> +refs/heads/*:refs/remotes/origin/*
>>  > git config remote.origin.url ssh://
>> g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
>>  > git config --add remote.origin.fetch 
>> +refs/heads/*:refs/remotes/origin/* # timeout=10
>>  > git config remote.origin.url ssh://
>> g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
>> Fetching upstream changes from ssh://
>> g...@stash.com:7999/capt/jenkins-pipelines.git
>> using GIT_SSH to set credentials automated repo access
>>  > git fetch --tags --progress ssh://
>> g...@stash.com:7999/capt/jenkins-pipelines.git 
>> +refs/heads/*:refs/remotes/origin/*
>>  > git rev-parse origin/develop^{commit} # timeout=10
>> Checking out Revision 81cbf859af08d159c8c3a89cb796b4b1b536 
>> (origin/develop)
>>  > git config core.sparsecheckout # timeout=10
>>  > git checkout -f 81cbf859af08d159c8c3a89cb796b4b1b536
>>  > git rev-list 571b6661262fa11ce2e1088338c1f19cd1a5110d # timeout=10
>> First time build. Skipping changelog.
>> [Pipeline] node
>> Running on q7bld02 in 
>> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline
>> [Pipeline] {
>> [Pipeline] deleteDir
>> [Pipeline] checkout
>> Cloning the remote Git repository
>> Cloning repository ssh://g...@stash.com:7999/api/mpp.git
>>  > git init 
>> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline 
>> # timeout=10
>> Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
>>  > git --version # timeout=10
>> using GIT_SSH to set credentials automated repo access
>>  > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
>> +refs/heads/*:refs/remotes/origin/*
>>  > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
>> timeout=10
>>  > git config --add remote.origin.fetch 
>> +refs/heads/*:refs/remotes/origin/* # timeout=10
>>  > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
>> timeout=10
>> Cleaning workspace
>>  > git rev-parse --verify HEAD # timeout=10
>> No valid HEAD. Skipping the resetting
>>  > git clean -fdx # timeout=10
>> Pruning obsolete local branches
>> Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
>> using GIT_SSH to set credentials automated repo access
>>  > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
>> +refs/heads/*:refs/remotes/origin/* --prune
>>  > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
>> timeout=10
>>  > git rev-parse 
>> refs/remotes/origin/feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
>> timeout=10
>>  > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
>> timeout=10
>> [Pipeline] }
>> [Pipeline] // node
>> [Pipeline] E

Re: Git plugin issue in pipeline

2017-06-27 Thread Mark Waite
I suspect you're encountering a conflict between the git plugin maintaining 
compatibility with old behavior, and the desire to support branch names 
which contain slashes.

Refer to the online help in the git plugin for alternate ways to define a 
branch name.  The format "word/word" is (unfortunately) ambiguous since it 
can be interpreted as either the local branch "feature/branch" or as a 
branch named "branch" on a remote named "feature".

If you'll ask for "remote/feature/branch", I think you'll get the result 
you want.

Refer to https://issues.jenkins-ci.org/browse/JENKINS-14026 for more 
history on the issue.

Mark Waite 

On Tuesday, June 27, 2017 at 3:53:07 PM UTC-6, Abhijith Reddy wrote:
>
> Whenever i specify a branch with GitSCM i see the following issue
> Couldn't find any revision to build. Verify the repository and branch 
> configuration for this job.
>
> Here's my Jenkinsfile
>
> node {
>
> deleteDir()
> checkout([$class: 'GitSCM', branches: [[name: 'feature/my-branch]], 
> doGenerateSubmoduleConfigurations: false, extensions: [[$class: 
> 'CleanBeforeCheckout'],[$class: 'PruneStaleBranch']], submoduleCfg: [], 
> userRemoteConfigs: [[credentialsId: 'aaa-aaa-aaa-aaa', url: GIT_URL]]])
> }
>
>
> and here is the error
>
>
> Checking out git ssh://g...@stash.com:7999/capt/jenkins-pipelines.git to 
> read Jenkinsfile-pull-request
> Wiping out workspace first.
> Cloning the remote Git repository
> Cloning repository ssh://g...@stash.com:7999/capt/jenkins-pipelines.git 
> 
>  > git init 
> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline@script
>  
> # timeout=10
> Fetching upstream changes from ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git
>  > git --version # timeout=10
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git config remote.origin.url ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
>  > git config --add remote.origin.fetch 
> +refs/heads/*:refs/remotes/origin/* # timeout=10
>  > git config remote.origin.url ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
> Fetching upstream changes from ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git rev-parse origin/develop^{commit} # timeout=10
> Checking out Revision 81cbf859af08d159c8c3a89cb796b4b1b536 
> (origin/develop)
>  > git config core.sparsecheckout # timeout=10
>  > git checkout -f 81cbf859af08d159c8c3a89cb796b4b1b536
>  > git rev-list 571b6661262fa11ce2e1088338c1f19cd1a5110d # timeout=10
> First time build. Skipping changelog.
> [Pipeline] node
> Running on q7bld02 in 
> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline
> [Pipeline] {
> [Pipeline] deleteDir
> [Pipeline] checkout
> Cloning the remote Git repository
> Cloning repository ssh://g...@stash.com:7999/api/mpp.git
>  > git init 
> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline 
> # timeout=10
> Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
>  > git --version # timeout=10
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
> timeout=10
>  > git config --add remote.origin.fetch 
> +refs/heads/*:refs/remotes/origin/* # timeout=10
>  > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
> timeout=10
> Cleaning workspace
>  > git rev-parse --verify HEAD # timeout=10
> No valid HEAD. Skipping the resetting
>  > git clean -fdx # timeout=10
> Pruning obsolete local branches
> Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
> +refs/heads/*:refs/remotes/origin/* --prune
>  > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
> timeout=10
>  > git rev-parse 
> refs/remotes/origin/feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
> timeout=10
>  > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
> timeout=10
> [Pipeline] }
> [Pipeline] // node
> [Pipeline] End of Pipeline
> ERROR: Couldn't find any revision to build. Verify the repository and 
> branch configuration for this job.
> Finished: FAILURE
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group a

Git plugin issue in pipeline

2017-06-27 Thread Abhijith Reddy
Whenever i specify a branch with GitSCM i see the following issue
Couldn't find any revision to build. Verify the repository and branch 
configuration for this job.

Here's my Jenkinsfile

node {

deleteDir()
checkout([$class: 'GitSCM', branches: [[name: 'feature/my-branch]], 
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 
'CleanBeforeCheckout'],[$class: 'PruneStaleBranch']], submoduleCfg: [], 
userRemoteConfigs: [[credentialsId: 'aaa-aaa-aaa-aaa', url: GIT_URL]]])
}


and here is the error


Checking out git ssh://g...@stash.com:7999/capt/jenkins-pipelines.git to 
read Jenkinsfile-pull-request
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository ssh://g...@stash.com:7999/capt/jenkins-pipelines.git
 > git init 
/var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline@script
 
# timeout=10
Fetching upstream changes from 
ssh://g...@stash.com:7999/capt/jenkins-pipelines.git
 > git --version # timeout=10
using GIT_SSH to set credentials automated repo access
 > git fetch --tags --progress 
ssh://g...@stash.com:7999/capt/jenkins-pipelines.git 
+refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url 
ssh://g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
# timeout=10
 > git config remote.origin.url 
ssh://g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
Fetching upstream changes from 
ssh://g...@stash.com:7999/capt/jenkins-pipelines.git
using GIT_SSH to set credentials automated repo access
 > git fetch --tags --progress 
ssh://g...@stash.com:7999/capt/jenkins-pipelines.git 
+refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/develop^{commit} # timeout=10
Checking out Revision 81cbf859af08d159c8c3a89cb796b4b1b536 
(origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 81cbf859af08d159c8c3a89cb796b4b1b536
 > git rev-list 571b6661262fa11ce2e1088338c1f19cd1a5110d # timeout=10
First time build. Skipping changelog.
[Pipeline] node
Running on q7bld02 in 
/var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline
[Pipeline] {
[Pipeline] deleteDir
[Pipeline] checkout
Cloning the remote Git repository
Cloning repository ssh://g...@stash.com:7999/api/mpp.git
 > git init 
/var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline 
# timeout=10
Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
 > git --version # timeout=10
using GIT_SSH to set credentials automated repo access
 > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
+refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
# timeout=10
 > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
timeout=10
Cleaning workspace
 > git rev-parse --verify HEAD # timeout=10
No valid HEAD. Skipping the resetting
 > git clean -fdx # timeout=10
Pruning obsolete local branches
Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
using GIT_SSH to set credentials automated repo access
 > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
+refs/heads/*:refs/remotes/origin/* --prune
 > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
timeout=10
 > git rev-parse 
refs/remotes/origin/feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
timeout=10
 > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
timeout=10
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Couldn't find any revision to build. Verify the repository and 
branch configuration for this job.
Finished: FAILURE


-- 
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/a6a95098-8538-44ac-98ee-22b10e27c223%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Gerrit trigger doesn't detect changes in Gerrit and run automatically CI

2017-06-27 Thread John Mellor
Hi Daniel,

The Gerrit plugin a really nice piece of work that is pathetically documented 
and poorly integrated with the co-requisite git plugin.  It works, but the 
working config settings are very non-obvious and the integration seems 
incomplete.

In the sourcecode management section under git, in the advanced/addition 
behaviours subsection, add strategy for choosing what to build and set it to 
Gerrit trigger.  That is probably the key item that gets your setup at least 
partially functional.

In the job, configure the Gerrit trigger to watch for patchset created, draft 
published and change merged.  That seems to be all that is actually required in 
real-world use.

Change your Gerrit trigger branch from plain to path and set it to the branch 
to build.

I also set a default pair of prarameters in the job, for when someone does a 
pushbutton build.  Se the intended GERRIT_BRANCH to (say) dev, and 
GERRIT_REFSPEC to (say) refs/heads/dev to get that mode working.

Finally, if you are using promotions or a build step that promotes artifacts, 
you need to differentiate between Gerrit verification builds and final builds.  
I add a small block of scripting to check for a non-verification build like so:

if [ ! -z "${GERRIT_EVENT_TYPE}" -a "$GERRIT_EVENT_TYPE" != 'change-merged' ]
then
echo 'You cannot promote a verification build' # >&2
exit 1
fi

The 2-part test is required because there is no consistent means of determining 
what triggered the build.  IMHO, the integration sucks.



From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Daniel Pawlik
Sent: June-27-17 14:30
To: Jenkins Users 
Subject: Gerrit trigger doesn't detect changes in Gerrit and run automatically 
CI

Hello,
I have a problem with Gerrit trigger on Jenkins. It doesn't detect and build 
automatically changes pushed to Gerrit repo. I read a lot of manuals and it 
still doesn't work.
Below I present screenshots and executed commands with output.

NOTE: I also check Jenkins Gerrit trigger using Admin credentials and it also 
doesn't work.
NOTE 2: Yes, I would like to configure gerrit like Openstack gerrit have.

All informations:

# Gerrit version:
$ ssh -p 29418 admin@localhost gerrit version
gerrit version 2.14.1

# Enabled plugins - from https://gerrit-ci.gerritforge.com/

# ssh -p 29418 admin@localhost gerrit plugin ls
Name   VersionStatus   File
---
commit-message-length-validator v2.14.1ENABLED  
commit-message-length-validator.jar
delete-project v2.13-13-gd9f1d5f ENABLED  delete-project.jar
download-commands  v2.14.1ENABLED  download-commands.jar
events-log v2.13-26-g83e640c ENABLED  events-log.jar
hooks  v2.14.1ENABLED  hooks.jar
replicationv2.14.1ENABLED  replication.jar
reviewnotesv2.14.1ENABLED  reviewnotes.jar
singleusergroupv2.14.1ENABLED  singleusergroup.jar
verify-status  d99fbcfENABLED  verify-status.jar


$ ssh -p 29418 admin@localhost gerrit create-group "'Jenkins'" --description 
"'jenkins'" --member "'jenkins'" --visible-to-all

$ mkdir All-Projects-ACLs
$ cd All-Projects-ACLs
$ git init
$ git remote add gerrit ssh://$USER@$HOST:29418/All-Projects.git
$ git fetch gerrit +refs/meta/*:refs/remotes/gerrit-meta/*
$ git checkout -b config remotes/gerrit-meta/config

$ cat groups
global:Jenkins Jenkins


$ cat project.config
[project]
description = Access inherited by all other projects.
[receive]
requireContributorAgreement = false
requireSignedOffBy = false
requireChangeId = true
enableSignedPush = false
[submit]
mergeContent = true

[capability]
administrateServer = group Administrators
priority = batch group Non-Interactive Users
streamEvents = group Non-Interactive Users
accessDatabase = group Administrators
administrateServer = group Administrators
createProject = group Project Bootstrappers
emailReviewers = deny group Third-Party CI
priority = batch group Non-Interactive Users
runAs = group Project Bootstrappers
streamEvents = group Registered Users
streamEvents = group Jenkins

[access "refs/*"]
read = group Administrators
read = group Anonymous Users
read = group Non-Interactive Users
read = group Jenkins
push = group Administrators
editTopicName = group Registered Users
create = group Administrators

[access "refs/remotes/*"]
read = group Administrators
read = group Anonymous Users
push = group Administrators
editTopicName = group Registered Users
create = group Administrators

[access "refs/for/*"]
addPatchSet = group Registered Users

[access "refs/for/refs/*"]
push = group Registered Users
push = group Administrators
push

Re: getting started with pipelines - attempting to use sh returns 'script.sh: not found'

2017-06-27 Thread danielp
Poked around in the mailing list and found the solution:

The 'Manage Jenkins' > 'Configure system' > 'Shell Executable' setting had 
been incorrectly set to just 'bash' instead of an absolute path. I just 
left the field blank and let Jenkins determine the shell. Works now!

On Tuesday, June 27, 2017 at 12:40:31 PM UTC-6, dan...@gradecam.com wrote:
>
> Hi Folks,
>
> Just getting started with Jenkins Pipelines, following the tutorial found 
> here:
>
>
> https://www.cloudbees.com/blog/using-pipeline-plugin-accelerate-continuous-delivery-part-1
>
> When I attempt to run any commands via 'sh', I get an error saying 'not 
> found'. For example, in my pipeline script, I simply have "sh('ls')" which 
> returns:
>
> [Pipeline] sh
>
> [pipeline_test] Running shell script
> sh: 1: /home/jenkins/workspace/pipeline_test@tmp/durable-fa8ef8f6/script.sh: 
> not found
>
>
> I don't know what the problem is here, any tips/help is appreciated!
>
>
> //Daniel
>
>
>
>

-- 
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/e443dbbd-b684-4d26-b6a0-a3c09d8996d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


getting started with pipelines - attempting to use sh returns 'script.sh: not found'

2017-06-27 Thread danielp
Hi Folks,

Just getting started with Jenkins Pipelines, following the tutorial found 
here:

https://www.cloudbees.com/blog/using-pipeline-plugin-accelerate-continuous-delivery-part-1

When I attempt to run any commands via 'sh', I get an error saying 'not 
found'. For example, in my pipeline script, I simply have "sh('ls')" which 
returns:

[Pipeline] sh

[pipeline_test] Running shell script
sh: 1: /home/jenkins/workspace/pipeline_test@tmp/durable-fa8ef8f6/script.sh: 
not found


I don't know what the problem is here, any tips/help is appreciated!


//Daniel



-- 
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/ea59aac1-0575-4eef-ad10-31b424620809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Trigger a job based on failure of another/upstream job

2017-06-27 Thread Kishor Ramanan
Hi,

Is there a way where I can trigger a job based on the failure condition of 
other job?

I am using pipeline as of now, during the last step if pipeline fails, I 
want to execute a specific set of job.

Thanks

-- 
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/ce1a300c-be24-4c94-8b71-62042e1d85af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


GitHub PR Comment Build Plugin - How to debug

2017-06-27 Thread Danny Rehelis
Hi,

I've been notified by my staff that leaving configured comment not always
triggers PR build.
How to debug this? Nothing getting logged when comment comment is left. How
can I track this for better analysis?

latest multi-branch plugin with latest version of github pr comment plugin.

Thanks

-- 
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/CAObRFCU9O1kqYCH14d%2B3YnoZkH_y8bY1nG0zcj5EF7_Oyw44zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Can we construct a more complex slackSend notification?

2017-06-27 Thread Idan Adar
In a Node.js app, one can use the slack-notify package to send something 
like this:


slack.send({
  "username": "myBotName",
  "icon_emoji": ":robot_face:",
  "mrkdwn": true,
  "attachments": [
 {
"mrkdwn_in": ['text','pretext'],
"color": "#199515",
"text": message,
"fallback": "*my*: _markdown_ message."
 }
  ]   
   });

In a Jenkinsfile, one can do this:
slackSend (
   color: '#F01717',
   message: "$JOB_NAME: <$BUILD_URL|Build #$BUILD_NUMBER>, my message."
)

I'm looking for a way to accomplish the Node implementation, but using 
slackSend so that the message dispatched from the Jenkinsfile will be 
on-par with the Node.js-sent message.

-- 
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/f9d4a4bf-5ced-47f1-a550-4eb4928e68eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins behaviour with github webhook and github service

2017-06-27 Thread Ramanathan Muthaiah
Hi All,

Am working to setup webhook trigger between github enterprise and Jenkins. 

As part of this, enabled AWS SNS in Github repo and have Lambda subscribed 
to the AWS SNS topic. 
With this setup in place, on Jenkins side, in the job (where build should 
be triggered automatically) these two options were enabled.

"Github Project" 
"GitHub hook trigger for GITScm polling"

Is it correct to assume that with the service option enabled (with SNS in 
this case) and turning on these features in the specific job, will enable 
Jenkins to trigger the job when the event from Github is passed to the 
Jenkins server?

Or the two features will work only if webhook is enabled in github repo by 
setting the webhook URL, like, http://my-jenkins-server.com/github-webhook/?

/Ram

-- 
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/41b35bca-5e68-4ba8-8434-7c292b86da35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins throwing NPE on build.

2017-06-27 Thread ascarborough


*The exception:*

*11:00:43* ERROR: Processing failed due to a bug in the code. Please report 
this to jenkinsci-users@googlegroups.com*11:00:43* 
java.lang.NullPointerException 
*11:00:43*
  at 
org.jenkinsci.plugins.environmentdashboard.DashboardBuilder.writeToDB(DashboardBuilder.java:173)
 
*11:00:43*
  at 
org.jenkinsci.plugins.environmentdashboard.DashboardBuilder.setUp(DashboardBuilder.java:116)
 
*11:00:43*
  at 
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:668)
 
*11:00:43*
   at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 
*11:00:43*
 at hudson.model.Run.execute(Run.java:1728) 
*11:00:43*
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544) 
*11:00:43*
 at hudson.model.ResourceController.execute(ResourceController.java:98) 
*11:00:43*
 at hudson.model.Executor.run(Executor.java:405) 
*11:00:43*
 project=hudson.maven.MavenModuleSet@48a8e4df[Module-Nightly]*11:00:43* 
project.getModules()=[]*11:00:43* project.getRootModule()=null*11:00:43* FATAL: 
null*11:00:43* java.lang.NullPointerException 
*11:00:43*
at 
org.jenkinsci.plugins.environmentdashboard.DashboardBuilder.writeToDB(DashboardBuilder.java:173)
 
*11:00:43*
  at 
org.jenkinsci.plugins.environmentdashboard.DashboardBuilder.setUp(DashboardBuilder.java:116)
 
*11:00:43*
  at 
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:668)
 
*11:00:43*
   at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 
*11:00:43*
 at hudson.model.Run.execute(Run.java:1728) 
*11:00:43*
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544) 
*11:00:43*
 at hudson.model.ResourceController.execute(ResourceController.java:98) 
*11:00:43*
 at hudson.model.Executor.run(Executor.java:405) 




Running Jenkins 2.47 on centOS 7

-- 
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/89ea9bd0-506d-4153-826f-259ff13be537%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Custom tools in Declarative Pipeline

2017-06-27 Thread jetaldesai
Custom tools are not supported in declarative pipeline or I did not find 
any solutions so far.

Can someone please help with use of custom tools in declarative pipeline?

Or how can I use scripted pipeline command in tool to use custom tools?

Thanks

-- 
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/c2cff54f-70da-403d-91ef-68616e6caa73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: vSphere Cloud Plugin - does it work ?

2017-06-27 Thread John Mellor
P asked:

Ø  So how do you guys use jenkins slaves on VMware ? Do you use existing VMs ?

I use vsphere slaves extensively, but only as existing VMs.  I never managed to 
get a dynamically-constructed slaves to actually work, but perhaps there is 
some magic combination of undocumented incantations that does it.  I have many 
Developers who leave all kinds of cruft around from their builds, install 
prereq packages, reconfigure ssh keys, ntp, dns, etc in their build steps.  I 
use the vsphere plugin to reset the slave back to a known-good condition at the 
start of the next build (that leaves the slave as the previous build left it, 
so I can debug what went wrong).

Its somewhat unfortunate that the plugin only uses vcenter api, as otherwise I 
could use the free version of esxi and also not need the $12k vcenter licence 
in this stack.  The software licences cost about 3x what the hardware costs, so 
you know something is wrong with that model.

For many job types, I also use the CloudBees Docker plugin to build jobs that 
do not build Docker images and do not require a different kernel or libc to 
build correct product.  It seems to be the only one that actually works, and 
provides the pristine environment for a lot less overhead.  I wish there was 
some kind of quality information associated with each Jenkins plugin, as there 
is a *LOT* of crap in the library.

I used to use the Debian pbuilder containers with a pretty large set of 
scripted wrappers in the C++ builds, but Docker images are an improvement.

If you need, I can send you my config changes that I use to thread the needle…



From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of P
Sent: June-27-17 03:17
To: Jenkins Users 
Subject: Re: vSphere Cloud Plugin - does it work ?

It looks like VSphere Cloud plugin is not very widely used 
So how do you guys use jenkins slaves on VMware ? Do you use existing VMs ?
I am a bit surprised nobody is creating dynamically VMs for Jenskins ...

Best regards
P.


On Tuesday, June 20, 2017 at 12:34:19 PM UTC+1, P wrote:
Hello all,

I am trying to use vSphere Cloud Plugin to create new VM for some test 
deployment.
Unfortunatelly it doesn't work and I don't really know why. Below is the error 
message I get when I press "Check Data" button
while defining "vSphere Build Step":
https://gist.github.com/anonymous/b355bed14171f8afa066dd18e8191179
I also include the configuration I use.

Can anybody have a look and tell me why it is failing ?
Kind regards
P.

--
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/7a37767a-285d-4b18-8ee6-2ac684a48e11%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/cdb2fe03af9846e2917ba0198f14641a%40mbx02cmb01p.esentire.local.
For more options, visit https://groups.google.com/d/optout.


Re: Publish over FTP on Jenkins Pipeline?

2017-06-27 Thread Thiago Carvalho Davila
I have a jenkins master with linux and windows slaves. Also have a shell
 script for recursive FTP files upload. But that doesn't work on windows
 ​slaves.

Does anybody have a platform independent way of doing 
that? Maybe a Python script or something alike. If so, will 
withCredentials work passing the user and password as arguments the same
 way?

Em 22/06/2017 15:44:59, Baptiste Mathus escreveu:
> Exactly, using withCredentials and actually the credentials-binding plugin.
> See > 
> https://github.com/jenkinsci/pipeline-examples/blob/d4440da021433815aedf287f0c69493a0b5b99ef/pipeline-examples/push-git-repo/pushGitRepo.Groovy#L8-L11>
>   for an example
> 
> 
> 2017-06-22 18:57 GMT+02:00 Slide > <> slide.o@gmail.com> >> :
> > You could use the credentials steps to retrieve the username/password and 
> > keep it secure. I think it's withCredentials. I would check into that.> > 

> > On Thu, Jun 22, 2017, 08:00 Thiago Carvalho Davila <> > 
> > thiago.dav...@serpro.gov.br> > > wrote:
> > > I've thought about that, but I would need an input step to get the user 
> > > and password. And I don't know how I could get the password without 
> > > displaying it on the pipeline log.
> > > 
> > > 
> > > Em 22/06/2017 11:34:13, Slide escreveu:
> > > > You could write a shell script 
> > > > 
> > > > On Thu, Jun 22, 2017 at 4:23 AM Thiago Carvalho Davila <> > > > 
> > > > thiago.dav...@serpro.gov.br> > > > > wrote:
> > > > > Any workaround or plugin that does FTP transfer in Jenkins Pipeline?
> > > > > 
> > > > > 
> > > > > Em 21/06/2017 16:24:50, Slide escreveu:
> > > > > > I know for sure that the Publish Over family of plugins don't 
> > > > > > support pipeline, they need to have some work done to support it.
> > > > > > 
> > > > > > On Wed, Jun 21, 2017 at 11:26 AM Thiago Carvalho Davila <> > > > > 
> > > > > > > thiago.dav...@serpro.gov.br> > > > > > > wrote:
> > > > > > > Hello,
> > > > > > > 
> > > > > > > I've been using this Publish Over FTP plugin for some time (> > > 
> > > > > > > > > > > https://github.com/jenkinsci/> > > > > > > 
> > > > > > > publish-over-ftp-plugin> > > > > > > ​). And I want to know if 
> > > > > > > there is compatibility to doing that using jenkins pipeline for a 
> > > > > > > declarative pipeline or does it has some other plugin with that 
> > > > > > > feature.
> > > > > > > 
> > > > > > > Thanks in advance,
> > > > > > > 
> > > > > > > Thiago
> > > > > > > 
-
> > > > > > > 
> > > > > > > 
> > > > > > > 
"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa 
pública federal regida pelo disposto na Lei Federal nº 5.615, é enviada 
exclusivamente a seu destinatário e pode conter informações confidenciais, 
protegidas por sigilo profissional. Sua utilização desautorizada é ilegal e 
sujeita o infrator às penas da lei. Se você a recebeu indevidamente, queira, 
por gentileza, reenviá-la ao emitente, esclarecendo o equívoco."
> > > > > > > 
> > > > > > > 
"This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a 
government company established under Brazilian law (5.615/70) -- is directed 
exclusively to its addressee and may contain confidential data, protected under 
professional secrecy rules. Its unauthorized use is illegal and may subject the 
transgressor to the law's penalties. If you're not the addressee, please send 
it back, elucidating the failure."
> > > > > > > 

> > > > > > > 

-- 
> > > > > > > 
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+unsubscribe@> > > > > > > googlegroups.com> > 
> > > > > .
> > > > > > > 
To view this discussion on the web visit > > > > > > > 
https://groups.google.com/d/> > > > > > > msgid/jenkinsci-users/> > > > > > > 
e4f66e4d15b0018c595ccaf64f> > > > > > > 9d27f5dc90%40serpro.gov.br> > > > > 
> > .
> > > > > > > 
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+unsubscribe@> > > > > > googlegroups.com> > > > 
> > .

> > > > > > > > > > > 
To view this discussion on the web visit > > > > > > 
https://groups.google.com/d/> > > > > > msgid/jenkinsci-users/> > > > > > 
CAPiUgVeOw8DbAqsinq_P_gYSMgg%> > > > > > 2B5RPqbHfkqisKuVqB4e8DZA%> > > > > > 
40mail.gmail.com> > > > > > .
> > > > > 
> > > > > > 
For more options, visit > > > > > > https://groups.google.com/d/> > > > > > 
optout> > > > > > .

> > > > > > > > > > 
> > > > > 
-
> > > > > 
> > > > > 
> > > > > 
"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa 
pública federal regida pelo disposto na Lei Federal nº

Re: vSphere Cloud Plugin - does it work ?

2017-06-27 Thread P
It looks like VSphere Cloud plugin is not very widely used 
So how do you guys use jenkins slaves on VMware ? Do you use existing VMs ?
I am a bit surprised nobody is creating dynamically VMs for Jenskins ...

Best regards
P.


On Tuesday, June 20, 2017 at 12:34:19 PM UTC+1, P wrote:
>
> Hello all, 
>
> I am trying to use vSphere Cloud Plugin to create new VM for some test 
> deployment. 
> Unfortunatelly it doesn't work and I don't really know why. Below is the 
> error message I get when I press "Check Data" button 
> while defining "vSphere Build Step": 
> https://gist.github.com/anonymous/b355bed14171f8afa066dd18e8191179 
> I also include the configuration I use. 
>
> Can anybody have a look and tell me why it is failing ? 
> Kind regards 
> P. 
>
>
>

-- 
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/7a37767a-285d-4b18-8ee6-2ac684a48e11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.