Re: Parameterized build driven by Jenkinsfile

2017-08-03 Thread Jacob Larsen

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-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/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/ef2112a4-a9a0-36be-c420-b3a5d674acb7%40larsen.net.
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-13 Thread Jacob Larsen

Wouldn't you need a Windows SCM image as well?


On 2017-08-12 18:56, nicolas de loof wrote:
I think you just miss a Jenkins agent docker image for Windows 
architecture, everything else should work (linux style paths aren't an 
issue afaik)


Le 11 août 2017 16:37, "Thiago Carvalho Davila" 
> a 
écrit :


That is very sad.. I have slaves for windows and linux, and I was
begining a migration of my machine slaves to containers =(

Is there a JIRA feature created for that cause?

Em 11/08/2017 04:52:49, Geoff Bache escreveu:


OK, I think we can conclude from my evidence that it doesn't
yet work on Windows then: I'm not trying to do anything beyond
basic usage. Perhaps you could write this in the plugin
description?

On Friday, 11 August 2017 09:08:51 UTC+2, nicolas de loof wrote:

This plugin has never been tested for Windows containers,
so I can't tell if they can work without changes.

Le 11 août 2017 9:04 AM, "Geoff Bache"
 a écrit :


I removed the extra slash in global configuration, but
it still fails and there are still Linux-style paths
that I don't seem to be able to configure. See text below.
I also tried using jenkinsci/slave, which the tooltip
recommends, but got the same error.

/Geoff

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

20cf056ee345717252ece59811047e0692a9bea818f5ca23b79af77f220dbd0a:/home/jenkins/
jenkins/agent java -Djava.io.tmpdir=/home/jenkins/.tmp
-jar /home/jenkins/slave.jar Error response from
daemon: invalid bind mount spec

"20cf056ee345717252ece59811047e0692a9bea818f5ca23b79af77f220dbd0a:/home/jenkins/":
invalid volume specification:

'20cf056ee345717252ece59811047e0692a9bea818f5ca23b79af77f220dbd0a:\home\jenkins\'


On Thursday, 10 August 2017 17:14:30 UTC+2, 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)


Re: The official docker image jenkins/jenkins:lts is missing ruby

2017-07-27 Thread Jacob Larsen
I agree. Extending the base image is the way to go. Alternatively, you 
can use a clean image for the master and set up slaves with ruby, 
labeled appropriately.


/Jacob


On 2017-07-27 16:02, Mark Waite wrote:
I would be very surprised if the Jenkins docker image were extended to 
include ruby.  Ruby is not a mandatory requirement for Jenkins 
development and adding it to the base Jenkins Docker image will 
increase the size of the docker image for all Jenkins users.


Mark Waite

On Thu, Jul 27, 2017 at 3:33 AM Federico Paolantoni 
> 
wrote:


Dear list,
I'm setting up a software development lifecycle infrastructure.
I decided to use the official docker container provided by Jenkins
community and the idea is not to extend it writing my own image
avoiding the amount of work required to maintain an image and to
keep as standard as possible.
But:
I noticed that ruby is not provided with the container, so i
wonder if the community is considering to add it on the official
supported image, considering that there is no way to inject ruby,
rake an gems inside the builds as done for nodejs,

Thank you


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

Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to jenkinsci-users+unsubscr...@googlegroups.com
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/jenkinsci-users/29e93174-df1e-4d7f-a36c-e47780fc7d77%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/CAO49JtEsoZw5kcnrv750wFn6BbOWO5_8vH5ZcDOsHmc9B-7usg%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/e61bcd3c-6ef6-f141-d92f-5321f6bf74fe%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: Parameterized build driven by Jenkinsfile

2017-08-09 Thread Jacob Larsen

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

<http://www.rubiconred.com/oracle-excellence-award-specialized-partner-of-the-year-middleware-asia-pacific/>_



Rubicon Red Privacy Policy
<http://www.rubiconred.com/privacy-policy-2/>

-- 
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/eb7dca33-81d0-4b35-9045-0ab521327109%40googlegroups.com

