Re: Pipeline DSL, IntelliJ, and maven

2017-03-02 Thread Indra Gunawan (ingunawa)
Somehow is there other IDE that can be supported.  Can Jenkinsfile syntax 
hightlighting be supported in SublimeText and recently Visual Studio Code.

Thank you


On 3/2/17, 4:01 PM, "jenkinsci-users@googlegroups.com on behalf of Daniel Beck" 
 wrote:


> On 03.03.2017, at 00:12, Justin Knowles  wrote:
> 
> are there even install instructions on that page or directions for how to 
get IntelliJ to understand GroovyDSL/Jenkinsfile? 

It works for me with IntelliJ 2016.3.4.

Steps:

1. Create a new Java project with Groovy dependency.
2. Right-click 'src', New, Groovy Script, call it 'dsl' and select kind 
'GroovyDSL script'.
3. Paste in the output from Jenkins and save.
4. 'Activate back'
5. Right-click 'src', New, Groovy Script, call it 'Jenkinsfile' and select 
kind 'Groovy script'.
6. Paste in your Jenkinsfile
7. Enjoy autocompletion etc.

-- 
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/20131B21-731E-4614-A2DF-A44BF686FC16%40beckweb.net.
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/AF6EC515-5430-4446-B1EC-2C4C32DB4F03%40cisco.com.
For more options, visit https://groups.google.com/d/optout.


Re: shell execution produces "couldn't flush stdout" error

2017-03-02 Thread jjackson
I'm seeing something similar whenever I try to use pipes in a jenkins 
pipeline sh .  I've asked a similar question on SO 
http://stackoverflow.com/questions/42568201/jenkins-pipeline-sh-does-not-seem-to-respect-pipe-in-shell-command.
 
 I can't seem to get piped shell commands to work, which seriously limits 
the power of what you can do.

On Wednesday, September 4, 2013 at 1:30:04 AM UTC-7, Matthias wrote:
>
> Hello,
>
> when using pipes in shell scripts I often get the error mentioned in the 
> subject line.
>
> To reproduce the issue add an "execute shell" build step to a new job and 
> run the following:
>
> echo replace e by a | sed 's_e_a_g' | echo done
>
> This might not make much sense - but it generates the error "couldn't 
> flush stdout" while this does not happen when executing the same in a 
> terminal.
>
>
> The jenkins console output produces:
>
>
> [EnvInject] - Loading node environment variables.
> Building on master in workspace 
> /home/jenkins/build-server/jobs/test.sed/workspace
> [workspace] $ /bin/sh -xe /tmp/hudson7236481234921041257.sh
> + echo replace e by a
> + echo done
> done
> + sed s_e_a_g
> sed: couldn't flush stdout: Broken pipe
> Finished: SUCCESS
>
>
>
> best regards,
> Matthias
>

-- 
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/6adccbf8-8e20-4ea8-a128-85fb5315e46c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: shell execution produces "couldn't flush stdout" error

2017-03-02 Thread jjackson
I'm seeing something similar whenever I try to use pipes in a jenkins 
pipeline sh .  I've asked a similar question on 
SO 
http://stackoverflow.com/questions/42568201/jenkins-pipeline-sh-does-not-seem-to-respect-pipe-in-shell-command.
 
 I can't seem to get piped shell commands to work, which seriously limits 
the power of what you can do.

On Wednesday, September 4, 2013 at 1:30:04 AM UTC-7, Matthias wrote:
>
> Hello,
>
> when using pipes in shell scripts I often get the error mentioned in the 
> subject line.
>
> To reproduce the issue add an "execute shell" build step to a new job and 
> run the following:
>
> echo replace e by a | sed 's_e_a_g' | echo done
>
> This might not make much sense - but it generates the error "couldn't 
> flush stdout" while this does not happen when executing the same in a 
> terminal.
>
>
> The jenkins console output produces:
>
>
> [EnvInject] - Loading node environment variables.
> Building on master in workspace 
> /home/jenkins/build-server/jobs/test.sed/workspace
> [workspace] $ /bin/sh -xe /tmp/hudson7236481234921041257.sh
> + echo replace e by a
> + echo done
> done
> + sed s_e_a_g
> sed: couldn't flush stdout: Broken pipe
> Finished: SUCCESS
>
>
>
> best regards,
> Matthias
>

