Active Directory authentication + Build agents

2017-08-10 Thread Daniel Becroft
Hopefully this is a quick question.

We are currently moving to Active Directory authentication for Jenkins (as
we can't get emails to send to our developers unless Jenkins knows about
them now). Our plan is to create a group in AD (JenkinsUsers), put everyone
into that group, and then give the permissions to that group.

Our build slaves are (mostly) configured to run as Windows Services under
generic accounts. Do the account that those slaves run under need to be
included in that group? Does that account get authenticated/authorized in
any way? Or are the agent user accounts a separate area.

Cheers,
Daniel B.

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


Re: curl upload with filename in variable

2017-08-10 Thread Curtis Kline
Richard, that was the problem. There was an extra line feed stuffed into
the variable by accident.

Thanks!
Curtis


On Thu, Aug 10, 2017 at 5:16 AM, Richard Bywater  wrote:

> Taking a look at the error, it appears like you have a line feed or
> carriage return at the end of the env.filename variable (note the quote is
> on the next line and not next to apk like I'd expect).
>
> Richard.
>
> On Thu, 10 Aug 2017 at 09:40 Curtis Kline  wrote:
>
>> The file exists in the current working directory. This is a three-stage
>> project with the agent declared at the global level. It's not running in a
>> Docker container, simply on a Linux node. As a test, I included a step
>> right before the one I mentioned:
>>
>> ls -l ${env.filename}
>>
>> The results seem conclusive:
>>
>> [Pipeline] sh[JenkinsAndroidTest] Running shell script
>> + ls -l Project-debug-v2.1.0-b999.apk
>> -rwxrwxrwx 1 jenkins jenkins 33014841 Aug  9 21:01 
>> Project-debug-v2.1.0-b999.apk
>>
>>
>>
>>
>> On Wed, Aug 9, 2017 at 4:26 PM, Slide  wrote:
>>
>>> Does the file exist in what would be considered the current working
>>> directory? Perhaps an ls before the curl to verify?
>>>
>>> On Wed, Aug 9, 2017 at 2:13 PM Curtis Kline 
>>> wrote:
>>>
 In my declarative pipeline Jenkinsfile, I have the following shell
 script line:

 sh """
 curl -F "status=2" -F "notify=1" -F "notes=${params.ReleaseNotes}" -F
 "ipa=@${env.filename}" -H "X-HockeyAppToken: 1234"
 https://rink.hockeyapp.net/api/2/apps/upload
 """

 This does not work, because curl is apparently unable to open the file.
 The file clearly exists, and the env.filename variable contains the correct
 filename (you can see this in the console log below, as the variable has
 been expanded to a file name).

 A snippet of my console log is below. I’ve been working on this for a
 number of hours, and I could use any help or advice you might have.

 [Pipeline] sh[JenkinsAndroidTest] Running shell script
 + curl -F status=2 -F notify=1 -F notes= -F ipa=@Project-debug-v2.1.0-
 b999.apk
 -H X-HockeyAppToken: 1234 https://rink.hockeyapp.net/api/2/apps/upload
   % Total% Received % Xferd  Average Speed   TimeTime Time
 Current
  Dload  Upload   Total   Spent
 Left  Speed

   0 00 00 0  0  0 --:--:-- --:--:--
 --:--:-- 0
   0 00 00 0  0  0 --:--:-- --:--:--
 --:--:-- 0
 curl: (26) couldn't open file “Project-debug-v2.1.0-b999.apk
 "
 [Pipeline] }

 --
 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/CAGkg-enyw40%3DHNoD85ai%2BFemMjafkJwH9jsswGhJX-
 KmAr8Qig%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/CAPiUgVfa%2BX14jd_4LvX1CYS_
>>> vuWRSYmvvHSh3dHjM9_ApMo5-g%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/CAGkg-enQf5Wd00PPtkNnatYKNcmFjPDxHAo
>> j94JakZe18U88Yg%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 

Re: Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-10 Thread WANG, YAN-HONG
@Carlos, Thanks!!!

2017-08-10 21:27 GMT+02:00 Carlos Sanchez :

> There is a PR for it https://github.com/jenkinsci/
> kubernetes-plugin/pull/162
>
> On Thu, Aug 10, 2017 at 9:15 PM, YAN-HONG WANG 
> wrote:
>
>> Hi,
>>
>> In jenkins-kubernetes-plugin, is there any syntax that support using *Secrets
>> as environment variables* in *containerTemplate*?
>>
>> I just saw something from here.
>> https://kubernetes.io/docs/concepts/configuration/secret/#
>> using-secrets-as-environment-variables
>>
>> So some syntax like "*secretKeyRef*" could be indicated in
>> *containerTemplate?*
>>
>> apiVersion: v1kind: Podmetadata:
>>   name: secret-env-podspec:
>>   containers:
>> - name: mycontainer
>>   image: redis
>>   env:
>> - name: SECRET_USERNAME
>>   valueFrom:
>> secretKeyRef:
>>   name: mysecret
>>   key: username
>> - name: SECRET_PASSWORD
>>   valueFrom:
>> secretKeyRef:
>>   name: mysecret
>>   key: password
>>   restartPolicy: Never
>>
>> Thanks.
>>
>> Best regards,
>> Hong
>>
>> --
>> 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/ms
>> gid/jenkinsci-users/a4be1cee-cfd4-48d8-a97e-fa5c30d95ce6%
>> 40googlegroups.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/vAZbO6gCgIY/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/CALHFn6Mht9PHnX7WNFMranPz-J6VvPaQkrx8ci_pDBQ1dGQXcA%
> 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/CADLWyO1%3DP4g8q38BwSeSDmywm47BPjCy_L77uoy%3D%2BGsxVmxx-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does docker-slaves-plugin with pipeline assume Linux?

2017-08-10 Thread nicolas de loof
Oh yes that's a stupid typo in default value, will fix this and push a
release. We are still missing multi arch docker images so this same id can
pull a Windows version of the agent image