<https://groups.google.com/d/msgid/jenkinsci-users/eb7dca33-81d0-4b35-9045-0ab521327109%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout
<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 
<mailto: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 
<https://groups.google.com/d/msgid/jenkinsci-users/e4e728c9-553a-4720-96c7-5ac29bddabb8%40googlegroups.com?utm_medium=email_source=footer>.

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/0978cc69-5cbe-6737-a7dc-802fc3dc1511%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.60.1 With Java 7 Slave Node

2017-06-24 Thread Jacob Larsen
Sounds like you need something that isolates the "Jenkins Slave" 
functionality from your build environment. I see these solutions:


A new machine with the Jenkins Slave that does SSH to your CentOS 5 
build environment in the build step.


Put your CentOS 5 build environment in a Docker container and use one of 
these plugins:


* Docker Slaves: This plugin is marked as experimental and has not seen 
any updates this year. It works with some kinks. E.g. There is no limit 
on how many nodes it can start at once when using pipeline. This 
dynamically provisions a full slave for each build.


* Cloudbees Docker Custom Build Environment plugin. This plugin has not 
seen any updates for a couple of years, but a new maintainer is getting 
started now. This plugin attaches on an existing slave and uses the 
Jenkins Slave mechanisms for scheduling. It lacks pipeline support and 
does not work if the slave itself is running as a Docker container.


/Jacob


On 2017-06-24 07:27, Conrad T. Pino wrote:


  * A secure Java 8 JRE is unavailable on CentOS 5.
  o Oracle JRE free support ended long ago.
  o OpenJDK 8 binary packages unavailable.
  o Fedora EPEL latest is OpenJDK 1.7.0_131
  * Can Jenkins 2.60.1 work with Java 7 JRE slaves?

--
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/291EDBE6054F46C6BA60EBE29665EBBB%40skyline.pino.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/901ac4d5-2e55-4803-74e3-ea2aea66a9fb%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins LTS - where to find info for next release/timeframe

2017-06-19 Thread Jacob Larsen
If you look at https://jenkins.io/download/lts/ there is a link to 
https://jenkins.io/event-calendar/ where you can see the schedule.


/Jacob


On 2017-06-19 17:49, Tammy Osborn wrote:
I happened to see some info in another thread for this group that the 
next LTS release is 2.60.1


But I couldn't find that info on any of the LTS Wiki pages. I also 
would like to find out the general timeframe for the next release.


Where can I go to get up-to-date info on the LTS schedule?

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/c19074bd-743b-4c23-8785-faba2f7f7167%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/e892722b-857a-5985-1118-c5794e0a12e9%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: Docker Slaves like plugin

2017-05-26 Thread Jacob Larsen
I found another plugin, CloudBees Docker Custom Build Environment plugin 
from same author. This plugin also looks abandoned and is marked for 
adoption, but it actually looks to be pretty close to what I need. It just 
lacks pipeline support from what I can tell. And possibly a way to define a 
named volume as jenkins home instead of a host mount in order to support a 
jenkins slave running in a sibling container.

Any advice?

/Jacob

Den fredag den 26. maj 2017 kl. 00.08.23 UTC+2 skrev Jacob Larsen:
>
> Does anybody know what will happen to the Docker Slaves plugin? It looks 
> like development has halted when looking at commit activity. I took a look 
> at the Dockins stuff, but it looks like that is just as dead. Does anybody 
> know where I should look if I have these requirements:
> * The jenkins slave does not run inside the build container (This is the 
> main feature of Docker Slaves)
> * Multiple docker hosts supported, selectable by label just like any other 
> jenkins slave (Missing feature in Docker Slaves)
> * Number of containers for each docker host can be limited (Feature in 
> Docker Slaves that is not working)
>
> Ideally, I imagine a setup where a jenkins slave can control a docker host 
> on the same machine, possibly marked with slave labels like other special 
> capabilities. Each dockerNode (or similar) will then take an executor on 
> one of these slaves an start the job with the defined image. That image 
> will then not need any jenkins-specific content, but can focus on just the 
> stuff needed for that particular build. At the same time, the jenkins 
> resource control ensures the load matches the capabilities of each docker 
> host.
>
> What would be the best approach to getting something like this? Does 
> another plugin exist for this or would I need to throw myself into the 
> plugin development? If Docker Slaves is indeed dead, I guess it could 
> serve as a base for this.
>
> /Jacob
>
>

