[kontinuity-dev-public] Fwd: [Catapult] Configuring the Jenkins pipeline on OpenShift

Jeff Cantrill jcantril at redhat.com
Tue May 17 18:34:32 UTC 2016


On Tue, May 17, 2016 at 1:10 PM, Ben Parees <bparees at redhat.com> wrote:

> invoking "create" with a template object just creates a template resource
> object (what we call registering it...making it available in etcd), it
> doesn't instantiate the template (ie actually creating the resource objects
> defined by the template).
>
> Instantiating the template means posting it to the processtemplate
> endpoint, getting back a template object that has had parameter
> substitution applied, and then iterating the objects in the result template
> and creating each one.
>
> Using the f8 openshift client, reference


https://github.com/fabric8io/kubernetes-client/blob/b4dd0d898d2d0640d9ac3c73fc85c7996f6ae7c5/kubernetes-examples/src/main/java/io/fabric8/openshift/examples/TemplateExample.java

for processing and applying a template

> Jeff (on CC) can probably point you to java code that will do this.
>
>
> On Tue, May 17, 2016 at 1:06 PM, Andrew Lee Rubinger <alr at redhat.com>
> wrote:
>
>> Moving to the public list. :)  We can drop "continuous-dev" in replies.
>>
>> S,
>> ALR
>>
>> ---------- Forwarded message ----------
>> From: Xavier Coulon <xcoulon at redhat.com>
>> Date: Tue, May 17, 2016 at 12:50 PM
>> Subject: [Catapult] Configuring the Jenkins pipeline on OpenShift
>> To: continuous-dev at redhat.com
>>
>>
>> Hello,
>>
>> For the Catapult project, we need to programmatically create a project on
>> OpenShift 3 and then configure it with a Jenkins pipeline so that any build
>> eventually results in the deployment of a new version of the service.
>> Ben already provided some OpenShift templates for both Jenkins and a
>> sample project, and my current understanding is that the pipeline template
>> for the sample app describes all the services, routes, build
>> configurations, image streams, etc., including the Jenkins pipeline (a
>> groovy script) nested in a BuildConfig resource.
>>
>> But on the Catapult side, if I run these lines of code (where
>> pipelineTemplate is the content of the `pipelinetemplate.json` file):
>>
>>         final Template template = client.templates().load(
>> pipelineTemplate).get();
>>         client.templates().inNamespace("openshift").create(template);
>>
>> then I have the template created, but this obviously can only be executed
>> once, and it does not seem attached to any particular project.
>>
>> What I'm really trying to understand is:
>> - what kind of config file should we have along with an application in a
>> GitHub repositories (ie, quickstarts, etc.): a full OpenShift template
>> file, a Jenkinsfile, something else/something more ?
>> - how, with Fabric8 OpenShift client, can I submit a request similar to
>> what `oc new-app -f pipelinetemplate.json` does from CLI, to get everything
>> setup in my project ?
>>
>> Any response (or clarification if I misunderstood something !) will be
>> very welcome :-)
>>
>> Thanks
>> Best regards,
>> /Xavier
>>
>>
>>
>> --
>> Red Hat Developer Programs Architecture
>> @ALRubinger
>>
>> _______________________________________________
>> kontinuity-dev-public mailing list
>> kontinuity-dev-public at redhat.com
>> https://www.redhat.com/mailman/listinfo/kontinuity-dev-public
>>
>>
>
>
> --
> Ben Parees | OpenShift
>
>


-- 
--
Jeff Cantrill
Senior Software Engineer, Red Hat Engineering
OpenShift Integration Services
Red Hat, Inc.
*Office*: 703-748-4420 | 866-546-8970 ext. 8162420
jcantril at redhat.com
http://www.redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kontinuity-dev-public/attachments/20160517/3e28aa9e/attachment.htm>


More information about the kontinuity-dev-public mailing list