Re: Publish HTML page at the end of the job.

2018-03-15 Thread chicago
An easy thing to do would be to create and rsync a uuid.html to an existing web 
server to which Jenkins has access to. 

Downside is you'd need yet another server. Thoughts? 

-- 
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/7F4BC973-90C6-4400-A406-9E5D8C773442%40airmail.cc.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[Even:Jenkins World 2018] CFP Update

2018-03-15 Thread Alyssa Tong
Hello,

A few updates to Jenkins World 2018:

   - Jenkins World SF CFP
    has been extended
   to April 1, 2018
   - Jenkins World EU CFP
    has been extended
   to April 15, 2018
   - Jenkins World EU  will be
   located in Nice, France on October 22-25, 2018

The CFP webpage  will
be updated (soon) with this new information.

BR,
alyssa

-- 
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/CAC9wNazYpXJa%2BED-1i11vOTMSB3_cj%2B5t3npKktoq97cyGBFTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Publish HTML page at the end of the job.

2018-03-15 Thread c . alex . roeber
I have a job that launched by a URL link in an email.
  Use case is a job that will start, stop or pause the next build step.
When the link is used it take the user to the page starts the job, when the 
job runs and finishes it is just a blank page.
I would like to have the job end with a success page off the build URL link.

Any thoughts?

-- 
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/5efea9a8-1fe2-4441-8eca-b37a0d53b7d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Serialization error moving @NonCPS method from pipeline script to shared library

2018-03-15 Thread David Karr
Thanks for the update.  I don't even remember the specific problem I
had, but my shared library is working fine, so I must have figured it
out. :)

On Thu, Mar 15, 2018 at 1:24 PM, Martín Pianello
 wrote:
> Hi David,
>
>
> A year later, you may have solved the issue or switched to a different
> solution altogether. Anyway, I stumbled across the same issue and coudn't
> find a definitive solution.
>
> So, after some trial & error, I wanted to post how I solved this.
>
> I followed the project structure proposed in
> https://github.com/jenkinsci/workflow-cps-plugin/blob/master/README.md
> So, the code in "vars/myClass.groovy" is just glue code calling whatever
> classes there is in "src/groovy" witch implements the real logic.
> Also, according
> https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/17
> I added the necessary @NonCPS annotations above the methods in classes
> located under src/, not in var/ (didn't work)
>
>
>
>
> El lunes, 6 de febrero de 2017, 14:23:18 (UTC-3), David Karr escribió:
>>
>> I'm trying to move duplicated methods in several pipeline scripts to a
>> shared library.  My first attempt, moving an enum type, worked fine.  My
>> next test is moving a method annotated with "@NonCPS".  I noticed in the doc
>> about writing shared libraries
>> (https://jenkins.io/doc/book/pipeline/shared-libraries/), it had the
>> following statement:
>>
>>> The Groovy source files in these directories get the same “CPS
>>> transformation” as in Scripted Pipeline.
>>
>>
>> I have no idea what that means, but I suppose it might have some relevant
>> to my problem.
>>
>> The method I'm trying to move is simply this:
>> @NonCPS
>> def computeCauseData() {
>> def result= ""
>> def causeActions =
>> currentBuild.rawBuild.getAction(hudson.model.CauseAction)
>> for (action in causeActions) {
>> println "action[${action}] displayName[${action.displayName}]"
>> for (cause in action.causes) {
>> println "cause[${cause}]
>> shortDescription[${cause.shortDescription}]"
>> result= "${cause.shortDescription}."
>> if (cause instanceof Cause.LegacyCodeCause) {
>> }
>> else if (cause instanceof TimerTrigger.TimerTriggerCause) {
>> }
>> else if (cause instanceof Cause.RemoteCause) {
>> Cause.RemoteCauseremoteCause= (Cause.RemoteCause)
>> cause
>> result= "${cause.shortDescription}:
>> Addr[${remoteCause.addr}] Note[${remoteCause.note}]."
>> }
>> else if (cause instanceof Cause.UserIdCause) {
>> }
>> else if (cause instanceof SCMTrigger.SCMTriggerCause) {
>> SCMTrigger.SCMTriggerCausescmTriggerCause=
>> (SCMTrigger.SCMTriggerCause) cause
>> println "scmTriggerCause[${scmTriggerCause}]"
>> }
>> else if (cause instanceof GitStatus.CommitHookCause) {
>> GitStatus.CommitHookCausecommitHookCause=
>> (GitStatus.CommitHookCause) cause
>> Stringsha1= commitHookCause.sha1
>> println "sha1[${sha1}]"
>> }
>> else {
>>
>> }
>> }
>> }
>>
>> return result
>> }
>>
>> This works fine in the pipeline script. When I moved it to my shared
>> library (in "vars/computeCauseData.groovy") and commented out the definition
>> in the pipeline script, and then ran my test, I got the following:
>>
>> java.io.NotSerializableException:
>> org.codehaus.groovy.control.ErrorCollector
>> at
>> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
>> at
>> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
>> at
>> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
>> at
>> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
>> at
>> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
>> at
>> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
>>
>>
>> In the past, I've avoid serialization errors by nulling out variables
>> before they cross a scope. I tried modifying this method, simply nulling out
>> everything but "result" right after their last use, and that made no
>> difference.  Same error.
>>
>>
> --
> 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/9269dc02-0783-4101-8739-1e3f6e9edd15%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received 

Re: Serialization error moving @NonCPS method from pipeline script to shared library

2018-03-15 Thread Martín Pianello
Hi David,


A year later, you may have solved the issue or switched to a different 
solution altogether. Anyway, I stumbled across the same issue and coudn't 
find a definitive solution.

So, after some trial & error, I wanted to post how I solved this.

I followed the project structure proposed 
in https://github.com/jenkinsci/workflow-cps-plugin/blob/master/README.md
So, the code in "vars/myClass.groovy" is just glue code calling whatever 
classes there is in "src/groovy" witch implements the real logic.
Also, according 
https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/17
 I 
added the necessary @NonCPS annotations above the methods in classes 
located under src/, not in var/ (didn't work)




El lunes, 6 de febrero de 2017, 14:23:18 (UTC-3), David Karr escribió:
>
> I'm trying to move duplicated methods in several pipeline scripts to a 
> shared library.  My first attempt, moving an enum type, worked fine.  My 
> next test is moving a method annotated with "@NonCPS".  I noticed in the 
> doc about writing shared libraries (
> https://jenkins.io/doc/book/pipeline/shared-libraries/), it had the 
> following statement:
>
> The Groovy source files in these directories get the same “CPS 
>> transformation” as in Scripted Pipeline.
>
>
> I have no idea what that means, but I suppose it might have some relevant 
> to my problem.
>
> The method I'm trying to move is simply this:
> @NonCPS
> def computeCauseData() {
> def result= ""
> def causeActions = currentBuild.rawBuild.getAction(hudson.model.
> CauseAction)
> for (action in causeActions) {
> println "action[${action}] displayName[${action.displayName}]"
> for (cause in action.causes) {
> println "cause[${cause}] 
> shortDescription[${cause.shortDescription}]"
> result= "${cause.shortDescription}."
> if (cause instanceof Cause.LegacyCodeCause) {
> }
> else if (cause instanceof TimerTrigger.TimerTriggerCause) {
> }
> else if (cause instanceof Cause.RemoteCause) {
> Cause.RemoteCauseremoteCause= (Cause.RemoteCause) 
> cause
> result= "${cause.shortDescription}: 
> Addr[${remoteCause.addr}] Note[${remoteCause.note}]."
> }
> else if (cause instanceof Cause.UserIdCause) {
> }
> else if (cause instanceof SCMTrigger.SCMTriggerCause) {
> SCMTrigger.SCMTriggerCausescmTriggerCause= (
> SCMTrigger.SCMTriggerCause) cause
> println "scmTriggerCause[${scmTriggerCause}]"
> }
> else if (cause instanceof GitStatus.CommitHookCause) {
> GitStatus.CommitHookCausecommitHookCause= (
> GitStatus.CommitHookCause) cause
> Stringsha1= commitHookCause.sha1
> println "sha1[${sha1}]"
> }
> else {
> 
> }
> }
> }
> 
> return result
> }
>
> This works fine in the pipeline script. When I moved it to my shared 
> library (in "vars/computeCauseData.groovy") and commented out the 
> definition in the pipeline script, and then ran my test, I got the 
> following:
>
> java.io.NotSerializableException: org.codehaus.groovy.control.ErrorCollector
> at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
> at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
> at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
> at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
> at 
> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
> at 
> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
>
>
> In the past, I've avoid serialization errors by nulling out variables 
> before they cross a scope. I tried modifying this method, simply nulling 
> out everything but "result" right after their last use, and that made no 
> difference.  Same error.
>
>
>

-- 
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/9269dc02-0783-4101-8739-1e3f6e9edd15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


docker image retention (built via dockerfiles)

2018-03-15 Thread Lukas Winkler
Hi,

I want to setup a jenkinsfile building a git project and running tests in 
various environments, preferably docker (multiple gcc versions, clang, 
...). My approach was to simply setup agents and connect them via ssh and 
install docker on them. The jenkinsfile will have a parallel section 
listing all the environments (from differnt dockerfiles) and what commands 
to run in them to run the tests). The build images would be cached and 
reruns would be decently fast and I would probably be happy with the 
results.

However now I am looking at the possibility of space issues with all those 
docker images beeing generated. The tags for those images are currently 
based on the SHA1 hash of the dockerfile and as I understand it will be 
based on a hash out of the dockerfile and the full project name in the 
future. I could simply delete (docker system prune -a) images periodically, 
but that leaves a sour taste in my mouth due to it forcing rebuilds of 
actual in use containers on one hand and beeing noticable in build logs 
tempering with build statistics.

I know that jenkins supports build discarder properties. Can something be 
patched in that would extend those properties to docker images beeing build?
Or maybe someone has an idea on how I can modify my setup to not run into 
those issues?

BR
Lukas

-- 
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/34fe238c-48fd-4aa0-8637-f265195369d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin cloud not found error

2018-03-15 Thread Carlos Sanchez
You need to use "add cloud" in jenkins configuration

On Wed, Mar 14, 2018, 06:38 Prasanna Ranganathan 
wrote:

> Hi,
>
> I was trying the kubernetes plugin. I installed and configured the
> kubernetes setup connection test was successfull.
> and tried the below code.
>
> def label = "mypod-${UUID.randomUUID().toString()}"echo "Label:" +
> labelpodTemplate(label: label) { node(label) { stage('Run shell') { sh 'echo
> hello world' } }}
>
> But still, i do get this error.
>
> [Pipeline] podTemplate[Pipeline] // podTemplate[Pipeline] End of 
> PipelineERROR: Cloud does not exist: kubernetes
> Finished: FAILURE
>
>
>
> even if i give cloud variable as something still it says cloud does not
> exist
>
> --
> 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/998c5cbc-3de7-4131-b77f-fdd949a71477%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/CALHFn6P2X-rofsHdOWLj9zYXSO5Zg1oUMkP9JTCuCpLu8dCciA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email-ext plugin and Pre-send Script variables

2018-03-15 Thread danny
Victor,

I thank you for the heads up, this actually worked!

On Thursday, March 15, 2018 at 2:06:52 PM UTC+2, Victor Martinez wrote:
>
> Have you tried with double quote multistring and also the $ variable?
>
> node {
> FROM = 'AAA '
> emailext(
> to: "m...@email.com",
> presendScript: """msg.setHeader("From", ${FROM});""",
> subject: "test",
> mimeType: 'text/html',
> body: "content"
> )
> }
>
>

-- 
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/a60e83fb-1497-4d3c-aa48-57c7209901a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email-ext plugin and Pre-send Script variables

2018-03-15 Thread Victor Martinez
Have you tried with double quote multistring and also the $ variable?

node {
FROM = 'AAA '
emailext(
to: "m...@email.com",
presendScript: """msg.setHeader("From", ${FROM});""",
subject: "test",
mimeType: 'text/html',
body: "content"
)
}

-- 
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/fadee596-83ba-44f4-a2a9-181ce983e56c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Blue Ocean doesn't add GitHub webhooks when creating a new pipeline

2018-03-15 Thread Sven Grunewaldt
When I create a new Pipeline with Blue Ocean via GitHub I expected webhooks 
to appear in the repository, but they only get created when I manually 
click on "Re-register hooks for all jobs" in the system configuration. Some 
issue comments stated that the pipeline needs to run once, then the 
webhooks should be created - doesn't work for me though.

The GitHub plugin access token has these permissions: admin:repo_hook, repo
The user token set in Blue Ocean has these permissions: admin:repo_hook, 
repo, user:email (I did try adding virtually all permissions here to make 
sure this isn't the problem)

As far as I can see Jenkins simply doesn't create the webhooks by itself… I 
can't find anything specific about this in the documentation. Do I need to 
do something special for the Pipeline to create the webhooks directly?

This is the Jenkinsfile I'm experimenting with at the moment:
node {
  def scmVars = checkout scm
  def commitHash = scmVars.GIT_COMMIT

  def repository = "foo/bar"
  def tag = "${commitHash}"
  def repositoryAndTag = "${repository}:${tag}"

  stage("Build container") {
image = docker.build(repositoryAndTag)
  }

  stage("Test") {
sh """
  docker run --rm ${repositoryAndTag} \
php -v
"""
  }

  stage('Deploy') {
if (currentBuild.result == null || currentBuild.result == 'SUCCESS') {
  if (env.CHANGE_ID != null) {
echo "PR build, skipping deploy"
  } else if (env.BRANCH_NAME == "master") {
echo "Would be pushing to docker hub here"
  } else {
echo "No deploy, unknown branch ${env.BRANCH_NAME}"
  }
}
  }
}

-- 
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/e10bb107-70ea-42ac-a861-41e13f07fe0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.