-- 
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/85614c80-5a10-409b-96c3-bcf7e7fdd8c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Docker Slaves like plugin

2017-05-25 Thread Jacob Larsen
Does anybody know what will happen to the Docker Slaves plugin? It looks 
like development has halted when looking at commit activity. I took a look 
at the Dockins stuff, but it looks like that is just as dead. Does anybody 
know where I should look if I have these requirements:
* The jenkins slave does not run inside the build container (This is the 
main feature of Docker Slaves)
* Multiple docker hosts supported, selectable by label just like any other 
jenkins slave (Missing feature in Docker Slaves)
* Number of containers for each docker host can be limited (Feature in 
Docker Slaves that is not working)

Ideally, I imagine a setup where a jenkins slave can control a docker host 
on the same machine, possibly marked with slave labels like other special 
capabilities. Each dockerNode (or similar) will then take an executor on 
one of these slaves an start the job with the defined image. That image 
will then not need any jenkins-specific content, but can focus on just the 
stuff needed for that particular build. At the same time, the jenkins 
resource control ensures the load matches the capabilities of each docker 
host.

What would be the best approach to getting something like this? Does 
another plugin exist for this or would I need to throw myself into the 
plugin development? If Docker Slaves is indeed dead, I guess it could 
serve as a base for this.

/Jacob

-- 
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/4a8221c1-3217-4b00-8ff1-598f6c739874%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Gerrit differentiate between a verification build and a merge build

2017-05-24 Thread Jacob Larsen
Have you tried just adding the gerrit trigger for change merged instead of 
polling SCM? 

Also, your condition looks wrong, try this:

if [ -z "${GERRIT_EVENT_TYPE}" ] || [ "$GERRIT_EVENT_TYPE" == 
'change-merged' ]

/Jacob

Den tirsdag den 23. maj 2017 kl. 20.58.51 UTC+2 skrev John Mellor:
>
> I am using a single Jenkins job for each project in git, with a Gerrit 
> server.  Some of the build steps in these builds push Docker images to the 
> registry.  I am trying to prevent Gerrit verification builds from pushing 
> these images, while allowing merge and push-button builds to do so.
>
> In the simplest case, no other person is making changes to this project, 
> and this is their only change.
>
> I have Gerrit triggers set for Patchset Created and Draft Published, and a 
> 5-minute Poll SCM timer set to catch merges.  The default GERRIT_BRACH and 
> GERRIT_REFSPEC are set to master and refs/for/master respectively.
> In the body of the build script, I have:
>
>> if [ -z "${GERRIT_EVENT_TYPE}" -o "$GERRIT_EVENT_TYPE" = 'change-merged' ]
>> then
>> docker push $TAG
>> else
>> echo 'You should not push a verification build'
>> fi
>>
> so that push-button builds and merge builds will push the docker image.
>  
> A change is made on a refs/for/ branch, and this triggers a 
> verification build. The GERRIT_EVENT_TYPE environment variable is set to 
> patchset
> -created, as expected.  I use this value in the build scripting to 
> determine that the docker push should not be performed.
>
> At some point, the change is verified, code-reviewed and then merged.
> However, it appears that Git/Gerrit is determining that the change on the 
> refs/for/ branch will be the same as the merged code, and the 
> timer being used to detect a merge does not detect a change, and no merge 
> build occurs.
>
> The only way out appears to be to push the image from all verification 
> builds as well as merge builds, which is killing the registry and the 
> downstream processes that need to somehow weed out all the unwanted 
> verification build pushes.  That's a huge amount of unexpected work for 
> ~300 builds, and is unsustainable.
>
> What am I doing wrong?  How can I successfully differentiate between a 
> verification build and a merge build?
>
>
>

