So I ended up writing a little script using the groovy shell:
import com.cloudbees.dockerpublish.DockerBuilder
for(item in Hudson.instance.allItems) {
for (builder in item.builders) {
if (builder instanceof DockerBuilder && builder.dockerfilePath) {
println("Changing build context of " + item.name + " to: " +
builder.dockerfilePath);
builder.buildContext = builder.dockerfilePath;
println("Blanking dockerfilePath of " + item.name);
builder.dockerfilePath = "";
}
}
}
Which worked on my machine.
On Monday, 21 March 2016 11:13:23 UTC+13, Michael Neale wrote:
>
> Liam, one way would be to take jenkins down, backup JENKINS_HOME, and then
> use shell scripting to modify the config.xml (lets call that the "ghetto
> way"), then start it up.
>
> I am not sure off the top of my head how to modify it with the groovy
> shell, but will see if can work it out.
>
> On Mon, Mar 21, 2016 at 8:03 AM Liam <[email protected] <javascript:>>
> wrote:
>
>> So we've successfully updated to Docker 1.10.3 on our Jenkins machines,
>> and had it running for a bit, and everything seems to be working fine.
>>
>> Can you give me any for pointers for tackling the bulk-ish update? I'm
>> basically a novice at using Jenkins, so I'm not really sure where to start
>> with this kind of thing, apart from trying to find a database and twiddling
>> values in it, which seems like it could end badly...
>>
>> On Thursday, 10 March 2016 19:38:15 UTC+13, Michael Neale wrote:
>>
>>> A bulk-ish update could be scripted.
>>>
>>> On Thu, Mar 10, 2016 at 5:26 PM nicolas de loof <[email protected]>
>>> wrote:
>>>
>> looks to me the plugin didn't correctly handle legacy data migration
>>>>
>>>> in 1.0 dockerfilePath was used to store the build context - as there
>>>> was only one possible dockerfile the variable name looked good
>>>> in 1.1, support for --file was introduced by changing the meaning of
>>>> this field, and adding buildContext to replace it on its initial role
>>>> so the confusion
>>>>
>>>>
>>>> see
>>>> https://github.com/jenkinsci/docker-build-publish-plugin/commit/61e55dce1d4c78a21740ba98d271ddcb7369d741
>>>>
>>>> seems it's too late now to change this, will need to reconfigure the
>>>> job.
>>>>
>>>> 2016-03-09 23:28 GMT+01:00 Michael Neale <[email protected]>:
>>>>
>>>>> OK, interested in how things are when you upgrade docker.
>>>>>
>>>>> I'll take a closer look at the confusion around Dockerfile name vs
>>>>> path.
>>>>>
>>>>>
>>>>> On Thursday, March 10, 2016 at 7:18:49 AM UTC+11, Liam wrote:
>>>>>>
>>>>>> So our Jenkins machine is running docker 1.7.1 atm. We're going to
>>>>>> upgrade to 1.10 shortly.
>>>>>>
>>>>>> I don't think that we actually need to change anything, and it's not
>>>>>> like we can rewrite past versions or anything, for me it's more about
>>>>>> providing a working migration path forwards.
>>>>>>
>>>>>> Even if that takes the form of a script or something, that's totally
>>>>>> fine.
>>>>>>
>>>>>> On Wednesday, 9 March 2016 13:37:24 UTC+13, Michael Neale wrote:
>>>>>>>
>>>>>>> In the short term, I don't think you are missing out on anything by
>>>>>>> using 1.0 while you work out what docker version.
>>>>>>>
>>>>>>> May need to adjust this to work more as expected.
>>>>>>>
>>>>>>> On Wednesday, March 9, 2016 at 10:57:53 AM UTC+11, Liam wrote:
>>>>>>>>
>>>>>>>> I'm not sure what version of docker is running on the Jenkins
>>>>>>>> machine at the moment. I'll find out, but that may take a little while.
>>>>>>>>
>>>>>>>> Yes, you're correct that bs-api is the directory containing the
>>>>>>>> dockerfile (the path). In v1.0.1 it was treated as such, but now it's
>>>>>>>> treated as the path to the Dockerfile (the --file flag).
>>>>>>>>
>>>>>>>> We're not really in a position to be able to manually adjust this
>>>>>>>> for all of our builds, since we've got loads that use this property.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wednesday, 9 March 2016 12:05:36 UTC+13, Michael Neale wrote:
>>>>>>>>>
>>>>>>>>> Some of these changes were due to changes in docker itself - what
>>>>>>>>> version of docker are you running?
>>>>>>>>>
>>>>>>>>> Yes, I suspect the meaning is a subtle change.
>>>>>>>>>
>>>>>>>>> So in the past bs-api I guess would have been the PATH.
>>>>>>>>> The latest cli:
>>>>>>>>> https://docs.docker.com/engine/reference/commandline/build/
>>>>>>>>>
>>>>>>>>> So according to this, in 1.1 of the plugin, bs-api would be the
>>>>>>>>> name of your "Dockerfile", which is probably not what you mean? the
>>>>>>>>> bs-api
>>>>>>>>> was the directory that had the Dockerfile in it before if I am right?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wednesday, March 9, 2016 at 9:14:45 AM UTC+11, Liam wrote:
>>>>>>>>>>
>>>>>>>>>> We're using
>>>>>>>>>> https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Build+and+Publish+plugin
>>>>>>>>>>
>>>>>>>>>> to do our docker builds.
>>>>>>>>>>
>>>>>>>>>> I've tried to update from v1 -> v1.2, which caused previously
>>>>>>>>>> successful builds to fail. I went back through and isolated the
>>>>>>>>>> issue to be
>>>>>>>>>> the jump from v1.0.1 to v1.1.
>>>>>>>>>> I didn't alter any of the build configuration during this process.
>>>>>>>>>>
>>>>>>>>>> Looking at the logs, it seems like the commands are run
>>>>>>>>>> differently, despite the lack of change in configuration:
>>>>>>>>>> v1.0.1:
>>>>>>>>>>
>>>>>>>>>> docker build -t lfn3/bs-api:142 --no-cache=true bs-api
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> v1.1
>>>>>>>>>>
>>>>>>>>>> docker build -t lfn3/bs-api:141 --no-cache=true --file=bs-api
>>>>>>>>>> /var/lib/jenkins/jobs/docker-bs-api/workspace
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> It appears that the parameter that was previously treated as the
>>>>>>>>>> docker context dir is now passed as the docker file-path.
>>>>>>>>>>
>>>>>>>>>> It seems like the field was mis-named in v1.0.1: "Directory
>>>>>>>>>> dockerfile is in", and I'm guessing it was renamed to something like
>>>>>>>>>> "Dockerfile name" and a separate context dir was introduced?
>>>>>>>>>>
>>>>>>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Jenkins Developers" group.
>>>>>
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>>
>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/jenkinsci-dev/e0483afc-b782-49c3-a4ac-534c13ceaa6d%40googlegroups.com
>>>>>
>>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/e0483afc-b782-49c3-a4ac-534c13ceaa6d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> 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 Developers" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/jenkinsci-dev/1d29YSpPxYA/unsubscribe
>>>> .
>>>>
>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>
>>>
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jenkinsci-dev/CANMVJz%3Dd5tYz%2B1ScGzWtZL9aDjT41_Yab1r8DMY-K%3DXfXgYi-A%40mail.gmail.com
>>>>
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CANMVJz%3Dd5tYz%2B1ScGzWtZL9aDjT41_Yab1r8DMY-K%3DXfXgYi-A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>>
>>> --
>>> Regards,
>>>
>>> Michael Neale
>>> (twitter: @michaelneale, skype: michael_d_neale)
>>> Cell: +61 423175597
>>> Cofounder & Engineer @ large in CTO office.
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Jenkins Developers" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/jenkinsci-dev/1d29YSpPxYA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/a30b7600-cd05-4e67-acb3-7430ce1e9d27%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/jenkinsci-dev/a30b7600-cd05-4e67-acb3-7430ce1e9d27%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
>
> --
> Regards,
>
> Michael Neale
> (twitter: @michaelneale, skype: michael_d_neale)
> Cell: +61 423175597
> Cofounder & Engineer @ large in CTO office.
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/268b45cf-aba5-4769-add5-6a60db254c64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.