Jenkins kubernetes Client

2017-03-29 Thread Sudha Subramanian
Hi,

I'm trying to run Jenkins in kubernetes with 'kubernetes-client' plugin for 
dynamic slaves. I get the following error:

Caused by: java.text.ParseException: failed to load settings from 
> jar:file:/var/jenkins_home/war/WEB-INF/lib/groovy-all-2.4.7.jar!/groovy/grape/defaultGrapeConfig.xml:
>  
> impossible to add configured child for ivy on class 
> org.apache.ivy.plugins.resolver.FileSystemResolver: ivy pattern must be 
> absolute: ?/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml
>

The same Jenkins image runs on my mac without any issues. Has anyone 
encountered this issue running Jenkins in Kubernetes with the client plugin 
enabled?

Thanks,
Sudha

-- 
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/23cb3e7e-b356-4255-8f05-0696964cc7ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins + PowerShell Script that takes screenshot of a remote folder

2017-03-29 Thread VikS
Got it and I have setup a Jenkins slave which is not running as service. I 
have tried multiple modification to my script but the screenshot does not 
work. In summary, this is what I'm trying to do with powerrshell: Jenkins 
Slave -> launch the remote path of the folder that needs to be screen 
captured -> take a screenshot and save it

Script says that the path is launched successfully but for screenshot, this 
will be the error:








*Exception calling "CopyFromScreen" with "5" argument(s): "The handle is 
invalid"At C:\WINDOWS\TEMP\hudson1670262990811364138.ps1:30 char:5+ 
$graphic.CopyFromScreen($Left, $Top, 0, 0, $bitmap.Size)+ 
+ 
CategoryInfo  : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : Win32Exception*Does a screen capture of a remote 
path still be possible on a slave without users logged on?

On Monday, March 27, 2017 at 9:32:25 PM UTC+8, slide wrote:
>
> Windows services can't interact with the desktop. This feature went away 
> in Vista. You would need to run the agent as a non-service for the 
> screenshot to work.
>
> On Sun, Mar 26, 2017, 22:37 VikS  wrote:
>
>> We have a build which requires us to replace files to a newer version on 
>> remote computers and the requirement is the script needs to take screenshot 
>> of the folder for validation.
>> We have built our ps script and it does what is needed when executed 
>> outisde of Jenkins but not when scheduled with Jenkins, here is the 
>> screenshot portion of the script:
>> function ScreenshotFolder 
>> {
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *# Get the list of servers$servers = Get-Content 
>> "C:\tmp\script\updated\computers.txt"  # Foreach loop to go to each server 
>> and take the screenshot  foreach ($server in $servers)  {# Invoke 
>> the path of Application$FolderWindows = Start 
>> "\\$server\C$\Temp\Application" -WindowStyle Maximized# Pause the 
>> script for 2 seconds so that the invoked path Windows will stay for 2 
>> seconds before screencaptureStart-Sleep -s 2# Provide the unique 
>> name for the .bmp file$File = join-path -path 
>> "C:\tmp\script\updated\Logs" -childpath $($server + "-screenshot" + 
>> ".bmp")Add-Type -AssemblyName System.Windows.FormsAdd-type 
>> -AssemblyName System.Drawing# Gather Screen resolution 
>> information$Screen = 
>> [System.Windows.Forms.SystemInformation]::VirtualScreen$Width = 
>> $Screen.Width$Height = $Screen.Height$Left = $Screen.Left$Top = 
>> $Screen.Top# Create bitmap using the top-left and bottom-right 
>> bounds$bitmap = New-Object System.Drawing.Bitmap $Width, $Height
>> # Create Graphics object$graphic = 
>> [System.Drawing.Graphics]::FromImage($bitmap)# Capture screen
>> $graphic.CopyFromScreen($Left, $Top, 0, 0, $bitmap.Size)# Save to 
>> file$bitmap.Save($File) Write-Output "Screenshot saved to:"
>> Write-Output $File# Close each folder windows so that it would capture 
>> each windows at a time$CloseWindows = (New-Object -comObject 
>> Shell.Application).Windows() |? { $_.FullName -ne $null} | ? { 
>> $_.FullName.toLower().Endswith('\explorer.exe') } $CloseWindows | % {  
>> $_.Quit()}}}*
>>
>> Jenkins service us configured to be running using service account which 
>> has access to the remote servers. Console output:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Start-Process : This command cannot be run due to the error: Server 
>> execution failed.At 
>> C:\Users\ctoCITRIX4win09\AppData\Local\Temp\hudson7511677238111411019.ps1:385
>>  
>> char:22+ $FolderWindows = Start "\\$server\C$\Temp\Application" 
>> -WindowStyle Maximized+  
>> ~~~+ 
>> CategoryInfo  : InvalidOperation: (:) [Start-Process], InvalidOp
>> erationException+ FullyQualifiedErrorId : 
>> InvalidOperationException,Microsoft.PowerShell.C
>> ommands.StartProcessCommand*Any suggestions to achieve this screenshot 
>> function using script on Jenkins? We're ok to explore other tools as well.
>>
>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/d2a0f96b-c413-49ef-b588-41693407fb35%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the 

How to upload NPM to Nexus from Jenkins

2017-03-29 Thread Jayaswaroop Balla
Hi there,

I have my html, css and js in my git repo. My task is to upload this as npm 
package to Nexus repo using Jenkins. I tried Nexus Artifact Uploader and 
Nexus Repository Manager Publisher plugins in Jenkins. But I was not 
successful.

I'm new to Nexus and NPM. Can anybody help me on this?


JayB

-- 
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/6a5ed418-6114-434e-a7dd-520271c0b421%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Wildfly Plugin with Wildfly 9?

2017-03-29 Thread Steven Landry
When I removed the spaces from my Jenkins job name I was able to deploy 
successfully.

-- 
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/a8a915c9-356d-4ed5-bbd8-b5d115ccb9e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I mount a temporary volume associated with the workspace in a docker container with Declarative Pipeline?