Le 10 août 2017 8:51 PM, "Jacob Larsen"  a écrit :

> Looks like the agent image is the default one that was just set in the
> latest release, see https://github.com/jenkinsci/
> docker-slaves-plugin/commit/2d0470b27a84ddff00c3e1adc7aec9b7e8dece00
>
> Take a look at the Docker Slaves section of the global Jenkins
> configuration. The remoting image is probably set to jenkins/agent/.
> Notice the final slash as Slide mentions, I believe the specific error you
> experience would go away by removing that final slash.
>
> Anyhow, that would probably not work for you no matter what. Since you are
> using a Windows Docker instance then you will need Windows images for the
> remoting image and the SCM image. But I have no idea if the volume mounts
> would work there. You might be right that this part is hardcoded to Linux.
>
> /Jacob
>
> On 2017-08-10 18:19, nicolas de loof wrote:
>
> I'm on vacation so can't help before 1 week. Pipeline is fully supported,
> please check global configuration for the agent image you have configured
> for docker-slaves-plugin
>
> Le 10 août 2017 5:30 PM, "Geoff Bache"  a écrit :
>
>>
>> Yes, I didn't contribute anything to that generated command.
>>
>> On Thursday, 10 August 2017 17:22:17 UTC+2, slide wrote:
>>>
>>> The extra slash after "agent" is odd, I assume that the docker create
>>> command is generated by the plugin?
>>>
>>> On Thu, Aug 10, 2017 at 8:14 AM Geoff Bache  wrote:
>>>
 Hi all,



 I have a Jenkins pipeline defined (Windows server 2016) and I’m trying
 to get it to use docker containers instead of building locally. The
 docker-slaves-plugin looked like the most convenient interface for this
 among a confusing forest of different Docker plugins.



 So I installed it and pointed it at my Docker image in the
 configuration. It carried on exactly as before and ignored Docker entirely,
 even after Jenkins restart.



 I then found a hint that I should replace “node” with
 “dockerNode(‘myimage’)” in my Jenkinsfile. So I did that, and got the
 following in my build log (with debug option enabled).

 Note the “docker create” line which seems to be referring to a bunch of
 linux paths that just don’t exist and looks a bit hardcoded...


 If, as I suspect, this isn't supported, any hints on which plugin to
 use instead would be appreciated.



 Regards,

 Geoff Bache



 Start Docker container to host the build

 $ docker volume create

 $ docker create --interactive --log-driver=none --env
 TMPDIR=/home/jenkins/.tmp --user 1:1 --rm --volume
 45aa67db1c5cc27820ebc3afd7abdd4a708b78f8d7ce2720fdbc2c7956ac2a52:/home/jenkins/
 jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp -jar
 /home/jenkins/slave.jar

 Error parsing reference: "jenkins/agent/" is not a valid
 repository/tag: invalid reference format

 [Pipeline] // dockerNode

 [Pipeline] }

 [Pipeline] // stage

 [Pipeline] }

 [Pipeline] // node

 [Pipeline] End of Pipeline

 java.io.IOException: Failed to create docker image

 at it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemoti
 ngContainer(CliDockerDriver.java:176)

 at it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemot
 ingContainer(DefaultDockerProvisioner.java:88)

 at it.dockins.dockerslaves.DockerComputerLauncher.launch(Docker
 ComputerLauncher.java:58)

 at it.dockins.dockerslaves.DockerComputerLauncher.launch(Docker
 ComputerLauncher.java:49)

 at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSl
 ave.java:123)

 Caused: it.dockins.dockerslaves.api.OneShotExecutorProvisioningExcep
 tion

 at it.dockins.dockerslaves.api.OneShotSlave.provisionFailed(One
 ShotSlave.java:145)

 at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSl
 ave.java:129)

 at it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneS
 hotSlave.java:154)

 at it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSla
 ve.java:96)

 at it.dockins.dockerslaves.pipeline.DockerNodeStepExecution$Pla
 ceholderTask$PlaceholderExecutable.run(DockerNodeStepExecuti
 on.java:573)

 at hudson.model.ResourceController.execute(ResourceController.j
 ava:97)

 at hudson.model.Executor.run(Executor.java:405)

 Finished: FAILURE


 --
 You received this message because you are subscribed 

Re: Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-10 Thread Carlos Sanchez
There is a PR for it https://github.com/jenkinsci/kubernetes-plugin/pull/162

On Thu, Aug 10, 2017 at 9:15 PM, YAN-HONG WANG 
wrote:

> Hi,
>
> In jenkins-kubernetes-plugin, is there any syntax that support using *Secrets
> as environment variables* in *containerTemplate*?
>
> I just saw something from here.
> https://kubernetes.io/docs/concepts/configuration/secret/
> #using-secrets-as-environment-variables
>
> So some syntax like "*secretKeyRef*" could be indicated in
> *containerTemplate?*
>
> apiVersion: v1kind: Podmetadata:
>   name: secret-env-podspec:
>   containers:
> - name: mycontainer
>   image: redis
>   env:
> - name: SECRET_USERNAME
>   valueFrom:
> secretKeyRef:
>   name: mysecret
>   key: username
> - name: SECRET_PASSWORD
>   valueFrom:
> secretKeyRef:
>   name: mysecret
>   key: password
>   restartPolicy: Never
>
> Thanks.
>
> Best regards,
> Hong
>
> --
> 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/a4be1cee-cfd4-48d8-a97e-fa5c30d95ce6%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/CALHFn6Mht9PHnX7WNFMranPz-J6VvPaQkrx8ci_pDBQ1dGQXcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-10 Thread YAN-HONG WANG
Hi,

In jenkins-kubernetes-plugin, is there any syntax that support using *Secrets 
as environment variables* in *containerTemplate*?

I just saw something from here.
https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables

So some syntax like "*secretKeyRef*" could be indicated in 
*containerTemplate?*

apiVersion: v1kind: Podmetadata:
  name: secret-env-podspec:
  containers:
- name: mycontainer
  image: redis
  env:
- name: SECRET_USERNAME
  valueFrom:
secretKeyRef:
  name: mysecret
  key: username
- name: SECRET_PASSWORD
  valueFrom:
secretKeyRef:
  name: mysecret
  key: password
  restartPolicy: Never

Thanks.

Best regards,
Hong

-- 
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/a4be1cee-cfd4-48d8-a97e-fa5c30d95ce6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: The format of key of containerEnvVar within Jenkins Kubernetes Plugin

2017-08-10 Thread Carlos Sanchez
You can not use dots in an environment variable

https://kubernetes.io/docs/api-reference/v1.6/#envvar-v1-core


a valid C identifier must start with alphabetic character or '_',
followed by a string of alphanumeric characters or '_'



On Wed, Aug 9, 2017 at 9:18 AM, WANG, YAN-HONG 
wrote:

> Hello,
>
> I am Hong.
>
> I saw "*containerEnvVar*" was supported by Jenkins *Kubernetes* Plugin
> 0.9.
> But, it seems not support some key value with *dot*?
>
> Example in *containerTemplate*:
> *containerEnvVar*( key: “*data.source.url*”, value: “somewhere” )
>
> I tried to use *backslash *to escape *dot*, but Jenkins parser doesn't
> pass it.
>
> Someone has idea?
>
> Thanks very much.
>
> Best regards,
> Hong
>
> --
> 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/ms
> gid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%
> 3DUoi%2Bf%2B-jGP-dg%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/CALHFn6MJxsBOT6_FOn1nyQr%3DNo18SX_bFng_KrWCpzUEn3jwdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does docker-slaves-plugin with pipeline assume Linux?

2017-08-10 Thread Jacob Larsen
Looks like the agent image is the default one that was just set in the 
latest release, see 
https://github.com/jenkinsci/docker-slaves-plugin/commit/2d0470b27a84ddff00c3e1adc7aec9b7e8dece00


Take a look at the Docker Slaves section of the global Jenkins 
configuration. The remoting image is probably set to jenkins/agent/. 
Notice the final slash as Slide mentions, I believe the specific error 
you experience would go away by removing that final slash.


Anyhow, that would probably not work for you no matter what. Since you 
are using a Windows Docker instance then you will need Windows images 
for the remoting image and the SCM image. But I have no idea if the 
volume mounts would work there. You might be right that this part is 
hardcoded to Linux.


/Jacob


On 2017-08-10 18:19, nicolas de loof wrote:
I'm on vacation so can't help before 1 week. Pipeline is fully 
supported, please check global configuration for the agent image you 
have configured for docker-slaves-plugin


Le 10 août 2017 5:30 PM, "Geoff Bache" > a écrit :



Yes, I didn't contribute anything to that generated command.

On Thursday, 10 August 2017 17:22:17 UTC+2, slide wrote:

The extra slash after "agent" is odd, I assume that the docker
create command is generated by the plugin?

On Thu, Aug 10, 2017 at 8:14 AM Geoff Bache
 wrote:

Hi all,

I have a Jenkins pipeline defined (Windows server 2016)
and I’m trying to get it to use docker containers instead
of building locally. The docker-slaves-plugin looked like
the most convenient interface for this among a confusing
forest of different Docker plugins.

So I installed it and pointed it at my Docker image in the
configuration. It carried on exactly as before and ignored
Docker entirely, even after Jenkins restart.

I then found a hint that I should replace “node” with
“dockerNode(‘myimage’)” in my Jenkinsfile. So I did that,
and got the following in my build log (with debug option
enabled).

Note the “docker create” line which seems to be referring
to a bunch of linux paths that just don’t exist and looks
a bit hardcoded...


If, as I suspect, this isn't supported, any hints on which
plugin to use instead would be appreciated.

Regards,

Geoff Bache

Start Docker container to host the build

$ docker volume create

$ docker create --interactive --log-driver=none --env
TMPDIR=/home/jenkins/.tmp --user 1:1 --rm --volume

45aa67db1c5cc27820ebc3afd7abdd4a708b78f8d7ce2720fdbc2c7956ac2a52:/home/jenkins/
jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp
-jar /home/jenkins/slave.jar

Error parsing reference: "jenkins/agent/" is not a valid
repository/tag: invalid reference format

[Pipeline] // dockerNode

[Pipeline] }

[Pipeline] // stage

[Pipeline] }

[Pipeline] // node

[Pipeline] End of Pipeline

java.io.IOException: Failed to create docker image

at

it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:176)

at

it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)

at

it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)

at

it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)

at

it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)

Caused:
it.dockins.dockerslaves.api.OneShotExecutorProvisioningException

at

it.dockins.dockerslaves.api.OneShotSlave.provisionFailed(OneShotSlave.java:145)

at

it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:129)

at

it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)

at

it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)

at

it.dockins.dockerslaves.pipeline.DockerNodeStepExecution$PlaceholderTask$PlaceholderExecutable.run(DockerNodeStepExecution.java:573)

at
hudson.model.ResourceController.execute(ResourceController.java:97)

at hudson.model.Executor.run(Executor.java:405)

Finished: FAILURE

-- 
You received this message because you are subscribed to

the Google Groups "Jenkins Users" group.
To 

Re: Does docker-slaves-plugin with pipeline assume Linux?

2017-08-10 Thread nicolas de loof
I'm on vacation so can't help before 1 week. Pipeline is fully supported,
please check global configuration for the agent image you have configured
for docker-slaves-plugin

Le 10 août 2017 5:30 PM, "Geoff Bache"  a écrit :