-- 
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/e87952c8-658f-4d57-9d65-702f1af62051%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Debian version of docker image jenkins/jenkins:lts

2017-09-13 Thread Jacob Larsen
What happened to the debian version of the official docker image named 
jenkins/jenkins:lts? When I pull that image right now, I get an image 
built on alpine. Was there an official decision to switch I could not 
find any mention of, or was it overwritten by mistake?


/Jacob

--
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/3339b37d-a7d3-8ad4-09bd-e4b19a27ee6d%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins docker image create first admin user

2017-08-29 Thread Jacob Larsen

Yes. Put this snippet into a .groovy file, e.g. usercreate.groovy:

instance = Jenkins.getInstance()

def hudsonRealm = new hudson.security.HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("admin","Password1234")
instance.setSecurityRealm(hudsonRealm)
def strategy = new hudson.security.GlobalMatrixAuthorizationStrategy()
strategy.add(Jenkins.ADMINISTER, "admin")
instance.setAuthorizationStrategy(strategy)
instance.save()

Put the usercreate.groovy file next to your Dockerfile. Then add this 
line to your Dockerfile:


COPY usercreate.groovy /usr/share/jenkins/ref/init.groovy.d/

When Jenkins starts, a user with name "admin" will then be created with 
password "Password1234". Note the plaintext password, I'm not sure how 
to use a hash for this one.


This code will run every time Jenkins starts, so you may need to add a 
guard that checks if the admin user exists and only run the code if it 
does not exists.


/Jacob


On 2017-08-29 18:57, Li Z wrote:
I am trying to build a Jenkins docker image from jenkins/jenkins:2.67. 
Is there a way to create the first admin user with dockerfile? 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/3927c485-df73-4fb0-82b0-70363846f432%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/faa79228-2f64-7ba6-7114-fcb0bf001def%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: Build Docker Image from a Dockerized Jenkins

2017-12-03 Thread Jacob Larsen
I wouldn't use Docker Slaves for this. Just install the docker client in 
your Jenkins image and bind mount /var/run/docker.sock. Then a simple sh 
step with docker build + docker push should do the trick.


If you don't want to use your jenkins master for this, you could make a 
slave container with these tools and bind mount.


The Docker Slaves plugin is more about running your builds in containers 
than it is about building images.


/Jacob


On 2017-12-03 18:42, Jeeva Chelladhurai wrote:

Hello All,

I would like to build Docker images from a Dockerized Jenkins. There 
are multiple solution out there but what is the recommended solution...


I have been using ssh node as a work around, but I was told to use 
https://wiki.jenkins.io/display/JENKINS/Docker+Slaves+Plugin . In 
order for this plugin to work, I have to install docker inside the 
Jenkins (my docker host is RHEL) and also mount the 
/var/run/docker.sock or enable TLS. Isn't installing docker blow up 
the size of the Jenkins image?


Any way to install just the docker client in side the Jenkins image?

Thanks,
Jeeva

--
Jeeva K S Chelladhurai

--
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/CAK5CbZV3Sc-fgYS_34PgEwRzsF20%3Dp6mbaagbR2Ehtz01op2%3Dw%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/2162124b-1539-acc7-e92c-56ac5674aa7c%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: Build Docker Image from a Dockerized Jenkins

2017-12-04 Thread Jacob Larsen
Here is a list of the options I know, but one important aspect to this 
is if you use pipeline or not in your builds as that affects your choices:


Docker Custom Build Environment Plugin. This will use an existing 
executor to launch a container with the build. The images used need not 
be aware of Jenkins or dependencies. When I looked at it, it seemed 
abandoned, but it looks like someone is trying to pick it up again. It 
will probably take some time before it is up to date with new docker and 
Jenkins features. E.g. last I checked, pipeline was not supported. Also, 
it only works from physical Jenkins nodes.