2017-03-29 Thread Miyata Jumpei
I also posted to stackoverflow.
http://stackoverflow.com/questions/43106896/jenkins-declarative-pipeline-how-can-i-mount-a-temporary-volume-associated-with

On Wednesday, March 29, 2017 at 6:47:07 PM UTC+9, Miyata Jumpei wrote:
>
> I would like to mount a temporary volume associated with the workspace in 
> a docker container for gradle caching. With Scripted Pipeline, It can be 
> written like the following.
>
> -
> docker.image('my-gradle').inside("-v ${pwd(tmp: 
> true)}:/home/jenkins/.gradle") {
> sh './gradlew test'
> }
> -
>
> But with Declarative Pipeline, the following causes an error.
>
> -
> agent {
> dockerfile {
> dir 'path/to/dockerfileDir'
> label 'docker-nodes'
> args "-v ${pwd(tmp: true)}:/home/jenkins/.gradle"
> }
> }
> -
>
> The console log is like the following.
>
> -
> $ docker run -t -d -u 1000:1000 -v 
> org.jenkinsci.plugins.pipeline.modeldefinition.ClosureModelTranslator@34a240ba:/home/jenkins/.gradle
>  
> ...
>
> java.io.IOException: Failed to run image 
> 'e3747815ce1fc12012be2114aa26b6b1ec8a0492'. Error: docker: Error response 
> from daemon: create 
> org.jenkinsci.plugins.pipeline.modeldefinition.ClosureModelTranslator@34a240ba:
>  
> "org.jenkinsci.plugins.pipeline.modeldefinition.ClosureModelTranslator@34a240ba"
>  
> includes invalid characters for a local volume name, only 
> "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host 
> directory, use absolute path.
> See 'docker run --help'.
> at 
> org.jenkinsci.plugins.docker.workflow.client.DockerClient.run(DockerClient.java:127)
> at 
> org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:178)
> at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
> at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
> at 
> org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
> at 
> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
> at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
> at 
> com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18)
> at 
> org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:128)
> at 
> org.jenkinsci.plugins.docker.workflow.Docker.node(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:63)
> at 
> org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:116)
> at 
> org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.DockerPipelineFromDockerfileScript.runImage(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy:64)
> at 
> org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.AbstractDockerPipelineScript.configureRegistry(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy:68)
> at 
> org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.AbstractDockerPipelineScript.run(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy:54)
> at 
> org.jenkinsci.plugins.pipeline.modeldefinition.agent.CheckoutScript.checkoutAndRun(jar:file:/var/jenkins_home/plugins/pipeline-model-extensions/WEB-INF/lib/pipeline-model-extensions.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/CheckoutScript.groovy:57)
> at 
> org.jenkinsci.plugins.pipeline.modeldefinition.agent.CheckoutScript.doCheckout(jar:file:/var/jenkins_home/plugins/pipeline-model-extensions/WEB-INF/lib/pipeline-model-extensions.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/CheckoutScript.groovy:40)
> at 
> org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.LabelScript.run(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy:44)
> at ___cps.transform___(Native Method)
> at 
> 

Re: Error in build Grails

2017-03-29 Thread Richard Bywater
Does this work locally as it kind of looks like not a Jenkins issue but a
Grails one.

Looks like a problem when processing the style.css file - I'm assuming if
you run with --stacktrace like it says you'll find out more.

Richard.

On Thu, 30 Mar 2017 at 12:53 Роман Ловаков  wrote:

> what am I doing wrong? In the Global Tool Configuration, I installed the
> local Grails 3.4.8, Gradle 3.4, JDK 8, Groovy 2.4.10. In the Grails project
> settings in the Build section, I chose Build with Grails, the target field
> I wrote war. i have next settings and next structure of project on
> bitbucet
> But I have error
> [EnvInject] - Loading node environment variables.
> Building in workspace /var/lib/jenkins/jobs/xxx/workspace
>  > git rev-parse --is-inside-work-tree # timeout=10
> Fetching changes from the remote Git repository
>  > git config remote.origin.url https://x...@bitbucket.org/xxx/xxx.git #
> timeout=10
> Fetching upstream changes from https://x...@bitbucket.org/xxx/xxx.git
>  > git --version # timeout=10
> using GIT_ASKPASS to set credentials
>  > git fetch --tags --progress https://x...@bitbucket.org/xxx/xxx.git
> +refs/heads/*:refs/remotes/origin/*
>  > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
>  > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
> Checking out Revision 311cc87e3bda4c55dbd044edbace1f66bdc56a7b
> (refs/remotes/origin/master)
>  > git config core.sparsecheckout # timeout=10
>  > git checkout -f 311cc87e3bda4c55dbd044edbace1f66bdc56a7b
>  > git rev-list 311cc87e3bda4c55dbd044edbace1f66bdc56a7b # timeout=10
> [workspace] $ /usr/lib/grails/3.2.8/bin/grails
> -Dgrails.work.dir=/var/lib/jenkins/jobs/xxx/workspace//target war
> --non-interactive --plain-output
> :compileJava NO-SOURCE
> :compileGroovy UP-TO-DATE
> :findMainClass
> :assetCompile
> Processing File 1 of 30 - jstree/default-dark/32px.png
> - Writing File
> Processing File 2 of 30 - jstree/default-dark/40px.png
> - Writing File
> Processing File 3 of 30 - jstree/default-dark/throbber.gif
> - Writing File
> Processing File 4 of 30 - jstree/default/32px.png
> - Writing File
> Processing File 5 of 30 - jstree/default/40px.png
> - Writing File
> Processing File 6 of 30 - jstree/default/throbber.gif
> - Writing File
> Processing File 7 of 30 - glyphicons-halflings-regular.ttf
> - Writing File
> Processing File 8 of 30 - glyphicons-halflings-regular.svg
> - Writing File
> Processing File 9 of 30 - glyphicons-halflings-regular.woff2
> - Writing File
> Processing File 10 of 30 - glyphicons-halflings-regular.woff
> - Writing File
> Processing File 11 of 30 - glyphicons-halflings-regular.eot
> - Writing File
> Processing File 12 of 30 - css/bootstrap/bootstrap.min.css
> - Writing File
> Processing File 13 of 30 - css/bootstrap/bootstrap.css
> - Minifying File
> - Writing File
> Processing File 14 of 30 - css/jstree/default-dark/style.min.css
> - Writing File
> Processing File 15 of 30 - css/jstree/default-dark/style.css
> Error |
> Command [war] error: Could not execute build using Gradle distribution '
> https://services.gradle.org/distributions/gradle-3.4-all.zip'. (Use
> --stacktrace to see the full trace)
> Build step 'Build With Grails' marked build as failure
> Collecting metadata...
> Metadata collection done.
> Finished: FAILURE
>
> What i doing wrong?
>
> --
> 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/e73423f2-9b84-45f0-907e-416f4e21e15b%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/CAMui9445R4Nhwp48-T8-UTefHmr2yVPjCx%3D%2B5W58bughVUU7Yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANNOUNCE] Jenkins Upgrades to Java 8

2017-03-29 Thread Baptiste Mathus
Quick reminder. This is upcoming.

The first weekly requiring Java 8 to run is expected very soon, in April is
the plan.

Cheers

Le 17 janv. 2017 2:48 PM, "Baptiste Mathus"  a écrit :

Hello,

Please read the announcement on https://jenkins.io/blog/
2017/01/17/Jenkins-is-upgrading-to-Java-8/, especially if you are still
running Jenkins on Java 7 VM.

Thank you

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


Jenkins Wildfly Plugin with Wildfly 9?

2017-03-29 Thread Steven Landry
Has anyone had any luck using the Jenkins Wildfly plugin to deploy to 
Wildfly 9?  I haven't been able to get it to work so I thought I'd ask here 
before trying another route.

Thank you!

-- 
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/8ba79246-9253-41fa-8051-9ac8d29632e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issues with SSH Host Key Verification

2017-03-29 Thread Steven R. Loomis
Thank you! I added this workaround 
to https://issues.jenkins-ci.org/browse/JENKINS-42959

On Friday, March 24, 2017 at 1:31:34 AM UTC-7, Harald Wellmann wrote:
>
> Yes, I can ssh both ways. The problem seems to be that the SSH lib used by 
> Jenkins does not support newer ciphers like ecdsa-sha2-nistp256. 
>
> After deleting the known_hosts entry and creating a new one via
>
> ssh -o HostKeyAlgorithms=ssh-rsa slave2.example.com
>
> Jenkins no longer complains. 
>
> I'm not a security expert, but it seems that I'm now using a less robust 
> cipher than before, so this is more of a workaround than a solution.
>
> Regards,
> Harald
>
> 2017-03-23 21:24 GMT+01:00 Harriet Severino  >:
>
>> Can you ssh from master to slave and back as the jenkins user? If not 
>> look at you ssh setup. SSH is picky about the permissions of all the files 
>> under ~/.ssh.
>>
>>
>>
>> On Thursday, March 23, 2017 at 12:45:33 PM UTC-4, Harald Wellmann wrote:
>>>
>>> After upgrading to SSH Slave Plugin 1.15 on Jenkins 2.32.3, I'm getting 
>>> warnings 
>>>
>>> about missing SSH key verification which I'm trying to fix.
>>>
>>>
>>> I've configured Known hosts file verification strategy, I've manually 
>>> ssh'ed 
>>>
>>> from my master to my slave, and I've checked there's an entry in my 
>>>
>>> .ssh/known_hosts on master which looks like
>>>
>>>
>>> slave2.example.com ecdsa-sha2-nistp256 ...v+2Uc0=
>>>
>>>
>>> Despite that, I'm getting the following error when lauching the agent:
>>>
>>>
>>> [03/23/17 13:10:38] [SSH] Opening SSH connection to slave2.example.com:22.
>>> [03/23/17 13:10:38] [SSH] WARNING: No entry currently exists in the Known 
>>> Hosts file for this host. Connections will be denied until this new host 
>>> and its associated key is added to the Known Hosts file.
>>> Key exchange was not finished, connection is closed.
>>> java.io.IOException: There was a problem while connecting to 
>>> slave2.example.com:22
>>> at com.trilead.ssh2.Connection.connect(Connection.java:818)
>>> at com.trilead.ssh2.Connection.connect(Connection.java:687)
>>> at com.trilead.ssh2.Connection.connect(Connection.java:601)
>>> at 
>>> hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1265)
>>> at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:790)
>>> at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:785)
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>> at java.lang.Thread.run(Thread.java:745)
>>> Caused by: java.io.IOException: Key exchange was not finished, connection 
>>> is closed.
>>> at 
>>> com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:93)
>>> at 
>>> com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:230)
>>> at com.trilead.ssh2.Connection.connect(Connection.java:770)
>>> ... 9 more
>>> Caused by: java.io.IOException: The server hostkey was not accepted by the 
>>> verifier callback
>>> at 
>>> com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:535)
>>> at 
>>> com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:777)
>>> at 
>>> com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:489)
>>> ... 1 more
>>> [03/23/17 13:10:38] Launch failed - cleaning up connection
>>> [03/23/17 13:10:38] [SSH] Connection closed.
>>>
>>>
>>>
>>>
>>> Any ideas what's wrong here?
>>>
>>> Thanks,
>>> Harald
>>>
>>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/7006ab93-7ca4-4063-baf6-7c844be60165%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/bcb3b1f9-b12f-4faa-b16f-e1fd3bacc4cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I stop a Pipeline after unit tests?

2017-03-29 Thread Michael Holley
Thank you Abishek, that is what I needed. I didn’t know there was a env
variable with the branch name. I added if blocks around various stages so
they don’t run unless they are ‘master’ just like Richard suggested. Thanks!


On March 29, 2017 at 9:24:34 AM, Abishek Manoharan (mailabis...@gmail.com)
wrote:

If you are using the Github Branch Source plugin, then you should find the
branch name in environment variables in the job. You can check it in your
Jenkinsfile pipeline script and make decisions. Something like,

if (env.BRANCH_NAME == "master") {
// Deploy to prod or staging.
}

On Wednesday, 29 March 2017 22:37:21 UTC+8, Michael Holley wrote:
>
> I agree I need to use logic to stop or allow a stage, but I don’t know how
> to target the git branch or what options I have for developing that logic
> so I can stop the chain if the branch being built isn’t the master branch.
>
>
> On March 29, 2017 at 6:06:14 AM, Richard Ginga (rgi...@disruptorbeam.com)
> wrote:
>
> I do something similar in that I have conditional stages. Simply put logic
> "around" the stages you do or do not want to run.
> In order to keep the full list of stages in the job's dashboard, I
> actually put the logic "within" the stage that says "Skipping stage
> blablabla". I don't use Git so I don't know what information you need/have
> to make this decision.
>
> On Tue, Mar 28, 2017 at 6:32 PM, Michael Holley 
> wrote:
>
>> I've been searching all day today and have yet to find something that
>> looks like it applies. I'm sorry if this answer has been hashed before and
>> I just asked the all mighty Google the wrong questions.
>>
>> Here is the workflow I'm trying to bring over from my freestyle projects
>> as Pipelines (the new Pipeline project is set up as a Multi-branch project
>> with a Jenkinsfile).
>>
>> 1. A dev branches off of master and starts work on a feature. Whenever he
>> pushes new code to GitHub I want Jenkins to set up the workspace, build the
>> code, run tests, and then stop.
>> 2. Once he get's his code to build clean he creates a PR.
>> 3. Jenkins sees the PR and builds that, but once again, should stop after
>> tests pass.
>> 4. The success status, after tests, is pushed back to GitHub which then
>> enables the PR to be merged with the master branch.
>> 5. Now that the master branch has been updated, Jenkins once again sets
>> up the workspace, builds the code, runs test, but now deploys to staging,
>> waits for approval, then pushes to prod.
>>
>> Another way to ask the question, how do I put logic into a Pipeline to
>> only run certain stages depending on what branch/PR is being built?
>>
>> As of right now, I have a single Jenkins file with the checkout, build,
>> test, and deploy stages in it, and every time a branch is updated, a PR
>> created, and with a merge to master, the code is able to be deployed. I
>> don't want the code to be able to be deployed until after it's merged to
>> master. Any thoughts on how to make this happen? 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-use...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/jenkinsci-users/2615c315-9686-4f70-975c-
>> 364f065000f2%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Dick Ginga
> Build Engineer
> rgi...@disruptorbeam.com
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/7-tK3JTtFCU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/CAL3PpaVGPZykSV%2BQv_UChw4NiXx3-rMf1Rfe%2BSn5X-
> XUcEizSw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
You received this message because you are subscribed to a topic in the
Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jenkinsci-users/7-tK3JTtFCU/unsubscribe.
To unsubscribe from this group and all its topics, 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/8160da61-d5cd-4b21-9231-32af586fbadf%40googlegroups.com

Re: How can I stop a Pipeline after unit tests?

2017-03-29 Thread Abishek Manoharan
If you are using the Github Branch Source plugin, then you should find the 
branch name in environment variables in the job. You can check it in your 
Jenkinsfile pipeline script and make decisions. Something like,

if (env.BRANCH_NAME == "master") {
// Deploy to prod or staging.
}

On Wednesday, 29 March 2017 22:37:21 UTC+8, Michael Holley wrote:
>
> I agree I need to use logic to stop or allow a stage, but I don’t know how 
> to target the git branch or what options I have for developing that logic 
> so I can stop the chain if the branch being built isn’t the master branch.
>
>
> On March 29, 2017 at 6:06:14 AM, Richard Ginga (rgi...@disruptorbeam.com 
> ) wrote:
>
> I do something similar in that I have conditional stages. Simply put logic 
> "around" the stages you do or do not want to run.  
> In order to keep the full list of stages in the job's dashboard, I 
> actually put the logic "within" the stage that says "Skipping stage 
> blablabla". I don't use Git so I don't know what information you need/have 
> to make this decision.
>
> On Tue, Mar 28, 2017 at 6:32 PM, Michael Holley  > wrote:
>
>> I've been searching all day today and have yet to find something that 
>> looks like it applies. I'm sorry if this answer has been hashed before and 
>> I just asked the all mighty Google the wrong questions.
>>
>> Here is the workflow I'm trying to bring over from my freestyle projects 
>> as Pipelines (the new Pipeline project is set up as a Multi-branch project 
>> with a Jenkinsfile). 
>>
>> 1. A dev branches off of master and starts work on a feature. Whenever he 
>> pushes new code to GitHub I want Jenkins to set up the workspace, build the 
>> code, run tests, and then stop.
>> 2. Once he get's his code to build clean he creates a PR.
>> 3. Jenkins sees the PR and builds that, but once again, should stop after 
>> tests pass.
>> 4. The success status, after tests, is pushed back to GitHub which then 
>> enables the PR to be merged with the master branch.
>> 5. Now that the master branch has been updated, Jenkins once again sets 
>> up the workspace, builds the code, runs test, but now deploys to staging, 
>> waits for approval, then pushes to prod.
>>
>> Another way to ask the question, how do I put logic into a Pipeline to 
>> only run certain stages depending on what branch/PR is being built?
>>
>> As of right now, I have a single Jenkins file with the checkout, build, 
>> test, and deploy stages in it, and every time a branch is updated, a PR 
>> created, and with a merge to master, the code is able to be deployed. I 
>> don't want the code to be able to be deployed until after it's merged to 
>> master. Any thoughts on how to make this happen? 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/2615c315-9686-4f70-975c-364f065000f2%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Dick Ginga 
> Build Engineer
> rgi...@disruptorbeam.com 
>
> --
> You received this message because you are subscribed to a topic in the 
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jenkinsci-users/7-tK3JTtFCU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> jenkinsci-use...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/CAL3PpaVGPZykSV%2BQv_UChw4NiXx3-rMf1Rfe%2BSn5X-XUcEizSw%40mail.gmail.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/8160da61-d5cd-4b21-9231-32af586fbadf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I stop a Pipeline after unit tests?

2017-03-29 Thread Michael Holley
I agree I need to use logic to stop or allow a stage, but I don’t know how
to target the git branch or what options I have for developing that logic
so I can stop the chain if the branch being built isn’t the master branch.


On March 29, 2017 at 6:06:14 AM, Richard Ginga (rgi...@disruptorbeam.com)
wrote:

I do something similar in that I have conditional stages. Simply put logic
"around" the stages you do or do not want to run.
In order to keep the full list of stages in the job's dashboard, I actually
put the logic "within" the stage that says "Skipping stage blablabla". I
don't use Git so I don't know what information you need/have to make this
decision.

On Tue, Mar 28, 2017 at 6:32 PM, Michael Holley 
wrote:

> I've been searching all day today and have yet to find something that
> looks like it applies. I'm sorry if this answer has been hashed before and
> I just asked the all mighty Google the wrong questions.
>
> Here is the workflow I'm trying to bring over from my freestyle projects
> as Pipelines (the new Pipeline project is set up as a Multi-branch project
> with a Jenkinsfile).
>
> 1. A dev branches off of master and starts work on a feature. Whenever he
> pushes new code to GitHub I want Jenkins to set up the workspace, build the
> code, run tests, and then stop.
> 2. Once he get's his code to build clean he creates a PR.
> 3. Jenkins sees the PR and builds that, but once again, should stop after
> tests pass.
> 4. The success status, after tests, is pushed back to GitHub which then
> enables the PR to be merged with the master branch.
> 5. Now that the master branch has been updated, Jenkins once again sets up
> the workspace, builds the code, runs test, but now deploys to staging,
> waits for approval, then pushes to prod.
>
> Another way to ask the question, how do I put logic into a Pipeline to
> only run certain stages depending on what branch/PR is being built?
>
> As of right now, I have a single Jenkins file with the checkout, build,
> test, and deploy stages in it, and every time a branch is updated, a PR
> created, and with a merge to master, the code is able to be deployed. I
> don't want the code to be able to be deployed until after it's merged to
> master. Any thoughts on how to make this happen? 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/2615c315-9686-4f70-975c-364f065000f2%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



--
Dick Ginga
Build Engineer
rgi...@disruptorbeam.com

--
You received this message because you are subscribed to a topic in the
Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jenkinsci-users/7-tK3JTtFCU/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAL3PpaVGPZykSV%2BQv_UChw4NiXx3-rMf1Rfe%2BSn5X-XUcEizSw%40mail.gmail.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/CAL0jAia9mPhnPUgeXf0n5CUALc%3DqThq7Y572fvekgGM5xhQAGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Move location of build history, separate from config

2017-03-29 Thread Gastro Man
Excellent!
Changing Build Record Root Directory in the system settings was exactly 
what I was hoping for.
I never noticed that was there, assuming the setting has been there all 
along..

My jobs folder is now a very managable size, containing pretty much just 
the config.xml files, next build number, and a few symbolic links.

Thanks!

On Friday, March 10, 2017 at 10:24:05 PM UTC-5, Christopher Orr wrote:
>
> On Thu, 9 Mar 2017, at 22:37, Gastro Man wrote: 
> > Is it possible to configure Jenkins so the jobs' build history is not 
> > contained in the same directory as the config.xml? 
> > 
> > Ideally, I would prefer all the configs to be together in an area 
> > ("job_config" folder)  that I can put in source control, backup, quickly 
> > search and compare, and manage. 
> > 
> > And then the gigabytes of data stored in histories could be in another 
> > location ("job_history" folder) where I don't care about source control, 
> > don't need to include when searching across configs, etc. 
> > Possibly even store this on a separate storage device.. 
> > 
> > I find it frustrating to have the mixing of "control" and "data" inside 
> > every single job subfolder, but I haven't found a way around this so 
> far. 
>
> You could mark the "builds" subdirectories as ignored in source control? 
>
> Or if you go to Manage Jenkins > Configure System and click "Advanced" 
> at the top of the page, you'll be able to alter where build data is 
> stored ("Build Record Root Directory"). 
>
> If you change this to "${JENKINS_HOME}/builds/${ITEM_FULLNAME}", for 
> example, then all of the build data will be stored there. 
>
> At this point, the only thing left in ${JENKINS_HOME}/jobs/ (i.e. 
> ${ITEM_ROOTDIR}) will be the job config.xml, and the metadata about 
> build numbers and last success/failure symlinks etc.. 
>
> Note that changing this value will not automagically migrate all of your 
> existing data to the new location you've specified. 
>
> Regards, 
> Chris 
>

-- 
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/bca0bb0b-5534-4824-ab25-24797c0bb22b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Plugin for delete last month data.

2017-03-29 Thread Sandeep Grandham
Hi..

Is there any plugin is there for to show all  the selected Projects *Build 
Time Trend* graphs in same /single page. help me please about this.

On Wednesday, March 29, 2017 at 2:40:29 PM UTC+5:30, Sandeep Grandham wrote:
>
> Hi,
>
> I am trying to figureout the plugin for delete the old build history, 
> trying to keep only last 30 days data only, and i am trying to delete all 
> the projects from one location.
> EX: In teamcity from root project using clear rules we can clean all the 
> data at a time for all the projects.
>  Same like i need some plugin or solution for Jenkins..
> Please help me some body about this this.
>
> Thanks,
> Sandeep
>

-- 
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/9ecbc8b3-1fe6-4d52-a476-7e897d529c1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: kubernetes-plugin: logging output

2017-03-29 Thread 'Sascha Vujevic' via Jenkins Users
Also the problem with this execution is that

cd "/home/jenkins/workspace/slave-test-npm"


makes a

dir('') {
// some block
}

not working.

Am Freitag, 24. März 2017 12:45:00 UTC+1 schrieb Sascha Vujevic:
>
> Hello developers,
>
> we use the kubernetes-plugin to produce slaves in Jenkins.
>
> In the logfile we can see following output:
>
> *12:38:52* [slave-test-npm] Running shell script
> *12:38:52* Executing shell script inside container [npm] of pod 
> [kubernetes-cfebda342f4349e9a12bb07ff3b1db8c-9801f82825b9f]
> *12:38:52* Executing command: sh -c echo $$ > 
> '/home/jenkins/workspace/slave-test-npm@tmp/durable-fc339069/pid'; 
> jsc=durable-0cd0becdd66e2d5e1c287736e0acaf0b; JENKINS_SERVER_COOKIE=$jsc 
> '/home/jenkins/workspace/slave-test-npm@tmp/durable-fc339069/script.sh' > 
> '/home/jenkins/workspace/slave-test-npm@tmp/durable-fc339069/jenkins-log.txt' 
> 2>&1; echo $? > 
> '/home/jenkins/workspace/slave-test-npm@tmp/durable-fc339069/jenkins-result.txt'
>  
> *12:38:52* sh: scl_source: No such file or directory
> *12:38:52*  [?1034hsh-4.2$ *cd **"/home/jenkins/workspace/slave-test-npm"*
> *12:38:52* sh-4.2$ sh -c echo $$ > 
> '/home/jenkins/workspace/slave-test-npm@tmp/durable-fc33 
> 9069/pid'; jsc=durable-0cd0becdd66e2d5e1c287736e0acaf0b; 
> JENKINS_SERVER_COOKIE=$ 
> jsc '/home/jenkins/workspace/slave-test-npm@tmp/durable-fc339069/script.sh' > 
> '/ 
> home/jenkins/workspace/slave-test-npm@tmp/durable-fc339069/jenkins-log.txt' 
> 2>&1 
> ; echo $? > 
> '/home/jenkins/workspace/slave-test-npm@tmp/durable-fc339069/jenkins 
> -result.txt' 
>
>
> Could this output be avoided ?
>
> Thanks for your support.
>
> Best regards
>   Sascha
>

-- 
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/915cc816-020d-4502-81c8-f203aac962e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Plugin for delete last month data.

2017-03-29 Thread Sandeep Grandham
Thank you,

On Wednesday, March 29, 2017 at 4:33:22 PM UTC+5:30, Mark Waite wrote:
>
> Look at the configuration slicing plugin. 
>
> On Wed, Mar 29, 2017, 3:10 AM Sandeep Grandham  > wrote:
>
>> Hi,
>>
>> I am trying to figureout the plugin for delete the old build history, 
>> trying to keep only last 30 days data only, and i am trying to delete all 
>> the projects from one location.
>> EX: In teamcity from root project using clear rules we can clean all the 
>> data at a time for all the projects.
>>  Same like i need some plugin or solution for Jenkins..
>> Please help me some body about this this.
>>
>> Thanks,
>> Sandeep
>>
>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/da7525da-b6de-4eb3-8544-26e0202de1d3%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/ac3e50b3-ef3b-4905-ac4d-2fb6da41f7c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Could not push to git from shell in Jenkins job

2017-03-29 Thread Alexey Lukin


The solution is to create id_rsa file manually in shell like this:

cat 
> I need to use jenkins job to synchronize two repositories. So I have 
> created a job, added two git repositories using Multiple SCMs plugin 
> .
>
> And added shell commands, example:
>
> cd first_project
> sha=`cat last_commit_merged`
> cd ..
> cd second_project
> new_sha=`git rev-parse HEAD`
> git diff-index "$sha" --binary > my.patch
> cd ..
> cd first_project
> if [ "$sha" != "$new_sha" ]
> then
>   git apply ../second_project/my.patch
>   echo "$new_sha" > last_commit_merged
>   git add .
>   git commit -m "New sync, date `date +'%Y-%m-%d %H:%M:%S'`";
>   git push origin HEAD
> fi
>
> So when job starts, it successfully clones both repositories in folders: 
> first_project and second_project, I could create my.patch, apply it and 
> commit, but command:
> git push origin HEAD does not work and I could not figure out how to setup 
> correctly git in shell to make it working, the error is:
>
>
> + git push origin HEAD
> Permission denied (publickey).
> fatal: Could not read from remote repository.
>
> Please make sure you have the correct access rights
> and the repository exists.
> Build step 'Execute shell' marked build as failure
> Finished: FAILURE
>
>
> -- 
>
> Alexey Lukin
> Ruby on Rails developer
>
> skype:real_virtuoz
>

-- 
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/b846bd65-3ffe-49af-9e0d-815926e742dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I stop a Pipeline after unit tests?

2017-03-29 Thread Richard Ginga
I do something similar in that I have conditional stages. Simply put logic
"around" the stages you do or do not want to run.
In order to keep the full list of stages in the job's dashboard, I actually
put the logic "within" the stage that says "Skipping stage blablabla". I
don't use Git so I don't know what information you need/have to make this
decision.

On Tue, Mar 28, 2017 at 6:32 PM, Michael Holley 
wrote:

> I've been searching all day today and have yet to find something that
> looks like it applies. I'm sorry if this answer has been hashed before and
> I just asked the all mighty Google the wrong questions.
>
> Here is the workflow I'm trying to bring over from my freestyle projects
> as Pipelines (the new Pipeline project is set up as a Multi-branch project
> with a Jenkinsfile).
>
> 1. A dev branches off of master and starts work on a feature. Whenever he
> pushes new code to GitHub I want Jenkins to set up the workspace, build the
> code, run tests, and then stop.
> 2. Once he get's his code to build clean he creates a PR.
> 3. Jenkins sees the PR and builds that, but once again, should stop after
> tests pass.
> 4. The success status, after tests, is pushed back to GitHub which then
> enables the PR to be merged with the master branch.
> 5. Now that the master branch has been updated, Jenkins once again sets up
> the workspace, builds the code, runs test, but now deploys to staging,
> waits for approval, then pushes to prod.
>
> Another way to ask the question, how do I put logic into a Pipeline to
> only run certain stages depending on what branch/PR is being built?
>
> As of right now, I have a single Jenkins file with the checkout, build,
> test, and deploy stages in it, and every time a branch is updated, a PR
> created, and with a merge to master, the code is able to be deployed. I
> don't want the code to be able to be deployed until after it's merged to
> master. Any thoughts on how to make this happen? 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/2615c315-9686-4f70-975c-364f065000f2%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Dick Ginga
Build Engineer
rgi...@disruptorbeam.com

-- 
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/CAL3PpaVGPZykSV%2BQv_UChw4NiXx3-rMf1Rfe%2BSn5X-XUcEizSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it actually possible to trigger pipeline job without Jenkinsfile by notifyCommit http-query?

2017-03-29 Thread kodstark
Actually I got that working - when pipeline completes first time then it 
will be executed via notifyCommit?url service

-- 
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/046fd94a-e575-471b-b5d1-099524d33fdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [EXTERNAL] - Job DSL and isDirectory does not work, any ideas?

2017-03-29 Thread Dirk Heinrichs
Am 29.03.2017 um 13:04 schrieb thomas.lehm...@teamaol.com:
> I need a way to iterate files in a folder to load configuration
> (multiple files) from it.
> Following code does not work using *Job DSL*:
>
>  a) you need WORKSPACE to build absolute path
>  The normal Groovy code *new File("config").getAbsolutePath()*
> does not work (with groovyConsole all fine)

The JobDSL scripts run in the main JVM (even if the job processing the
JobDSL script runs on a slave node). That's why it has the
readFileFromWorkspace()

method. But I'm afraid that doesn't solve your iteration problem.

But you can run a "normal" Groovy script before running the JobDSL
script, which writes out your directory structure to a file in the
workspace, which you can then read with above method.

HTH...

Dirk
-- 
*Dirk Heinrichs*
Senior Systems Engineer, Delivery Pipeline
OpenText^TM Discovery | Recommind
*Email*: dirk.heinri...@recommind.com 
*Website*: www.recommind.de 

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon
Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer
HRB 10646

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

-- 
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/a6d9fd5f-f38c-0b76-5efb-0c99e3a4b378%40opentext.com.
For more options, visit https://groups.google.com/d/optout.


Job DSL and isDirectory does not work, any ideas?

2017-03-29 Thread thomas . lehmann
Hi,

I have (locally) Jenkins 2.49 and Job DSL 1.58 and Groovy version 2.4.8

I need a way to iterate files in a folder to load configuration (multiple 
files) from it.
Following code does not work using *Job DSL*:

 a) you need WORKSPACE to build absolute path
 The normal Groovy code *new File("config").getAbsolutePath()* does not 
work (with groovyConsole all fine)
 b) *isDirectory* prints out "false" also normal groovy code says "true". 
(with groovyConsole all fine)



println(GroovySystem.version)
def path = new File(WORKSPACE + "/config").getAbsolutePath()
println("info (path): " + path)
println("info (isDirectory) : " + new File(path).isDirectory())

Output:

+ mkdir -p config
Processing provided DSL script
2.4.8
info (path): /data/jenkins/local/workspace/TMP/config
info (isDirectory) : false



Any help is appreciated ...

kind Regards,
Thomas

-- 
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/3e3e11d0-beb7-4e67-8d55-ae9c4221549d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Plugin for delete last month data.

2017-03-29 Thread Mark Waite
Look at the configuration slicing plugin.

On Wed, Mar 29, 2017, 3:10 AM Sandeep Grandham 
wrote:

> Hi,
>
> I am trying to figureout the plugin for delete the old build history,
> trying to keep only last 30 days data only, and i am trying to delete all
> the projects from one location.
> EX: In teamcity from root project using clear rules we can clean all the
> data at a time for all the projects.
>  Same like i need some plugin or solution for Jenkins..
> Please help me some body about this this.
>
> Thanks,
> Sandeep
>
> --
> 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/da7525da-b6de-4eb3-8544-26e0202de1d3%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/CAO49JtFavT_%2BdmM89cakVZ%2BBNvXUqhdx%2BY6nYR5nEtH5kxtdZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it actually possible to trigger pipeline job without Jenkinsfile by notifyCommit http-query?

2017-03-29 Thread kodstark
I found this issue to when running Git Plugin 3.1.0, Pipeline Plugin 2.5 - 
I'm doing checkout inside shared library which runs checkout in a loop 
according to config. However link git/notifyCommit?url=... gives me 
response "

No Git consumers using SCM API plugin for"


On Monday, 16 January 2017 13:33:09 UTC, alexand...@gmail.com wrote:
>
> Using Jenkins Pipeline there is no longer Source Code Management html-UI 
> section at job configuration (for a pipeline job checkout is handled the 
> pipeline script of the job).
>
> I am trying to trigger a test job by 'notifyCommit' http-query (using 
> curl):
> curl "http:///git/notifyCommit?url=ssh://git@<
> git-server-address>//" 
> 
>
> This http-query successfully triggers my FreeStyle jobs with Source Code 
> Management configured (via job UI) appropriately.
> But any of my variants of Pipeline jobs containing 'git' or 'checkout scm' 
> are not triggered by this http-query.
>
> Here are some of my Pipeline job scripts I tried to set up 
> 'notifyCommit'-triggering:
> node () {
>   git url: 'ssh://git@//', branch: 
> 'master', credentialsId: ''
> }
>  this variant I borrowed from:
> https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md
> (see 'Creating a Simple Pipeline' section -> 'Understanding syntax' 
> sub-section)
> and modified in accordance with: 
> https://jenkins.io/doc/pipeline/steps/git/
>
> node () {
>   checkout(
> [  $class: 'GitSCM',
>userRemoteConfigs: [[url: 
> 'ssh://git@//']],
>credentialsId: ''  ]
>   )
> }
>  this variant I borrowed from:
> https://github.com/jenkinsci/workflow-scm-step-plugin/blob/master/README.md
> (see 'Generic SCM step' section)
>
> At html-UI of pipeline jobs I switched on 'Poll SCM' (without schedule).
> I tried with 'Poll SCM' unchecked also.
> For 'git' pipeline step I tried also 'poll' false and true values.
> Job HTML-UI setting 'Ignore post-commit hooks' was unchecked during all my 
> tries.
> Also I didn't use '$class: IgnoreNotifyCommit'.
> On the other hand I successfully configured a pipeline job to be triggered 
> via 'Trigger bulds remotely' set up.
>
> The readme I already referred few lines above (see link below) says that 
> it's possible to trigger pipeline job via 'notifyCommit':
> https://github.com/jenkinsci/workflow-scm-step-plugin/blob/master/README.md
> (see 'Features' section -> 'Polling' sub-section)
>  but there are no complete examples and no clarifications on several 
> aspects of such set up.
> Particularly it's unclear if both variants (with Jenkinsfile & with job 
> html-UI pipeline script) can be triggered via 'notifyCommit' http-query.
>
> Am I miss something?
> Can it be that my 'Jenkins' + 'Pipeline Plugin' + 'Git plugin' versions 
> have a bug?
> For now I use Jenkins 2.8, Pipeline Plugin 2.4, Git Plugin 3.0.0 .
>
>
> Kind regards
> Alexander Ites
>

-- 
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/7b6cc5e8-e695-4bde-b66b-62b60b425564%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can i add extra columns in blueocean UI

2017-03-29 Thread Deenbandhu Agrawal
I want to add few more columns in Blue ocean UI like commit author, and 
some other evrionment variables how can i achieve that ?

-- 
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/d10e2efe-b5df-4d5d-82d4-6aa03aba6c63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can I mount a temporary volume associated with the workspace in a docker container with Declarative Pipeline?

2017-03-29 Thread Miyata Jumpei
I would like to mount a temporary volume associated with the workspace in a 
docker container for gradle caching. With Scripted Pipeline, It can be 
written like the following.

-
docker.image('my-gradle').inside("-v ${pwd(tmp: 
true)}:/home/jenkins/.gradle") {
sh './gradlew test'
}
-

But with Declarative Pipeline, the following causes an error.

-
agent {
dockerfile {
dir 'path/to/dockerfileDir'
label 'docker-nodes'
args "-v ${pwd(tmp: true)}:/home/jenkins/.gradle"
}
}
-

The console log is like the following.

-
$ docker run -t -d -u 1000:1000 -v 
org.jenkinsci.plugins.pipeline.modeldefinition.ClosureModelTranslator@34a240ba:/home/jenkins/.gradle
 
...

java.io.IOException: Failed to run image 
'e3747815ce1fc12012be2114aa26b6b1ec8a0492'. Error: docker: Error response 
from daemon: create 
org.jenkinsci.plugins.pipeline.modeldefinition.ClosureModelTranslator@34a240ba: 
"org.jenkinsci.plugins.pipeline.modeldefinition.ClosureModelTranslator@34a240ba"
 
includes invalid characters for a local volume name, only 
"[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host 
directory, use absolute path.
See 'docker run --help'.
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.run(DockerClient.java:127)
at 
org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:178)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at 
com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18)
at 
org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:128)
at 
org.jenkinsci.plugins.docker.workflow.Docker.node(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:63)
at 
org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:116)
at 
org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.DockerPipelineFromDockerfileScript.runImage(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy:64)
at 
org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.AbstractDockerPipelineScript.configureRegistry(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy:68)
at 
org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.AbstractDockerPipelineScript.run(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy:54)
at 
org.jenkinsci.plugins.pipeline.modeldefinition.agent.CheckoutScript.checkoutAndRun(jar:file:/var/jenkins_home/plugins/pipeline-model-extensions/WEB-INF/lib/pipeline-model-extensions.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/CheckoutScript.groovy:57)
at 
org.jenkinsci.plugins.pipeline.modeldefinition.agent.CheckoutScript.doCheckout(jar:file:/var/jenkins_home/plugins/pipeline-model-extensions/WEB-INF/lib/pipeline-model-extensions.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/CheckoutScript.groovy:40)
at 
org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.LabelScript.run(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy:44)
at ___cps.transform___(Native Method)
at 
com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
at sun.reflect.GeneratedMethodAccessor542.invoke(Unknown Source)
at 

Plugin for delete last month data.

2017-03-29 Thread Sandeep Grandham
Hi,

I am trying to figureout the plugin for delete the old build history, 
trying to keep only last 30 days data only, and i am trying to delete all 
the projects from one location.
EX: In teamcity from root project using clear rules we can clean all the 
data at a time for all the projects.
 Same like i need some plugin or solution for Jenkins..
Please help me some body about this this.

Thanks,
Sandeep

-- 
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/da7525da-b6de-4eb3-8544-26e0202de1d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Could not push to git from shell in Jenkins job

2017-03-29 Thread Alexey Lukin
I need to use jenkins job to synchronize two repositories. So I have
created a job, added two git repositories using Multiple SCMs plugin
.

And added shell commands, example:

cd first_project
sha=`cat last_commit_merged`
cd ..
cd second_project
new_sha=`git rev-parse HEAD`
git diff-index "$sha" --binary > my.patch
cd ..
cd first_project
if [ "$sha" != "$new_sha" ]
then
  git apply ../second_project/my.patch
  echo "$new_sha" > last_commit_merged
  git add .
  git commit -m "New sync, date `date +'%Y-%m-%d %H:%M:%S'`";
  git push origin HEAD
fi

So when job starts, it successfully clones both repositories in folders:
first_project and second_project, I could create my.patch, apply it and
commit, but command:
git push origin HEAD does not work and I could not figure out how to setup
correctly git in shell to make it working, the error is:


+ git push origin HEAD
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Build step 'Execute shell' marked build as failure
Finished: FAILURE


-- 

Alexey Lukin
Ruby on Rails developer

skype:real_virtuoz

-- 
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/CALwR_haNkO%2BN9_wusR08AaH8X2C7gwEVJT%2BQUF%3Dka0Bxv3sP%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.