>
> Yes, I didn't contribute anything to that generated command.
>
> On Thursday, 10 August 2017 17:22:17 UTC+2, slide wrote:
>>
>> The extra slash after "agent" is odd, I assume that the docker create
>> command is generated by the plugin?
>>
>> On Thu, Aug 10, 2017 at 8:14 AM Geoff Bache  wrote:
>>
>>> Hi all,
>>>
>>>
>>>
>>> I have a Jenkins pipeline defined (Windows server 2016) and I’m trying
>>> to get it to use docker containers instead of building locally. The
>>> docker-slaves-plugin looked like the most convenient interface for this
>>> among a confusing forest of different Docker plugins.
>>>
>>>
>>>
>>> So I installed it and pointed it at my Docker image in the
>>> configuration. It carried on exactly as before and ignored Docker entirely,
>>> even after Jenkins restart.
>>>
>>>
>>>
>>> I then found a hint that I should replace “node” with
>>> “dockerNode(‘myimage’)” in my Jenkinsfile. So I did that, and got the
>>> following in my build log (with debug option enabled).
>>>
>>> Note the “docker create” line which seems to be referring to a bunch of
>>> linux paths that just don’t exist and looks a bit hardcoded...
>>>
>>>
>>> If, as I suspect, this isn't supported, any hints on which plugin to use
>>> instead would be appreciated.
>>>
>>>
>>>
>>> Regards,
>>>
>>> Geoff Bache
>>>
>>>
>>>
>>> Start Docker container to host the build
>>>
>>> $ docker volume create
>>>
>>> $ docker create --interactive --log-driver=none --env
>>> TMPDIR=/home/jenkins/.tmp --user 1:1 --rm --volume
>>> 45aa67db1c5cc27820ebc3afd7abdd4a708b78f8d7ce2720fdbc2c7956ac2a52:/home/jenkins/
>>> jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp -jar
>>> /home/jenkins/slave.jar
>>>
>>> Error parsing reference: "jenkins/agent/" is not a valid repository/tag:
>>> invalid reference format
>>>
>>> [Pipeline] // dockerNode
>>>
>>> [Pipeline] }
>>>
>>> [Pipeline] // stage
>>>
>>> [Pipeline] }
>>>
>>> [Pipeline] // node
>>>
>>> [Pipeline] End of Pipeline
>>>
>>> java.io.IOException: Failed to create docker image
>>>
>>> at it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemoti
>>> ngContainer(CliDockerDriver.java:176)
>>>
>>> at it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemot
>>> ingContainer(DefaultDockerProvisioner.java:88)
>>>
>>> at it.dockins.dockerslaves.DockerComputerLauncher.launch(Docker
>>> ComputerLauncher.java:58)
>>>
>>> at it.dockins.dockerslaves.DockerComputerLauncher.launch(Docker
>>> ComputerLauncher.java:49)
>>>
>>> at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSl
>>> ave.java:123)
>>>
>>> Caused: it.dockins.dockerslaves.api.OneShotExecutorProvisioningException
>>>
>>> at it.dockins.dockerslaves.api.OneShotSlave.provisionFailed(One
>>> ShotSlave.java:145)
>>>
>>> at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSl
>>> ave.java:129)
>>>
>>> at it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneS
>>> hotSlave.java:154)
>>>
>>> at it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSla
>>> ve.java:96)
>>>
>>> at it.dockins.dockerslaves.pipeline.DockerNodeStepExecution$Pla
>>> ceholderTask$PlaceholderExecutable.run(DockerNodeStepExecution.java:573)
>>>
>>> at hudson.model.ResourceController.execute(ResourceController.
>>> java:97)
>>>
>>> at hudson.model.Executor.run(Executor.java:405)
>>>
>>> Finished: FAILURE
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/jenkinsci-users/57ecdf26-75eb-4e04-b93c-35d403283ae1%
>>> 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/dca1ccde-53bb-4056-ba43-68456da927d0%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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

Solid approach to starting Jenkins jobs from Slack?

2017-08-10 Thread Idan Adar
I've scored the web, tried all sort of Hubot plug-ins, Slash Command 
integration in Slack, but it's pretty bad... they either don't work, don't 
support multi-branch jobs, etc...
Has anyone found a solid way to start Jenkins jobs from Slack and can share 
with the rest of us?

-- 
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/66003175-a92f-46f6-bdc7-10b71f8d5802%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does docker-slaves-plugin with pipeline assume Linux?

2017-08-10 Thread Geoff Bache

Yes, I didn't contribute anything to that generated command. 