Docker Slaves Plugin. This will provision slave containers on the fly 
from a single Docker host. Images need not be aware of Jenkins or 
dependencies. Limit on containers launched did not work for pipeline 
jobs last I checked. Also, this only works on a single Docker host.


Docker Pipeline Plugin https://plugins.jenkins.io/docker-workflow. I 
just learned about this one from the previous message, but looking at 
the adoption rate, this must be the mainstream option. Odds are this 
would be your best bet to start, provided you are using pipeline.


Using a build wrapper like SCUBA: 
https://github.com/JonathonReinhart/scuba in a shell step. This has the 
benefit of enabling manual/development builds to use the same steps as 
the automated Jenkins builds. For that particular wrapper, it does not 
support running from inside a container and creating sibling containers. 
I am considering a PR for that, but I think there are other wrappers 
that might support something like this.


There are plugins that dynamically provision slaves from images and run 
builds on those. The common drawback for these would be that the images 
themselves must support running a jenkins Slave, e.g. have a Java 
runtime of a certain version installed.


/Jacob


On 2017-12-04 17:37, Jeeva Chelladhurai wrote:
I would like to run my builds inside docker, so that I can manage 
different run times like node, python, go thru docker images.


- Jeeva

On Mon, Dec 4, 2017 at 5:51 PM, nicolas de loof 
> wrote:


(another) plugin of mines.
Same design as docker-pipeline's "docker.inside"

Can you please describe your use-case so we give better advise ?

if you just want to "build Docker images" as your initial message
told, then just run "docker build" within your job, what else ?

2017-12-04 13:15 GMT+01:00 Jeeva Chelladhurai >:

Any  thoughts on

https://wiki.jenkins.io/display/JENKINS/CloudBees+Docker+Custom+Build+Environment+Plugin



On Mon, Dec 4, 2017 at 12:04 PM, Jeeva Chelladhurai
> wrote:



I have not tried this, so, cannot vouch for this.
Please be cautious about the approach presented in
this blog.

http://niels.nu/blog/2017/continuous-blog-delivery-p2.html

: you might be interested in Docker-in-Docker.


Thanks for the suggestion.. Docker-in-Docker is been
discouraged here is good read on it

https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/



- Jeeva




-- 
Jeeva K S Chelladhurai


-- 
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/CAK5CbZVSDwjOAUe_uB_u89GRufSrbk2MyeUzSHz9w88K6af0QA%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/CANMVJznKg%3DXKpeaT62PVkmEvLh4kruCyc1HV%2BQGFNtnjLhX%3DLQ%40mail.gmail.com


Re: Build Docker Image from a Dockerized Jenkins

2017-12-05 Thread Jacob Larsen



On 2017-12-05 09:03, nicolas de loof wrote:



2017-12-04 21:38 GMT+01:00 Jacob Larsen <ja...@larsen.net 
<mailto:ja...@larsen.net>>:


Here is a list of the options I know, but one important aspect to
this is if you use pipeline or not in your builds as that affects
your choices:

Docker Custom Build Environment Plugin. This will use an existing
executor to launch a container with the build. The images used
need not be aware of Jenkins or dependencies. When I looked at it,
it seemed abandoned, but it looks like someone is trying to pick
it up again. It will probably take some time before it is up to
date with new docker and Jenkins features. E.g. last I checked,
pipeline was not supported. Also, it only works from physical
Jenkins nodes.

pipeline is not supported by this plugin as the exact equivalent (even 
code is a re-implementation) is docker-pipeline's "inside".


Yes I just discovered this plugin myself. Not sure how I missed it.


Docker Slaves Plugin. This will provision slave containers on the
fly from a single Docker host. Images need not be aware of Jenkins
or dependencies. Limit on containers launched did not work for
pipeline jobs last I checked. Also, this only works on a single
Docker host.

docker-slaves-plugin do NOT require image to be aware of Jenkins or 
dependencies, you can use arbitrary docker image, even without a JDK. 
This was one initial goal of this plugin.


I hope that was what I wrote too. An important feature IMO.