-- 
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/fad799a7-7693-46dd-8efb-4e0fbf6789d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline DSL, IntelliJ, and maven

2017-03-02 Thread Daniel Beck

> On 03.03.2017, at 00:12, Justin Knowles  wrote:
> 
> are there even install instructions on that page or directions for how to get 
> IntelliJ to understand GroovyDSL/Jenkinsfile? 

It works for me with IntelliJ 2016.3.4.

Steps:

1. Create a new Java project with Groovy dependency.
2. Right-click 'src', New, Groovy Script, call it 'dsl' and select kind 
'GroovyDSL script'.
3. Paste in the output from Jenkins and save.
4. 'Activate back'
5. Right-click 'src', New, Groovy Script, call it 'Jenkinsfile' and select kind 
'Groovy script'.
6. Paste in your Jenkinsfile
7. Enjoy autocompletion etc.

-- 
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/20131B21-731E-4614-A2DF-A44BF686FC16%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline DSL, IntelliJ, and maven

2017-03-02 Thread Justin Knowles
Not trying to be obtuse, but are there even install instructions on that
page or directions for how to get IntelliJ to understand
GroovyDSL/Jenkinsfile? I see the "Describing GroovyDSL internal language in
its own terms" section mentioning IDEA PSI but I have no idea where it is
or how to set it up? Am I looking at the right section? This is for an
existing project, FWIW.

On Thu, Mar 2, 2017 at 5:19 PM, Daniel Beck  wrote:

>
> > On 02.03.2017, at 22:49, Justin Knowles  wrote:
> >
> > I've done that but I'm not seeing any syntax highlighting or
> autocompletion in my Jenkinsfile. I'm not developing a plugin for Jenkins
> or anything, I just want IntelliJ to recognize the Jenkinsfile and provide
> highlighting, style fixes, etc.
>
> The instructions on https://confluence.jetbrains.
> com/display/GRVY/Scripting+IDE+for+DSL+awareness don't work? (Instead of
> writing the GDSL from scratch, just paste the provided one in.)
>
> --
> 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/S0_etu_70oY/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/BCF97543-D247-45A2-95CC-5B0181E76D30%40beckweb.net.
> 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/CAFZDVTj8XW%3DAHfN%3D4B22wonO6KD-YYVdjEzxhFCc4_ShRxhzxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline DSL, IntelliJ, and maven

2017-03-02 Thread Daniel Beck

> On 02.03.2017, at 22:49, Justin Knowles  wrote:
> 
> I've done that but I'm not seeing any syntax highlighting or autocompletion 
> in my Jenkinsfile. I'm not developing a plugin for Jenkins or anything, I 
> just want IntelliJ to recognize the Jenkinsfile and provide highlighting, 
> style fixes, etc.

The instructions on 
https://confluence.jetbrains.com/display/GRVY/Scripting+IDE+for+DSL+awareness 
don't work? (Instead of writing the GDSL from scratch, just paste the provided 
one in.)

-- 
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/BCF97543-D247-45A2-95CC-5B0181E76D30%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline DSL, IntelliJ, and maven