On Thursday, 10 August 2017 17:22:17 UTC+2, slide wrote:
>
> The extra slash after "agent" is odd, I assume that the docker create 
> command is generated by the plugin?
>
> On Thu, Aug 10, 2017 at 8:14 AM Geoff Bache  > wrote:
>
>> Hi all,
>>
>>  
>>
>> I have a Jenkins pipeline defined (Windows server 2016) and I’m trying to 
>> get it to use docker containers instead of building locally. The 
>> docker-slaves-plugin looked like the most convenient interface for this 
>> among a confusing forest of different Docker plugins.
>>
>>  
>>
>> So I installed it and pointed it at my Docker image in the configuration. 
>> It carried on exactly as before and ignored Docker entirely, even after 
>> Jenkins restart.
>>
>>  
>>
>> I then found a hint that I should replace “node” with 
>> “dockerNode(‘myimage’)” in my Jenkinsfile. So I did that, and got the 
>> following in my build log (with debug option enabled).
>>
>> Note the “docker create” line which seems to be referring to a bunch of 
>> linux paths that just don’t exist and looks a bit hardcoded...
>>
>>
>> If, as I suspect, this isn't supported, any hints on which plugin to use 
>> instead would be appreciated.
>>
>>  
>>
>> Regards,
>>
>> Geoff Bache
>>
>>  
>>
>> Start Docker container to host the build
>>
>> $ docker volume create
>>
>> $ docker create --interactive --log-driver=none --env 
>> TMPDIR=/home/jenkins/.tmp --user 1:1 --rm --volume 
>> 45aa67db1c5cc27820ebc3afd7abdd4a708b78f8d7ce2720fdbc2c7956ac2a52:/home/jenkins/
>>  
>> jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp -jar 
>> /home/jenkins/slave.jar
>>
>> Error parsing reference: "jenkins/agent/" is not a valid repository/tag: 
>> invalid reference format
>>
>> [Pipeline] // dockerNode
>>
>> [Pipeline] }
>>
>> [Pipeline] // stage
>>
>> [Pipeline] }
>>
>> [Pipeline] // node
>>
>> [Pipeline] End of Pipeline
>>
>> java.io.IOException: Failed to create docker image
>>
>> at 
>> it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:176)
>>
>> at 
>> it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)
>>
>> at 
>> it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)
>>
>> at 
>> it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)
>>
>> at 
>> it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)
>>
>> Caused: it.dockins.dockerslaves.api.OneShotExecutorProvisioningException
>>
>> at 
>> it.dockins.dockerslaves.api.OneShotSlave.provisionFailed(OneShotSlave.java:145)
>>
>> at 
>> it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:129)
>>
>> at 
>> it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)
>>
>> at 
>> it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)
>>
>> at 
>> it.dockins.dockerslaves.pipeline.DockerNodeStepExecution$PlaceholderTask$PlaceholderExecutable.run(DockerNodeStepExecution.java:573)
>>
>> at 
>> hudson.model.ResourceController.execute(ResourceController.java:97)
>>
>> at hudson.model.Executor.run(Executor.java:405)
>>
>> Finished: FAILURE
>>
>>  
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/57ecdf26-75eb-4e04-b93c-35d403283ae1%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/dca1ccde-53bb-4056-ba43-68456da927d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does docker-slaves-plugin with pipeline assume Linux?

2017-08-10 Thread Slide
The extra slash after "agent" is odd, I assume that the docker create
command is generated by the plugin?

On Thu, Aug 10, 2017 at 8:14 AM Geoff Bache  wrote:

> Hi all,
>
>
>
> I have a Jenkins pipeline defined (Windows server 2016) and I’m trying to
> get it to use docker containers instead of building locally. The
> docker-slaves-plugin looked like the most convenient interface for this
> among a confusing forest of different Docker plugins.
>
>
>
> So I installed it and pointed it at my Docker image in the configuration.
> It carried on exactly as before and ignored Docker entirely, even after
> Jenkins restart.
>
>
>
> I then found a hint that I should replace “node” with
> “dockerNode(‘myimage’)” in my Jenkinsfile. So I did that, and got the
> following in my build log (with debug option enabled).
>
> Note the “docker create” line which seems to be referring to a bunch of
> linux paths that just don’t exist and looks a bit hardcoded...
>
>
> If, as I suspect, this isn't supported, any hints on which plugin to use
> instead would be appreciated.
>
>
>
> Regards,
>
> Geoff Bache
>
>
>
> Start Docker container to host the build
>
> $ docker volume create
>
> $ docker create --interactive --log-driver=none --env
> TMPDIR=/home/jenkins/.tmp --user 1:1 --rm --volume
> 45aa67db1c5cc27820ebc3afd7abdd4a708b78f8d7ce2720fdbc2c7956ac2a52:/home/jenkins/
> jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp -jar
> /home/jenkins/slave.jar
>
> Error parsing reference: "jenkins/agent/" is not a valid repository/tag:
> invalid reference format
>
> [Pipeline] // dockerNode
>
> [Pipeline] }
>
> [Pipeline] // stage
>
> [Pipeline] }
>
> [Pipeline] // node
>
> [Pipeline] End of Pipeline
>
> java.io.IOException: Failed to create docker image
>
> at
> it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:176)
>
> at
> it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)
>
> at
> it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)
>
> at
> it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)
>
> at
> it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)
>
> Caused: it.dockins.dockerslaves.api.OneShotExecutorProvisioningException
>
> at
> it.dockins.dockerslaves.api.OneShotSlave.provisionFailed(OneShotSlave.java:145)
>
> at
> it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:129)
>
> at
> it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)
>
> at
> it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)
>
> at
> it.dockins.dockerslaves.pipeline.DockerNodeStepExecution$PlaceholderTask$PlaceholderExecutable.run(DockerNodeStepExecution.java:573)
>
> at
> hudson.model.ResourceController.execute(ResourceController.java:97)
>
> at hudson.model.Executor.run(Executor.java:405)
>
> Finished: FAILURE
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/57ecdf26-75eb-4e04-b93c-35d403283ae1%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/CAPiUgVchoy-gy%3Dfkp0S932qKeF3K4f_AY8SCHAESTe%3DSnfr3YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Does docker-slaves-plugin with pipeline assume Linux?

2017-08-10 Thread Geoff Bache
 

Hi all,

 

I have a Jenkins pipeline defined (Windows server 2016) and I’m trying to 
get it to use docker containers instead of building locally. The 
docker-slaves-plugin looked like the most convenient interface for this 
among a confusing forest of different Docker plugins.

 

So I installed it and pointed it at my Docker image in the configuration. 
It carried on exactly as before and ignored Docker entirely, even after 
Jenkins restart.

 

I then found a hint that I should replace “node” with 
“dockerNode(‘myimage’)” in my Jenkinsfile. So I did that, and got the 
following in my build log (with debug option enabled).

Note the “docker create” line which seems to be referring to a bunch of 
linux paths that just don’t exist and looks a bit hardcoded...


If, as I suspect, this isn't supported, any hints on which plugin to use 
instead would be appreciated.

 

Regards,

Geoff Bache

 

Start Docker container to host the build

$ docker volume create

$ docker create --interactive --log-driver=none --env 
TMPDIR=/home/jenkins/.tmp --user 1:1 --rm --volume 
45aa67db1c5cc27820ebc3afd7abdd4a708b78f8d7ce2720fdbc2c7956ac2a52:/home/jenkins/ 
jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp -jar 
/home/jenkins/slave.jar