For myself I am moving towards a setup where the docker run is handled 
by the build logic in the workspace and not by the automation 
tool/jenkins plugins. I hope this can let development builds get closer 
to the automated ones.
This involves a one-shot docker run wrapper of some sorts instead of 
Jenkins plugins. Still investigating though.




Docker Pipeline Plugin https://plugins.jenkins.io/docker-workflow
<https://plugins.jenkins.io/docker-workflow>. I just learned about
this one from the previous message, but looking at the adoption
rate, this must be the mainstream option. Odds are this would be
your best bet to start, provided you are using pipeline.

Using a build wrapper like SCUBA:
https://github.com/JonathonReinhart/scuba
<https://github.com/JonathonReinhart/scuba> in a shell step. This
has the benefit of enabling manual/development builds to use the
same steps as the automated Jenkins builds. For that particular
wrapper, it does not support running from inside a container and
creating sibling containers. I am considering a PR for that, but I
think there are other wrappers that might support something like this.

There are plugins that dynamically provision slaves from images
and run builds on those. The common drawback for these would be
that the images themselves must support running a jenkins Slave,
e.g. have a Java runtime of a certain version installed.

/Jacob


On 2017-12-04 17:37, Jeeva Chelladhurai wrote:

I would like to run my builds inside docker, so that I can manage
different run times like node, python, go thru docker images.

- Jeeva

On Mon, Dec 4, 2017 at 5:51 PM, nicolas de loof
<nicolas.del...@gmail.com <mailto:nicolas.del...@gmail.com>> wrote:

(another) plugin of mines.
Same design as docker-pipeline's "docker.inside"

Can you please describe your use-case so we give better advise ?

if you just want to "build Docker images" as your initial
message told, then just run "docker build" within your job,
what else ?

2017-12-04 13:15 GMT+01:00 Jeeva Chelladhurai
<sje...@gmail.com <mailto:sje...@gmail.com>>:

Any  thoughts on

https://wiki.jenkins.io/display/JENKINS/CloudBees+Docker+Custom+Build+Environment+Plugin

<https://wiki.jenkins.io/display/JENKINS/CloudBees+Docker+Custom+Build+Environment+Plugin>

On Mon, Dec 4, 2017 at 12:04 PM, Jeeva Chelladhurai
<sje...@gmail.com <mailto:sje...@gmail.com>> wrote:



I have not tried this, so, cannot vouch for this.
Please be cautious about the approach presented
in this blog.

http://niels.nu/blog/2017/continuous-blog-delivery-p2.html
<http://niels.nu/blog/2017/continuous-blog-delivery-p2.html>
: you might be interested in Docker-in-Docker.


Thanks for the suggestion.. Docker-in-Docker is been
discouraged here is good read on it

https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/

<https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/>

- Jeeva





Re: How to run jobs on oraclelinux container.

2018-01-18 Thread Jacob Larsen
Yes. Docker plugin isn't able to separate the build environment from the 
Jenkins slave though. The images used are more traditional slaves with 
the jenkins slave daemon running inside the same container, which means 
that the jenkins slave dependencies must be mixed with the build 
environment. The one property shared with the 3 first solutions is that 
they only need the build environments themselves, as the slave daemon 
runs outside this container.


/Jacob


On 2018-01-18 07:41, Dirk Heinrichs wrote:

Am 17.01.2018 um 20:57 schrieb Jacob Larsen:


1. Use Docker Slaves Plugin

2. Use Cloudbees Docker Custom build environment plugin

3. Use the Docker Pipeline plugin, specifically the .inside syntax



4. Use Docker plugin: Multiple Docker hosts, Container templates must 
be defined either globally or in job configs (which will then add them 
to each defined Docker host in the global config). Support SSH and 
JNLP slaves.


HTH...

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

*Website*: www.recommind.de <http://www.recommind.de>

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

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


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


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