2017-03-02 Thread Justin Knowles
Is there a guide on what I do with that GDSL? If I'm understanding
correctly the instructions here (
https://st-g.de/2016/08/jenkins-pipeline-autocompletion-in-intellij) say:
1. take the raw GDSL from /pipeline-syntax
2. drop it into a file called pipeline.gdsl
3. put it somehwere on the classpath

I've done that but I'm not seeing any syntax highlighting or autocompletion
in my Jenkinsfile. I'm not developing a plugin for Jenkins or anything, I
just want IntelliJ to recognize the Jenkinsfile and provide highlighting,
style fixes, etc.

On Thu, Mar 2, 2017 at 4:25 PM, Daniel Beck  wrote:

>
> > On 02.03.2017, at 21:34, Justin Knowles  wrote:
> >
> > integrated a plugin with IntelliJ for editing a Jenkinsfile when writing
> Jenkins pipelines
>
> There's a GDSL you can download from /pipeline-syntax that provides
> Pipeline syntax, would that work? If not, could you explain what you're
> asking for?
>
> --
> 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/to
> pic/jenkinsci-users/S0_etu_70oY/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/ms
> gid/jenkinsci-users/6EAEF958-C442-4A3B-BA0A-CFAE41050335%40beckweb.net.
> 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/CAFZDVTi4_VtovDeOazb-xCT9X6x50VeumbV-zaaJBERi6M0nrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline DSL, IntelliJ, and maven

2017-03-02 Thread Daniel Beck

> On 02.03.2017, at 21:34, Justin Knowles  wrote:
> 
> integrated a plugin with IntelliJ for editing a Jenkinsfile when writing 
> Jenkins pipelines

There's a GDSL you can download from /pipeline-syntax that provides Pipeline 
syntax, would that work? If not, could you explain what you're asking for?

-- 
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/6EAEF958-C442-4A3B-BA0A-CFAE41050335%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Pipeline DSL, IntelliJ, and maven

2017-03-02 Thread Justin Knowles
Has anyone integrated a plugin with IntelliJ for editing a Jenkinsfile when 
writing Jenkins pipelines? Where can I find how to do this? I'm not seeing 
any plugins in the plugin repositories or on google, and the closest thing 
I've found to a howto was using Gradle and not maven, so I'm unsure of how 
to take those instructions and apply them to my setup.

-- 
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/6d760923-07dd-40d0-a4b7-458023d77b13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Locking from shell

2017-03-02 Thread Artur Szostak
Hello,

Does anyone know if the Lockable Resources plugin exposes a REST API or any 
other mechanism to be able to grab a lock from within a shell build step?
Is there any other locking plugin that can support this?
I need this to support dynamic resource locking. Specifically, I only know what 
subsequent resources need to be locked after the first few stages of my build 
process from the command line tools.

Alternatively, is it possible with the pipeline plugin to read in output from a 
build step on a slave and use that within the lock statement of a pipeline 
definition?

Kind regards.

Artur

-- 
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/f3f3385faf404295903b1b7281d3322b%40partner.eso.org.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with runnig Jenkins Slave using ssh key

2017-03-02 Thread 'Björn Pedersen' via Jenkins Users
Probably you need to generate new ssh keys:
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/#fate-315806 

1024bit DSA key are disabled.

Björn

Am Donnerstag, 2. März 2017 17:31:09 UTC+1 schrieb sekar:
>
> Hi, Did you find any solution. please share if you have solutions. thank 
> you- chandru
>
> On Friday, May 6, 2016 at 4:10:10 PM UTC+5:30, Stefan Gehrig wrote:
>>
>> Hi
>>
>> I can't manage to run a slave jenkins job on SUSE SLES 12. I got the 
>> error:
>>
>> [05/06/16 11:51:12] [SSH] Opening SSH connection to pnsapp01-x:22.
>> Key exchange was not finished, connection is closed.
>> ERROR: Unexpected error in launching a slave. This is probably a bug in 
>> Jenkins.java.lang.IllegalStateException 
>> :
>>  Connection is not established!
>>  at 
>> com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030) 
>> 
>>  at 
>> com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
>>  
>> 
>>  at 
>> com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
>>  
>> 
>>  at 
>> com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:207)
>>  
>> 
>>  at 
>> com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:169)
>>  
>> 
>>  at 
>> hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1212) 
>> 
>>  at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711) 
>> 
>>  at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706) 
>> 
>>  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) 
>> 
>> [05/06/16 11:51:12] Launch failed - cleaning up connection
>> [05/06/16 11:51:12] [SSH] Connection closed.
>>
>>
>>
>> First of all, here what I already did or have:
>>
>>
>>
>>- I got serveral other Slave Jobs to SLES 11, which are working fine. 
>> Same ssh key.
>>- I checked the ssh key and it fits (compared to the other running 
>> slaves).
>>- I managed to open a ssh connection manually with "ssh user@server" via 
>> ssh key to SLES 12. So it rather can't be something in ssh.config or 
>> sshd.config, I asume. Also the firewall must be open. Let's say SSH is 
>> generally working fine via ssh key.
>>- I "patched" JAVA with "Java Cryptography Extension (JCE) Unlimited 
>> Strength" on both, master and slave. Java version is 1.8.0_92. I made a test 
>> with TestJCE and got JCE Supported=true on both, master and slave.
>>Still no success.
>>- I updated all Jenkins Plugins. My Jenkins version is 1.642.3.
>>
>> I'm really running out of what I can try next.
>>
>> Does anyone have an idea?
>>
>> Cheers
>> Stefan
>>
>>