Error parsing reference: "jenkins/agent/" is not a valid repository/tag: 
invalid reference format

[Pipeline] // dockerNode

[Pipeline] }

[Pipeline] // stage

[Pipeline] }

[Pipeline] // node

[Pipeline] End of Pipeline

java.io.IOException: Failed to create docker image

at 
it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:176)

at 
it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)

at 
it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)

at 
it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)

at 
it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)

Caused: it.dockins.dockerslaves.api.OneShotExecutorProvisioningException

at 
it.dockins.dockerslaves.api.OneShotSlave.provisionFailed(OneShotSlave.java:145)

at 
it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:129)

at 
it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)

at 
it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)

at 
it.dockins.dockerslaves.pipeline.DockerNodeStepExecution$PlaceholderTask$PlaceholderExecutable.run(DockerNodeStepExecution.java:573)

at 
hudson.model.ResourceController.execute(ResourceController.java:97)

at hudson.model.Executor.run(Executor.java:405)

Finished: FAILURE

 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/57ecdf26-75eb-4e04-b93c-35d403283ae1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: curl upload with filename in variable

2017-08-10 Thread Richard Bywater
Taking a look at the error, it appears like you have a line feed or
carriage return at the end of the env.filename variable (note the quote is
on the next line and not next to apk like I'd expect).

Richard.

On Thu, 10 Aug 2017 at 09:40 Curtis Kline  wrote:

> The file exists in the current working directory. This is a three-stage
> project with the agent declared at the global level. It's not running in a
> Docker container, simply on a Linux node. As a test, I included a step
> right before the one I mentioned:
>
> ls -l ${env.filename}
>
> The results seem conclusive:
>
> [Pipeline] sh[JenkinsAndroidTest] Running shell script
> + ls -l Project-debug-v2.1.0-b999.apk
> -rwxrwxrwx 1 jenkins jenkins 33014841 Aug  9 21:01 
> Project-debug-v2.1.0-b999.apk
>
>
>
>
> On Wed, Aug 9, 2017 at 4:26 PM, Slide  wrote:
>
>> Does the file exist in what would be considered the current working
>> directory? Perhaps an ls before the curl to verify?
>>
>> On Wed, Aug 9, 2017 at 2:13 PM Curtis Kline 
>> wrote:
>>
>>> In my declarative pipeline Jenkinsfile, I have the following shell
>>> script line:
>>>
>>> sh """
>>> curl -F "status=2" -F "notify=1" -F "notes=${params.ReleaseNotes}" -F
>>> "ipa=@${env.filename}" -H "X-HockeyAppToken: 1234"
>>> https://rink.hockeyapp.net/api/2/apps/upload
>>> """
>>>
>>> This does not work, because curl is apparently unable to open the file.
>>> The file clearly exists, and the env.filename variable contains the correct
>>> filename (you can see this in the console log below, as the variable has
>>> been expanded to a file name).
>>>
>>> A snippet of my console log is below. I’ve been working on this for a
>>> number of hours, and I could use any help or advice you might have.
>>>
>>> [Pipeline] sh[JenkinsAndroidTest] Running shell script
>>> + curl -F status=2 -F notify=1 -F notes= -F
>>> ipa=@Project-debug-v2.1.0-b999.apk
>>> -H X-HockeyAppToken: 1234 https://rink.hockeyapp.net/api/2/apps/upload
>>>   % Total% Received % Xferd  Average Speed   TimeTime Time
>>> Current
>>>  Dload  Upload   Total   SpentLeft
>>> Speed
>>>
>>>   0 00 00 0  0  0 --:--:-- --:--:--
>>> --:--:-- 0
>>>   0 00 00 0  0  0 --:--:-- --:--:--
>>> --:--:-- 0
>>> curl: (26) couldn't open file “Project-debug-v2.1.0-b999.apk
>>> "
>>> [Pipeline] }
>>>
>>> --
>>> 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/CAGkg-enyw40%3DHNoD85ai%2BFemMjafkJwH9jsswGhJX-KmAr8Qig%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/CAPiUgVfa%2BX14jd_4LvX1CYS_vuWRSYmvvHSh3dHjM9_ApMo5-g%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/CAGkg-enQf5Wd00PPtkNnatYKNcmFjPDxHAoj94JakZe18U88Yg%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/CAMui945v4%3DR_nEFBQ4PyZHN_7vVXsRqFsqEDNgp1Gi2rCd0n-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use podTemplate in a declarative pipeline with the kubernetes-plugin.

2017-08-10 Thread Vincent Heet
Ok so maybe i'm able to add this myself next week. I looked at the class 
you mentioned but would adding the PodTemplate class as a property there 
fix my issue? And I'm not sure why you mention volumes, volumes would then 
be supported from the PodTemplate if I understand this correctly?