--
You received this message because you are subscribed to the Google 
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to jenkinsci-users+unsubscr...@googlegroups.com 
<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/191ddd71-5f8f-aab7-dc3c-5bd5f10815d5%40opentext.com 
<https://groups.google.com/d/msgid/jenkinsci-users/191ddd71-5f8f-aab7-dc3c-5bd5f10815d5%40opentext.com?utm_medium=email_source=footer>.

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/583f73cb-6d4f-44e8-1e1b-aa7042c43d29%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Re: How to run jobs on oraclelinux container.

2018-01-17 Thread Jacob Larsen
There are 3 ways I know of that allows you to avoid having the Jenkins 
slave dependency in the container:


1. Use Docker Slaves Plugin

    - Has some limitations, but works for the most part. Supports 
pipeline at least partially, and can run on dockerized slaves. Will not 
run directly on existing slaves but will provision on the fly from 
docker. Only supports one docker host and a single global limit on 
number of containers.


2. Use Cloudbees Docker Custom build environment plugin

    - A bit old codebase, that does not support newer docker features. 
Does not support running as a sibling container to a jenkins slave 
container. No pipeline support. Uses existing slaves that must have 
docker support, so multiple docker hosts are possible. Someone requested 
to adopt this plugin some time ago, so this can change over time.


3. Use the Docker Pipeline plugin, specifically the .inside syntax

    - This only supports pipeline, nothing else. Very mature and is the 
new way to do this. Uses existing slaves that must have docker support, 
so multiple docker hosts are possible. Supports running as a sibling 
container to a Jenkins slave container (with docker socket bind mounted).


All 3 have the property that you can use any oracle linux image that you 
have without worrying about installing the correct JRE version for 
Jenkins. The actual Jenkins node can be any slave with Docker running.


Note that this has the added bonus that a new container is created for 
every build, so anything your builds can do to your build environment 
will not affect future builds.


IMO, your best bet is option 3 if you can, i.e. you have everything 
running in pipeline.


/Jacob

On 2018-01-16 10:36, pbasanta2...@gmail.com wrote:

Hi ,

We have a problem on Jenkins on which container the job will run.

By default jenkins job is using jnlp container to run the Jobs.

inorder to run the jobs on the oraclelinux image.

1. We Successfully created docker-jnlp-slave image with oraclelinux image.
2. Able to pull docker-jnlp-slave image and create container.
3. Jnlp and docker-jnlp-slave(oraclelinux ) 2 containers created.
Test job console output shows that , By default jenkins job is using 
jnlp container (jenkins/jnlp-slave:alpine)


is there a way to run jobs on oraclelinux container.

Regards,
Basanta
--
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/34b309e6-2bd6-4c57-9e5a-5b3696f247d8%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/f51558b6-912a-e936-db50-15606c5b070e%40larsen.net.
For more options, visit https://groups.google.com/d/optout.


Github plugin warning on shared library from gerrit

2018-03-10 Thread Jacob Larsen

Hi

After upgrading a bunch of plugins, I have noticed a number of warnings 
in my Jenkins system log. Every 3 minutes, I see a bunch of these:


com.cloudbees.jenkins.GitHubRepositoryName create

WARNING: Could not match URL ssh://192.168.42.13:29418/jenkins-util

This is the place where I store my global Shared Pipeline Library code. 
It is on a local Gerrit server and has nothing to do with GitHub as such.


My system contains 3 parallel organization folders, 1 custom for gerrit 
using a python script and Job DSL plugin, 1 GitHub organization folder 
and 1 BitBucket organization folder, each having the same set of 
repositories. They all refer to the shared library stored in Gerrit for 
common/boilerplate functionality.


The number of warnings matches exactly the number of jobs for each 
organization folder.


The primary suspect is the github organization folder/branch source and 
related plugins. Does anyone know of something in there that assumes any 
shared libraries are from github?


The warning itself comes from the github plugin, something tries to 
validate the URL to my shared library as a github URL. This fails since 
it is not stored on github.


Any pointers appreciated. I'm not sure where to start looking for this.


/Jacob

--
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/e2476643-3a9e-c9a8-c4f4-39425509bd9e%40larsen.net.
For more options, visit https://groups.google.com/d/optout.