-- 
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/79ee4dc4-eb74-4a66-b05b-439a6f9b6bc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative pipeline] Using Docker environment variables

2017-03-02 Thread Peter Marcoen
Could also be linked to this open 
issue: https://issues.jenkins-ci.org/browse/JENKINS-41204

-- 
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/5a169b61-66e8-4ba3-8f47-33b823659f00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative pipeline] Using Docker environment variables

2017-03-02 Thread Peter Marcoen
Actually my issue looks a lot like this issue from 
2015: 
https://groups.google.com/forum/#!searchin/jenkinsci-users/docker$20environment$20variables|sort:relevance/jenkinsci-users/TIwE0F_e8qs/6f4GP-a0CAAJ
However, this was an issue with the Cloudbees custom docker plugin.

-- 
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/b8b154cb-33bc-4dc4-8f8a-8e6de404137f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with runnig Jenkins Slave using ssh key

2017-03-02 Thread sekar
Hi, Did you find any solution. please share if you have solutions. thank 
you- chandru

On Friday, May 6, 2016 at 4:10:10 PM UTC+5:30, Stefan Gehrig wrote:
>
> Hi
>
> I can't manage to run a slave jenkins job on SUSE SLES 12. I got the error:
>
> [05/06/16 11:51:12] [SSH] Opening SSH connection to pnsapp01-x:22.
> Key exchange was not finished, connection is closed.
> ERROR: Unexpected error in launching a slave. This is probably a bug in 
> Jenkins.java.lang.IllegalStateException 
> :
>  Connection is not established!
>   at 
> com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030) 
> 
>   at 
> com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
>  
> 
>   at 
> com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
>  
> 
>   at 
> com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:207)
>  
> 
>   at 
> com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:169)
>  
> 
>   at 
> hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1212) 
> 
>   at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711) 
> 
>   at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706) 
> 
>   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) 
> 
> [05/06/16 11:51:12] Launch failed - cleaning up connection
> [05/06/16 11:51:12] [SSH] Connection closed.
>
>
>
> First of all, here what I already did or have:
>
>
>
>- I got serveral other Slave Jobs to SLES 11, which are working fine. Same 
> ssh key.
>- I checked the ssh key and it fits (compared to the other running slaves).
>- I managed to open a ssh connection manually with "ssh user@server" via 
> ssh key to SLES 12. So it rather can't be something in ssh.config or 
> sshd.config, I asume. Also the firewall must be open. Let's say SSH is 
> generally working fine via ssh key.
>- I "patched" JAVA with "Java Cryptography Extension (JCE) Unlimited 
> Strength" on both, master and slave. Java version is 1.8.0_92. I made a test 
> with TestJCE and got JCE Supported=true on both, master and slave.
>Still no success.
>- I updated all Jenkins Plugins. My Jenkins version is 1.642.3.
>
> I'm really running out of what I can try next.
>
> Does anyone have an idea?
>
> Cheers
> Stefan
>
>

-- 
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/c4badae4-01b9-43ab-aa51-642e19975c86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Declarative pipeline] Using Docker environment variables

2017-03-02 Thread Peter Marcoen
In my Dockerfile I install Ant and declare environment variables pointing 
to this Ant installation:

FROM openjdk:7# Install wgetRUN  apt-get update \  && apt-get install -y wget \ 
 && rm -rf /var/lib/apt/lists/*# Install antENV ANT_VERSION 1.9.6RUN cd && \
wget -q 
http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz
 && \tar -xzf apache-ant-${ANT_VERSION}-bin.tar.gz && \mv 
apache-ant-${ANT_VERSION} /opt/ant && \rm 
apache-ant-${ANT_VERSION}-bin.tar.gzENV ANT_HOME /opt/antENV PATH 
${PATH}:/opt/ant/bin# Create user jenkinsRUN groupadd -g 999 dockerRUN useradd 
jenkins -u 999 -g 999 --shell /bin/bash --create-homeRUN echo 'export 
ANT_HOME=/opt/ant'  >> /home/jenkins/.bashrcRUN echo 'export 
PATH=$PATH:/opt/ant/bin' >> /home/jenkins/.bashrcUSER jenkins


As you can see I do 2 things: I use the docker ENV statement which should 
set the environment variables, then additionally I add export statements to 
the jenkins' user bashrc.
However, inside my Jenkins pipeline these environment variables don't 
appear to be set, no matter what I do. 
When I echo my path I see the following:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/jenkins/bin:/usr/lib/oracle/12.1/client64/bin:/usr/lib/oracle/12.1/client64/lib


When I echo my .bashrc there are indeed the following lines:


export ANT_HOME=/opt/ant
export PATH=$PATH:/opt/ant/bin


So why is my path set incorrectly?

I suspect the reason is that Jenkins overwrites the path when running docker, 
and I can kinda see this in the console output of Jenkins:


docker run -t -d -u 999:999 -w /opt/jenkins/workspace/testws -v 
/opt/jenkins/workspace/testws :/opt/jenkins/workspace/testws :rw -v 
/opt/jenkins/workspace/testws @tmp:/opt/jenkins/workspace/testws@tmp:rw -e 
 -e  -e  -e  -e  -e  -e 
 -e  -e  -e  -e  -e  -e 
 -e  -e  -e  -e  -e  -e 
 -e  -e  -e  -e  -e  
--entrypoint cat 4b4e7722d454ad10aec20f95d2bb1c1ce527c880


And if I look in the documentation it even says how to set environment 
variables: 
https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/Environment-variables

But this doesn't make sense to me. Isn't the whole point of using Docker that 
your environment will consistently be the same? So why would I want to use 
environment settings or tools from jenkins if I'm using docker? Then the 
environment is also not defined in a file anymore.


Is there any way around this? Or am I looking at it all wrong?


This is the Jenkinsfile that I use:


pipeline {agent {dockerfile {
label "docker"}}stages {
stage("build") {steps {
sh 'echo $PATH'sh 'cat ~/.bashrc'   
 }}}}

-- 
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/9112754e-17f2-44fc-a63e-5cc66d7e0fec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Security question

2017-03-02 Thread Mark Waite
Jenkins executes processes on agents.  Since you're allowing a process to
compile code and execute tests on an agent, you're accepting that the agent
is at risk from that compilation and execution.

One of the way to reduce that risk is to never execute build jobs on the
master agent.  That also help scalability, since the master agent generally
has plenty of work to do being the master of all the other agents.

Another way to reduce that risk is to create and destroy an agent for each
build process.  Then the damage which the build and test process can do is
limited to the agent running the build.  There are plugins which will
create and destroy virtual machines from Jenkins.  There are plugins which
will create and destroy Docker instances from Jenkins.

Mark Waite

On Thu, Mar 2, 2017 at 8:21 AM  wrote:

> Hi,
>
> We have a Jenkins installation running under windows, pulling from SVN,
> that is building some VS2010/VS2015 projects.
>
> Those projects are using google test for automated testing.
>
> How does one prevent those google test projects from accessing the build
> server from outside of the build workspace?
>
> That seems to be a big security hole. You seem to be able to impact the
> whole build server from a google test project.
>
> Google test is not something that is installed. They are just libraries
> included with the project.
>
> Am I missing a security setting in Jenkins somewhere? How do I resolve
> this?
>
> 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/cfbfe51e-7d3d-415d-90b4-9f8df9457ffe%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/CAO49JtHXTWTo7tChJw7igu7BReHu8B0bvvaP8G_uwEDXLc47%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Security question

2017-03-02 Thread andrew . lucas
 

Hi,

We have a Jenkins installation running under windows, pulling from SVN, 
that is building some VS2010/VS2015 projects.

Those projects are using google test for automated testing.

How does one prevent those google test projects from accessing the build 
server from outside of the build workspace?

That seems to be a big security hole. You seem to be able to impact the 
whole build server from a google test project.

Google test is not something that is installed. They are just libraries 
included with the project.

Am I missing a security setting in Jenkins somewhere? How do I resolve this?

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/cfbfe51e-7d3d-415d-90b4-9f8df9457ffe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SCM initiated builds with scripted/imperative pipeline

2017-03-02 Thread Gardell, Steven
I am trying to get parallel builds to run as described in several different 
places including:

https://www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins
https://jenkins.io/blog/2016/10/16/stage-lock-milestone/

What I find is that this mechanism (basically "lock(...) { milestone() { 
do-build }}") works at the scripting level when I invoke the build manually but 
not for SCM (in my case Perforce) initiated builds. This is true with both 'SCM 
polling' and 'Perforce triggered' builds. It seems that this SCM initiation 
simply doesn't run if the job is currently running. This same build is being 
triggered by SCM polling when it is not currently running, so I am by that 
minor challenge.

Any suggestions?

-- 
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/CY1PR0301MB1996B1D589D1A2D64D91735EB8280%40CY1PR0301MB1996.namprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there any way for a jenkins project to use the Gitlab plugin but only be built periodically and not when a change is pushed?

2017-03-02 Thread suresh kumar
Could you share the full config of Job and Check the Gitlab hooks.

-Suresh

On Thursday, March 2, 2017 at 2:47:39 AM UTC+5:30, Oded Badt wrote:
>
> Actually I tried with it both checked and unchecked and played arouns with 
> it back and forth and no matter what I do it still it rebuilds with every 
> push to the repository
>
> On Wed, Mar 1, 2017 at 6:45 PM, suresh kumar  > wrote:
>
>> I think you have checked Poll SCM option in Build Triggers section. 
>> Uncheck Poll SCM and Check the checkbox Build periodically.
>>
>> [image: 
>> http://lh3.ggpht.com/-_t31sX5XYBU/VQXVt6PucQI/Bt0/gjCgub_9nH0/jenkins009_thumb%25255B1%25255D.png?imgmax=800]
>>
>> -Suresh
>>
>> On Wednesday, March 1, 2017 at 8:09:42 PM UTC+5:30, Oded Badt wrote:
>>>
>>> Note that:
>>>
>>> "Build when a change is pushed to GitLab. GitLab CI Service URL:"
>>>
>>> is UNCHECKED,
>>> yet Jenkins keeps building the project every time I push a change to it 
>>> even though my intention is for it to be built periodically (with the code 
>>> snapshot of that moment) due to build side effects I prefer to avoid on 
>>> every push to my repo
>>>
>> -- 
>> 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/zwbqxC196dM/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/02243e9c-7f5e-457f-8ae0-f92bdbdc0107%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/b4a7815a-5bb9-4ede-808c-9caa3b586e04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: User input in declarative pipeline

2017-03-02 Thread Bill Dennis
I've seen it used in a 'when' condition - in this example online: 
https://github.com/sta-szek/pojo-tester/blob/master/Jenkinsfile

Here is an extract from that:

when {
expression {
boolean publish = false
if (env.DEPLOYPAGES == "true") {
return true
}
try {
timeout(time: 1, unit: 'MINUTES') {
input 'Deploy pages?'
publish = true
}
} catch (final ignore) {
publish = false
}
return publish
}
}


But is doesn't seem to usable as a 'first class' step in a steps section 
without dropping into script.

Bill


On Thursday, 2 March 2017 06:34:06 UTC, Bert wrote:
>
> Hello everyone,
>
> One of the CloudBees support articles 
> 
>  
> describes how to do a user input in a pipeline script, as alternative for 
> the promoted builds plug-in. I'm trying to do that, but then with a 
> declarative pipeline definition.
>
> I know that's possible through a script block inside the pipeline 
> definition, but I'd like to prevent that and stay in the declarative model.
>
> Is that possible?
>
> Thanks in advance,
> Bert
>

-- 
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/ab3fdb40-1943-4c64-b0a6-e9de729d3a1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.