Re: Execute shell script on remote host using ssh - Jenkinsfile

2017-02-19 Thread David Karr
On Sat, Feb 18, 2017 at 9:10 AM, jequals5  wrote:
> Hello all. First time poster, long time stalker.
> I am trying to find an example of executing a shell script on a remote host
> using ssh. There is the plugin for this but I want to convert that action in
> to a Jenkinsfile.
> Any help is appreciated.

Here's a paraphrased example from one of my Jenkinsfiles:
---
withCredentials([[$class:
'UsernamePasswordMultiBinding', credentialsId: params.credentials,
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sshagent (credentials: [params.privateKey]) {
sh "ssh -o StrictHostKeyChecking=no
${USERNAME}@${params.host} \"docker stop ${params.containerName}\""
}
}


-- 
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/CAA5t8Vo2We%3DWuCrMczWshvwuDjgeMM_iO2H%2BXev6%2Ba3g_7OGDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't output clear text from secret text

2017-02-19 Thread David Karr
On Thu, Feb 16, 2017 at 7:45 AM, John Marks  wrote:

> I just wanted to test secret text, but the job always outputs "" when
> I try to echo the bound variable from a shell script job.
>
>
> 
>
>
> Shell script:
>
> set +x
> echo "My secret is $username"
>
> What I see in the console:
>
> Started by user GMAS
> [EnvInject] - Loading node environment variables.
> Building in workspace /u02/app/jenkins/.jenkins/workspace/c-test
> [c-test] $ /bin/sh -xe /u02/app/jenkins/apache-tomcat-8.0.26/temp/
> hudson5680487019107036432.sh
> + set +x
> My secret is 
> Finished: SUCCESS
>
> Probably something really obvious that I'm missing. Can someone help?
>

Did you try referencing "${username.toString()}" instead?

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


Re: Disable standard output from Jenkins pipeline:

2017-02-19 Thread David Karr
On Thu, Feb 16, 2017 at 8:23 AM, Geethalakshmi Ramachandran
 wrote:
> A jenkins pipeline  calls an API that returns  metrics and prints it in the 
> console output with formatting. However, Jenkins pipeline prints standard 
> output for each command like below: How to disable this or turn it off?

If you want to control how or whether stdout is emitted from a "sh"
step, instead of calling it like this:
--
sh "command line"
-

Do:

sh returnStdout: true; script: "command line"


I suppose you could set that to "false" also,but I've never done 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/CAA5t8VqtAd7a_u6Nac2xO%2BZhitVy3wDeaQ0eP65-0a-YdUMQFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Multi Configuration Job Jenkinsfile

2017-02-19 Thread Chris Denneen
Anyone have any suggestions?
Trying to run a multi configuration job for different RUBY_VERSION and 
PUPPET_VERSION. Also this job needs to pin the jobs on a particular slave with 
slave axis   

-- 
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/3567ebf5-406c-46f0-8f15-7893bd1e90d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Parallel in Declarative Pipeline

2017-02-19 Thread Baptiste Mathus
Yes, it is supported.

Le 15 févr. 2017 10:10 PM, "'pbeatty' via Jenkins Users" <
jenkinsci-users@googlegroups.com> a écrit :

I can point you to this link on Jenkins.io that describes the declarative
style and scripting style for Jenkinsfile pipeline.
https://jenkins.io/doc/book/pipeline/jenkinsfile/


On Wednesday, February 15, 2017 at 3:53:58 PM UTC-5, taroc...@gmail.com
wrote:
>
> What's declarative syntax?
>
> On Wednesday, February 15, 2017 at 11:48:22 AM UTC-8, pbeatty wrote:
>>
>> Is "parallel" valid to use in declarative Jenkinfile syntax or is it only
>> availabl Scripting syntax?
>>
>> Pat
>>
> --
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/1f2d7a1c-73e3-495e-abf3-a4877d4bcf4c%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/CANWgJS4T6HohXjgzgfjRm4bS0XgA0YCGWDenY1aFR3-04z54vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins LTS and Docker 1.13

2017-02-19 Thread rene . okouya

Hello Damien,

  So apparently you have been using Jenkins LTS 2.32.2 with Docker 1.13.1, 
please 
can you advise or share on your setup, regarding the name and the version 
of the docker plugin you are using ?  more specificaly do you use docker 
1.13 feature like swarm mode or  docker service in compose file ? 
what generaly the setup ? 


Le samedi 18 février 2017 18:49:44 UTC+1, Damien Coraboeuf a écrit :
>
> I've used Jenkins LTS 2.32.2 with Docker 1.13.1 without any issue. What is 
> exactly your issue?
>
> On Friday, 17 February 2017 08:55:01 UTC+1, Baptiste Mathus wrote:
>>
>>
>>
>> Le 9 févr. 2017 4:38 PM, "Omeka"  a écrit :
>>
>> Previously the current LTS of jenkins would not work with docker 1.12 
>> because of this issue 
>> https://github.com/maxfields2000/dockerjenkins_tutorial/issues/20
>> Has anyway here tested jenkins LTS with the Docker 1.13? 
>>
>> Is there a way to get around the issue with another docker plugin?
>>
>>
>> Can help if you start giving the plugins and LTS version you're referring 
>> to.
>>
>>
>> On my setup we would to experiment with docker swarm mode which is a 
>> 1.12+ feature.
>>
>> -- 
>> 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/dda0da4c-04f5-4042-9f14-92494e23ef3f%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/dc5e23f3-735e-4202-ab29-9c0118bcfe03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build project inside docker

2017-02-19 Thread Indra Gunawan (ingunawa)
What is usr/local/src/freeswitch?  You missed “/” before usr.

From:  on behalf of Ruchir Brahmbhatt 

Reply-To: "jenkinsci-users@googlegroups.com" 
Date: Saturday, February 18, 2017 at 2:26 AM
To: Jenkins Users 
Subject: Build project inside docker

Hi,

I'm trying to build a project inside docker container so that all dependencies 
required for project are available and doesn't require installation in jenkins 
system. Below is my Jenkinsfile.


node{

stage ('Build'){

 checkout scm

 docker.image('bettervoice/freeswitch-container:1.6.9').inside {

sh 'cd usr/local/src/freeswitch-1.4.26'

sh './rebootstrap'

sh './configure'

sh 'make'

}

  }

}



But I get error as below.

[st-cawsup-awpbx-voip_master-ZVTVQJCM4MJ75YVFR46JVXULPIMRLC6U3ILUY4WLDZ7ISHOVOE6A]
 Running shell script

+ usr/local/src/freeswitch-1.4.26/rebootstrap

/var/lib/jenkins/workspace/st-cawsup-awpbx-voip_master-ZVTVQJCM4MJ75YVFR46JVXULPIMRLC6U3ILUY4WLDZ7ISHOVOE6A@tmp/durable-776c465c/script.sh:
 2: 
/var/lib/jenkins/workspace/st-cawsup-awpbx-voip_master-ZVTVQJCM4MJ75YVFR46JVXULPIMRLC6U3ILUY4WLDZ7ISHOVOE6A@tmp/durable-776c465c/script.sh:
 usr/local/src/freeswitch-1.4.26/rebootstrap: not found



Any hints on what is wrong with the file?
--
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/fbaf0dbb-20e8-4413-b157-a56161167fb9%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/A5F4F6A6-3D21-4D56-B317-BF0224079464%40cisco.com.
For more options, visit https://groups.google.com/d/optout.