On Thursday, August 10, 2017 at 10:27:14 AM UTC+2, Carlos Sanchez wrote:
>
> It is not yet possible. Volumes would need to be added to the class 
> https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesDeclarativeAgent.java
>
> On Thu, Aug 10, 2017 at 9:22 AM, Vincent Heet  > wrote:
>
>> Hi,
>>
>> I configured a declarative pipeline with the kubernetes-plugin to start a 
>> jenkins job's in a k8s cluster. This is working great but now I want to use 
>> volumes for secrets and need to specify a podTemplate. I'm not sure how to 
>> configure a podTemplate for a declarative pipeline. The pipeline that is 
>> working:
>>
>>
>> pipeline {
>> agent {
>> kubernetes {
>> label 'jenkins-demo'
>> containerTemplate {
>> name 'dind-jdk8-maven3'
>> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
>> ttyEnabled true
>> command 'cat'
>> }
>> }
>> }
>> stages {
>> }
>> }
>>
>>
>> The above I would like to extend with a podTemplate containing volumes 
>> and a secretVolume. The issue is that I don't know the correct syntax for 
>> specifying a podTemplate in the declarative pipeline. So I came up with 
>> this:
>>
>>
>> pipeline {
>> agent {
>> kubernetes {
>> label 'jenkins-demo'
>> podTemplate {
>> volumes {
>> secretVolume(secretName: 'some-secret', mountPath: 
>> '/some-secret')
>> }
>> containerTemplate {
>> name 'dind-jdk8-maven3'
>> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
>> ttyEnabled true
>> command 'cat'
>> }
>> }
>> }
>> }
>> stages {
>> }
>> }
>>
>>
>> Ofcourse this doesn't work an throws an error. Can anyone help me out 
>> with specifying a podTemplate so I can use k8s secrets?
>>
>> Thanks,
>> Vincent
>>
>> -- 
>> 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/a69efdfc-7c1c-4e4f-a909-0b43ad95868b%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/4fed7d43-bbbc-46ab-a718-5e7f6e5d2a99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Throttling parallel step

2017-08-10 Thread Mirek S

>
>
> *The only solution I came up with is to create 3 lockable resources of the 
> same label and lock them in each*
> *of the closures. *
>

Now that I think of it - it wouldn't work anyway - another build of this 
job would not be able to reach the test-throttler resources, so it would 
wait for them anyway... 

-- 
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/fed443ff-3256-4a91-98c5-8154d01c6051%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Throttling parallel step

2017-08-10 Thread Mirek S
Hi!

I'm using something like this to run tests in parallel:

stage('Test') {
  steps {
script {
  testing_closures = [one: { print("staring one"); sleep 10; 
print("finishing 
one") },
  two: { print("staring two"); sleep 10; 
print("finishing 
two") },
  three: { print("staring three"); sleep 10; 
print("finishing 
three") },
  four: { print("staring four"); sleep 10; 
print("finishing 
four") },
  five: { print("staring five"); sleep 10; 
print("finishing 
five") },
  six: { print("staring six"); sleep 10; 
print("finishing 
six") }]
  parallel(testing_closures)
}
  }
}


The main goal is to throttle those closures - I don't want for all six of 
them to run concurrently - only 3 at a time.

I was thinking about using nodes for this - i.e. wrapping each closure in 
node{} block:

one: { node { print("staring one"); sleep 10; print("finishing one") } }

Works OK as long as I use master node and limit the executors to 4 (1 for 
main job, 3 for the node{} concurrent steps). 

Unfortunately I need master node executors to be available for other jobs, 
so I cannot limit them.

*So - how do I achieve my goal? Is there a way to create local node similar 
to master, but not master?*

*Or is there another way to throttle parallel step? *


*The only solution I came up with is to create 3 lockable resources of the 
same label and lock them in each*
*of the closures. But in reality my closures are already locking resources 
(for test-machines, there's 7 of them, *
*but I want one build to use only up to 3 of them), so I would have to 
have:*
  lock(label: 'test-host') { 
lock (label: 'test-throttler') { 
  ...code... 
}
  }
*Looks dirty, increases maintenance nightmare and it's adding unnecessary 
resources (which we already have too much) that do*
*not reflect the "real, physical" resource.*

-- 
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/de512d65-2b99-4f85-8a32-69c20cfcbc1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use podTemplate in a declarative pipeline with the kubernetes-plugin.

2017-08-10 Thread Carlos Sanchez
It is not yet possible. Volumes would need to be added to the class
https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesDeclarativeAgent.java

On Thu, Aug 10, 2017 at 9:22 AM, Vincent Heet  wrote:

> Hi,
>
> I configured a declarative pipeline with the kubernetes-plugin to start a
> jenkins job's in a k8s cluster. This is working great but now I want to use
> volumes for secrets and need to specify a podTemplate. I'm not sure how to
> configure a podTemplate for a declarative pipeline. The pipeline that is
> working:
>
>
> pipeline {
> agent {
> kubernetes {
> label 'jenkins-demo'
> containerTemplate {
> name 'dind-jdk8-maven3'
> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
> ttyEnabled true
> command 'cat'
> }
> }
> }
> stages {
> }
> }
>
>
> The above I would like to extend with a podTemplate containing volumes and
> a secretVolume. The issue is that I don't know the correct syntax for
> specifying a podTemplate in the declarative pipeline. So I came up with
> this:
>
>
> pipeline {
> agent {
> kubernetes {
> label 'jenkins-demo'
> podTemplate {
> volumes {
> secretVolume(secretName: 'some-secret', mountPath:
> '/some-secret')
> }
> containerTemplate {
> name 'dind-jdk8-maven3'
> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
> ttyEnabled true
> command 'cat'
> }
> }
> }
> }
> stages {
> }
> }
>
>
> Ofcourse this doesn't work an throws an error. Can anyone help me out with
> specifying a podTemplate so I can use k8s secrets?
>
> Thanks,
> Vincent
>
> --
> 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/a69efdfc-7c1c-4e4f-a909-0b43ad95868b%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/CALHFn6PZQNMYN3FWH9i9OkMGWrTaeR6L6oHrMe7OoQ60v1QhSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to use podTemplate in a declarative pipeline with the kubernetes-plugin.

2017-08-10 Thread Vincent Heet
Hi,

I configured a declarative pipeline with the kubernetes-plugin to start a 
jenkins job's in a k8s cluster. This is working great but now I want to use 
volumes for secrets and need to specify a podTemplate. I'm not sure how to 
configure a podTemplate for a declarative pipeline. The pipeline that is 
working:


pipeline {
agent {
kubernetes {
label 'jenkins-demo'
containerTemplate {
name 'dind-jdk8-maven3'
image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
ttyEnabled true
command 'cat'
}
}
}
stages {
}
}


The above I would like to extend with a podTemplate containing volumes and 
a secretVolume. The issue is that I don't know the correct syntax for 
specifying a podTemplate in the declarative pipeline. So I came up with 
this:


pipeline {
agent {
kubernetes {
label 'jenkins-demo'
podTemplate {
volumes {
secretVolume(secretName: 'some-secret', mountPath: 
'/some-secret')
}
containerTemplate {
name 'dind-jdk8-maven3'
image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
ttyEnabled true
command 'cat'
}
}
}
}
stages {
}
}


Ofcourse this doesn't work an throws an error. Can anyone help me out with 
specifying a podTemplate so I can use k8s secrets?

Thanks,
Vincent

-- 
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/a69efdfc-7c1c-4e4f-a909-0b43ad95868b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Affordable solution for Jenkins CI and build slaves in the cloud?

2017-08-10 Thread Victor Martinez

If you mean to backup your Jenkins server, then read below:

   In my case I've been using tools such as:

   - *Puppet*: https://github.com/jenkinsci/puppet-jenkins
   - *Chef*: https://github.com/chef-cookbooks/jenkins
   - *Ansible*: https://github.com/geerlingguy/ansible-role-jenkins
   
*NOTE*: You can use *docker* 
(https://hub.docker.com/r/jenkins/jenkins/) although the complexity will be 
with a live and continuous up to date instance, in my opinion. 

   The second part is about using a subset of the Configuration as Code 
tools such as:

   - *Pipelines*: https://jenkins.io/doc/book/pipeline/
   - *JobDSL*: https://github.com/jenkinsci/job-dsl-plugin/wiki
   - *Jenkins Job Builder*
   : https://docs.openstack.org/infra/jenkins-job-builder/
   
Finally, you can automate the last bits and pieces using *Groovy* and 
the *https://wiki.jenkins.io/display/JENKINS/Post-initialization+script*

The above suggestion is based on the Configuration as Code paradigm and 
being able to specify the current jenkins instance state either 
programmatically or with some configuration in code. 

My two cents

-- 
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/eca4514c-6eef-4c44-b5e3-edea64aede46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: curl upload with filename in variable

2017-08-10 Thread Victor Martinez
Couple of thoughts:

- ${params.ReleaseNotes} doesn't look it got any value, then it might be 
one of the root causes, 
- if you use the -v flag, does it give you any details?


sh """
ls -l ${env.filename}
curl -v -F "status=2" -F "notify=1" -F "notes=${params.ReleaseNotes}" -F "
ipa=@${env.filename}" -H "X-HockeyAppToken: 1234" 
https://rink.hockeyapp.net/api/2/apps/upload
"""


Cheers

-- 
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/b7e0a9d6-ba48-4653-9311-f0f71caec128%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Parameterized build driven by Jenkinsfile

2017-08-10 Thread Craig Barr
Thanks Jacob. That worked exactly as I would expect!

On Thu, Aug 10, 2017 at 5:40 AM, Jacob Larsen  wrote:

> Try this:
> properties([
> parameters([
> string(name: 'bld', defaultValue: 'full', description: ''),
> string(name: 'branch', defaultValue: 'dev', description: '')
> ])
> ])
>
> /Jacob
>
>
> On 2017-08-09 03:54, Craig Barr wrote:
>
> Thanks Jacob and Alex!
>
> Which version of Jenkins does this work for you on?
> I've tried with the following Jenkinsfile on 2.46.1 but no matter how many
> times I ran, the parameters never showed up in the console.
>
> parameters {
>
>string(name: 'bld', defaultValue: 'full', description: '')
>
>string(name: 'branch', defaultValue: 'dev', description: '')
>
> }
>
>
> node {
>
>if (getBinding().hasVariable("bld")) {
>
>   echo "SET"
>
>} else {
>
>   echo "NOTSET"
>
>}
>
> }
>
> On Friday, 4 August 2017 03:27:44 UTC+10, Alex Marcon wrote:
>>
>> That's right... to define, it is something like:
>>
>> parameters {
>> string(name: 'bld', defaultValue: 'full', description: '')
>> string(name: 'branch', defaultValue: 'dev', description: '')
>> }
>>
>> you may load some properties from a file and use those variables for
>> defaultValue...
>>
>> AM
>>
>> On Thursday, 3 August 2017 04:13:54 UTC-4, Jacob Larsen wrote:
>>>
>>> Yes, kind of...
>>>
>>> The parameters are hidden in the "properties" structure. They will be
>>> applied to the job when it runs, meaning that the first run will not have
>>> these parameters defined. If you make your Jenkinsfile robust for undefined
>>> parameters, it should be doable, just remember that they will apply to the
>>> second build.
>>>
>>> /Jacob
>>>
>>> On 2017-08-03 04:03, Craig Barr wrote:
>>>
>>> In Jenkins you can select "This project is parameterized" and add
>>> parameters. My question is simple:
>>> Can this parameter metadata be populated by an alternative
>>> version-controlled source?
>>>
>>> For example, can I define parameter definitions in my Jenkinsfile so
>>> that when I click Build Now it will populate the parameters from this
>>> source?
>>> If this is not possible, are they any other suggestions for addressing
>>> such a requirement?
>>>
>>> Thanks!
>>>
>>> *Oracle Excellence Award Specialized Partner of the Year: Middleware,
>>> Asia Pacific
>>> *
>>>
>>>
>>>
>>> Rubicon Red Privacy Policy 
>>>
>>> --
>>> 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/ms
>>> gid/jenkinsci-users/eb7dca33-81d0-4b35-9045-0ab521327109%
>>> 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/e4e728c9-553a-4720-96c7-5ac29bddabb8%40googlegroups.
> 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/oRhJRoBgWfc/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/0978cc69-5cbe-6737-a7dc-802fc3dc1511%40larsen.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/CAOF_U2rK5Wn7Dv6MBsavf%3DjcnCFVa%2Bw%2B_h5b1%2BhRgtUcO7gu0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.