Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding/updating Jenkins Pipeline documentation #5720

Merged
merged 1 commit into from
Nov 2, 2017
Merged

Adding/updating Jenkins Pipeline documentation #5720

merged 1 commit into from
Nov 2, 2017

Conversation

coreydaley
Copy link
Member

Updating the Developers Guide section to include better documentation about
Jenkins Pipelines, how they work, how to create one, etc.

Trello: https://trello.com/c/rBojNLGj/1121-5-better-devguide-pipeline-docs-techdebt

Depends on: openshift/origin#16880

@coreydaley
Copy link
Member Author

@bparees @gabemontero ptal

[NOTE]
====
If Jenkins auto-provisioning is enabled on your cluster, and you don't need to make any customizations to the
Jenkins master, you can skip the above step.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link to jenkins autoprovision doc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in next push

spec:
strategy:
jenkinsPipelineStrategy:
jenkinsfile: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the above instructions imply this BuildConfig should be created verbatim, but it's incomplete...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like "<pipeline content from below>" would be better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in next push

}
----

Now we can import the build config into our OpenShift cluster with the following command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/import/create/
s/into/in/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

pipelines by logging into the web console and navigating to Builds -> Pipelines.

There you should see the sample-nodejs-pipeline that we created, and each stage that we defined in the Jenkinsfile as it is executed.
The stages will be green with a check mark if they complete successfully or red with an x if they failed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs some wrap up paragraph saying what should happen if it all works. (builds the app from X, deploys it, tests it, you now have a running copy of your code at location Y, etc).

description subject to change per my other comments on your other PR about what i think the content of the jenkinsfile should actually be.


== Overview


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"this section intentionally left blank" ?

== OpenShift Jenkins Pipeline Plugin

The https://github.com/openshift/jenkins-client-plugin[OpenShift Jenkins Pipeline Plugin] must be installed
on your Jenkins slaves so that the OpenShift DSL will be available to process the JenkinsFile for your
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not accurate. the plugin only needs to be installed on the master.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


== OpenShift DSL

The OpenShift Jenkins Pipeline Plugin provides a Domain Specific Language (DSL) for communicating with the OpenShift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client plugin.

the pipeline plugin is the legacy plugin that we are deprecating.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

If this behavior is not desirable (if you would like to use a Jenkins server external to OpenShift, for example),
you can use the following procedure to disable it.

If you are an unpriviledged user, a Service must be created for OpenShift to use. The service name must
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not that a service must be created for openshift to use, it's that a service must be created so the autoprovisioning logic will see it and not autoprovision for you.

also i think this doc can stay where it is, you can just link to it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

@@ -83,4 +83,25 @@ xref:../dev_guide/integrating_external_services.adoc#dev-guide-integrating-exter
The latter option could also be used to disable autoprovisioning in select
projects only.

== OpenShift Pipeline DSL Plugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client plugin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


[NOTE]
====
Are you a developer looking for information about using this plugin? If so, see xref:../dev_guide/builds/jenkins_pipeline.adoc#jenkins-pipeline-overview[Jenkins Pipeline Builds].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad link? (jenkins_pipeline_builds.adoc?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

@coreydaley
Copy link
Member Author

@bparees @gabemontero ptal

Copy link
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this is really coming to together.

I've sprinkled in a fair amount of feed back, but a lot of it is posing questions around possible changes vs. more direct call for change. Or changes for future iterations perhaps.

Anyway, take a look and we'll go from there.

== The Jenkinsfile

Now that we have created the build config with a jenkinsPipelineStrategy, we need to tell the pipeline what to do.
We will do this by using an inline Jenkinsfile, since we aren't going to be creating our own git repository for this application.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a call for change, as I believe I understand the pros/cons of switching approaches, and am fine with this safer path, but I thought it at least noteworthy to point out that placing the Jenkinsfile in the repo in question is the "preferred Jenkins way", for lack of a better term, and more than likely the approach our users will take if their dev process uses Jenkins.

Something to monitor moving forward I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update the doc mentioning that as the preferred way, but thought that the inline jenkinsfile would be better for the example/tutorial

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that is what I was assuming the thinking was, and as I tried to convey, I agree, certainly for this initial pass ... if anything else, just leaving some bread crumbs for if/when we revisit.


== Starting the Pipeline

We can now start the pipeline with the following command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm anticipating the user asking "can I start the pipeline from the Jenkins Console?", which he can of course, and heading off that question with noting that as a footnote type blurb, vs. whether that is a rabbit hole / unnecessary further promotion of Jenkins we want to avoid.

In other words, I'm undecided. @bparees @coreydaley - what do you guys think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update with the three main ways to start it, OpenShift web console, OpenShift CLI, and Jenkins console.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok cool

// timeout in 20 minutes if the pipeline hasn't completed
timeout(time: 20, unit: 'MINUTES') {
// use a nodejs jenkins slave
node('nodejs') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment could just as easily have been made in the sample PR (and I may make it there as well) ...I mentioned this briefly in an email exchange I believe, maybe in the card ... but certainly reasonable that it could get lost in the shuffle.

The "declarative pipeline syntax" was introduced earlier this year: https://jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline

We've pulled in the necessary plugins, versions, to leverage it. And we have already received questions as to whether we support, do we have examples, etc.

It could be as simple as duplicating all the good stuff @coreydaley has in this sample within the skeleton of declarative pipeline. Leveraging the pipeline and agent most notably.

Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update to use the declarative pipeline, i'll update the other pr with the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok cool ... and yeah, just to be clear, by update I was thinking both forms ... but I'm on the fence there .... perhaps if it is the same core example that is redundant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push to use declarative syntax

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's pick the form we want people to use primarily. if that's declarative, let's just show that...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok sounds good... declarative "is the future" ... which I believe @coreydaley has ready to push

in lieu of both forms, and with going to declarative, let's put a footnote somewhere that says we also work with the predecessor, which is now referred to as "scripted pipeline"


== Introduction

Using the Jenkins OpenShift Client Plugin, you can quickly and easily create Jenkins Pipelines utilizing the OpenShift DSL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DSL -> fluent DSL

i.e. let's highlight / tout the "sugary fluent-ness" of the syntax

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a mention of the phrase "fluent DSL" anywhere in the existing OpenShift docs repo, I only see one place where it mentions fluent, and that's in the Jenkins Client Plugin repo

"DSL Plugin is a Jenkins plugin which aims to provide a readable, concise, comprehensive, and fluent ".

If it makes sense I can add some language like that to this section, but I hesitate to update everywhere it says DSL to say "fluent DSL"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically we didn't do much of anything in the opnshift docs for the client plugin since it was experimental, so in a general sense I would say its this PR that is beefing up the doc to GA status

As I noted later below, yeah, changing DSL to fluent DSL everywhere is probably overboard, but we should highlight in the client plugin intro that is is fluent styled, etc.

Cool deal re: update in next push ... that said, if he has bandwidth, we should solicit @jupierce 's opinion as client plugin creator on whether we should highlight to some degree the "fluent" nature of the plugin ... as I recall, syntax style was one of the original motivators.

Now that we have created the build config with a jenkinsPipelineStrategy, we need to tell the pipeline what to do.
We will do this by using an inline Jenkinsfile, since we aren't going to be creating our own git repository for this application.

Below is the Jenkinsfile content which is written in groovy using the OpenShift DSL. We will inline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DSL -> fluent DSL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No description provided.

== Overview

Jenkins Pipelines give you fine-grained control over building, deploying, and promoting your applications on OpenShift.
Using a combination of the Jenkins Pipeline Build Strategy, Jenkinsfiles, and the OpenShift DSL _(provided by the OpenShift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fluent DSL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No description provided.

== OpenShift Jenkins Client Plugin

The https://github.com/openshift/jenkins-client-plugin[OpenShift Jenkins Client Plugin] must be installed
on your Jenkins master so that the OpenShift DSL will be available to use within the JenkinsFile for your
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fluent DSL

though maybe not every instance of DSL needs to become fluent DSL ... assuming everyone agrees on injecting fluent ....as long as it is emphasized somewhere in the doc, I'm good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, see comment at top.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep ... cool deal


== OpenShift DSL

The OpenShift Jenkins Client Plugin provides a Domain Specific Language (DSL) for communicating with the OpenShift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... fluent-styled Domain Specific Language

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

runtimes for specific jobs.

For more detailed information on configuring slave pods using the Kubernets Plugin see https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md[Kubernetes Plugin README].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should point to the ConfigMap / ImageStream support for dynamically defining slave pods ... should be in the main jenkins image doc

Are you a developer looking for information about using this plugin? If so, see xref:../dev_guide/builds/jenkins_pipeline_builds.adoc#jenkins-pipeline-overview[Jenkins Pipeline Builds].
====


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some mention of the sync plugin seems appropriate here ....

  • link to the repo readme
  • link to detail/pointers in main other_images/jenkins doc
  • key points / highlights
    -- dynamic job/run creation in jenkins
    -- dynamic creation of slave pod templates
    -- injecting env vars
    -- pipeline visualization in openshift web console
    -- integration with jenkins git plugin (passes commit info from openshift builds to jenkins git plugin)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in next push


[[introduction]]

== Introduction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about openshift pipelines first and foremost and the jenkins openshift client plugin secondarily, so the overview should start by talking about openshift pipelines, before jumping into the client plugin.

(you can have an openshift pipeline that doesn't use the client plugin)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in next push


Once the pipeline has started you should see the following actions performed within your project:

* a node.js Jenkins slave pod will be created
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even before this, the jenkins server in your project will kick off a job instance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push (also fixed the pipeline to spin up a node.js slave pod again, had lost it when switch to the declarative syntax)

The https://github.com/openshift/jenkins-client-plugin[OpenShift Jenkins Client Plugin] must be installed
on your Jenkins master so that the OpenShift DSL will be available to use within the JenkinsFile for your
application. This plugin is installed and enabled by default when using the Jenkins (Ephemeral) or Jenkins
(Persistent) templates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just say it's available by default when using the openshift jenkins image.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


[[the-openshift-dsl]]

== OpenShift DSL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be nested one level deeper since it seems like a subsection of the client plugin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

[NOTE]
====
The optional *jenkinsfilePath* field specifies the name of the file to use, relative to the source *contextDir*.
If *contextDir* is omitted, it defaults to the root of the repository. If *jenkinsfilePath* is omitted, it defaults to *Jenkinsfile*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this note contradicts the claim above that one of jenkinsFilepath or jenkinsFile must be specified(specifying neither is in fact ok). Also there are two different capitalization styles being used. jenkinsfilePath looks to be the right form.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in the next push to clarify the wording.

@coreydaley
Copy link
Member Author

@gabemontero @bparees ptal
I still need to add the information to cover https://github.com/openshift/openshift-docs/pull/5720/files#r146358420 but I believe that everything else has been addressed.

@@ -0,0 +1,219 @@
[[dev-guide-jenkins-pipeline-builds]]
= Jenkins Pipeline Builds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be calling these openshift pipeline builds. strictly speaking, jenkins is an implementation detail (though one that is a heavily leaked abstraction)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

== Introduction

Whether you are creating a simple website or a complex web of microservices, it's quick
and easy to use Jenkins Pipelines to build, test, deploy, and promote your applications on OpenShift.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easy to use OpenShift Pipelines to build, test.......blah blah. OpenShift Pipelines provide an OpenShift experience around Jenkins Pipelines. (and now you can go talk about jenkins pipelines all you want)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

** the pipeline will wait until the build has completed to trigger the next stage
* a deployment will be started using the *nodejs-mongodb-example* deployment config
** the pipeline will wait until the deployment has completed to trigger the next stage
* if the build and deploy are successful, the *nodejs-mongodb-example:latest* image will be tagged as *nodejs-mongodb-example:stage*
Copy link
Contributor

@bparees bparees Oct 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd divide this list into two sections: things that always happen and things the pipeline specifically is doing.

Things that happen always:

  1. job instance created
  2. slave pod launched to run your pipeline (as long as your pipeline declares a node, so this one kinda muddies the water between a generic "what happens when you run a pipeline" action and "what the specific pipeline makes happen")
  3. pipeline runs on slave
  4. slave is deleted (if one was required for the pipeline)

things this particular pipeline(jenkinsfile) does:

  1. delete resources
  2. create a new set of resources
  3. run an openshift build to produce an app image
  4. wait for build to complete
  5. deploy the new app image
  6. wait for deployment
  7. tag the image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

@@ -0,0 +1,115 @@
[[dev-guide-jenkins-pipeline]]
= Jenkins Pipeline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openshift pipelines

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


== Overview

Jenkins Pipelines give you fine-grained control over building, deploying, and promoting your applications on OpenShift.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openshift pipelines

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


== Jenkins Pipeline Strategy

In order to take advantage of the OpenShift DSL within your project, you will need to utilize the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to take advantage of OpenShift Pipelines within your project..... (you may or may not use the openshift DSL, you may not use the client plugin at all).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

This strategy defaults to using a *Jenkinsfile* at the root of your source repository, but also provides the
following configuration options:

* an inline jenkinsFile field within your BuildConfig that utilizes the OpenShift DSL using the groovy syntax
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again doesn't have to use the openshift dsl. that's recommended, depending what you're doing, but not a requirement. Find a way to distinguish "what an openshift pipeline is in general"(a jenkins pipeline strategy buildconfig+a Jenkins file definition) from "here's a great tool to use when you want to talk to openshift from your jenkinsfile"(use the client plugin + openshift DSL in your Jenkinsfile).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in next push


== Jenkinsfile

The Jenkinsfile utilizes the standard groovy language syntax along with the OpenShift DSL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again the DSL is basically optional. it's something you can use, it's not something you do use.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

Copy link
Member Author

@coreydaley coreydaley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bparees @gabemontero I believe that all feedback has been addressed.

@@ -0,0 +1,219 @@
[[dev-guide-jenkins-pipeline-builds]]
= Jenkins Pipeline Builds
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

== Introduction

Whether you are creating a simple website or a complex web of microservices, it's quick
and easy to use Jenkins Pipelines to build, test, deploy, and promote your applications on OpenShift.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

@@ -0,0 +1,115 @@
[[dev-guide-jenkins-pipeline]]
= Jenkins Pipeline
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


== Overview

Jenkins Pipelines give you fine-grained control over building, deploying, and promoting your applications on OpenShift.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


== Jenkins Pipeline Strategy

In order to take advantage of the OpenShift DSL within your project, you will need to utilize the
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


== Jenkinsfile

The Jenkinsfile utilizes the standard groovy language syntax along with the OpenShift DSL
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

** the pipeline will wait until the build has completed to trigger the next stage
* a deployment will be started using the *nodejs-mongodb-example* deployment config
** the pipeline will wait until the deployment has completed to trigger the next stage
* if the build and deploy are successful, the *nodejs-mongodb-example:latest* image will be tagged as *nodejs-mongodb-example:stage*
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

This strategy defaults to using a *Jenkinsfile* at the root of your source repository, but also provides the
following configuration options:

* an inline jenkinsFile field within your BuildConfig that utilizes the OpenShift DSL using the groovy syntax
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in next push

Are you a developer looking for information about using this plugin? If so, see xref:../dev_guide/builds/jenkins_pipeline_builds.adoc#jenkins-pipeline-overview[Jenkins Pipeline Builds].
====


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in next push

The OpenShift jenkins Sync Plugin provides the following:

* dynamic job/run creation in Jenkins
* dynamic creation of slave pod templates
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dynamic creation of slave pod templates from either ImageStreams, ImageStreamTags, or ConfigMaps

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push


[[advanced-topics]]

== Advanced Topics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this was previously discussed I missed it ... but I would move the entire Advanced Topics section to configuring_pipeline_execution

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of this section is to get this information into the online documentation and into the hands of developers. There is similar information already in the install_config section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok seems maybe redundant to me then ... or conversely, if we mention this stuff here, we should mention the sync plugin information here as well (it is similar is scope / feel in my opinion)

Thoughts @coreydaley @bparees ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the install config section isn't available to users reading the online docs (because it's assumed they aren't doing install/config)
https://docs.openshift.com/online/welcome/index.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(which means referencing that section is also going to be problematic of course. might have to ask @bmcelvee what's best to do here).

But i think the goal of getting this in front of developers (who would not be reading the install/config docs) is a valid one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall goal here is to explain to developers what pipelines are/how they work and reference out to more detailed specifics elsewhere. so mentioning the sync plugin makes sense (w/ a link to either the jenkins image doc that talks more about it).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can ifdef the content so it only appears in Online docs, reducing the redundancy in our OCP and Origin docs. Would that be a good solution?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great imho, I just don't expect developers to read the install /config docs at all unless we point them there. I'm more concerned that for the online docs we're pointing to an invalid link.

Writing the full content here for online and linking it for origin could be an option but that seems painful to maintain.

@gabemontero
Copy link
Contributor

Just two minor comments

@bparees bparees self-assigned this Oct 26, 2017
Copy link
Contributor

@bparees bparees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we'll still want to iterate on this a bit, but if you address my last couple nits here i think we can merge and then follow up.

and fluent syntax for rich interactions with an OpenShift API server, allowing for even more fine grained
control over the build, deployment, and promotion of applications on your OpenShift cluster.

For this example, we are going to create a Jenkins Pipeline that will build, deploy, and verify a Node.js/MongoDB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Jenkins Pipeline/OpenShift Pipeline/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in next push

$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/nodejs-sample-pipeline.yaml
----

For more information about the OpenShift DSL syntax used here see https://jenkins.io/doc/pipeline/steps/openshift-pipeline/[OpenShift Pipeline Steps].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this is the right link. that's the legacy plugin. you want to link to the client plugin, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in next push


* a job instance is created on the Jenkins server
* a slave pod is launched _(if your pipeline requires one)_
* the pipeline runs on the slave pod _(or the master if no slave is defined)_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/defined/required/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in next push

@coreydaley
Copy link
Member Author

@bparees ptal, all feedback has been addressed

and fluent syntax for rich interactions with an OpenShift API server, allowing for even more fine grained
control over the build, deployment, and promotion of applications on your OpenShift cluster.

For this example, we are going to create a OpenShift Pipeline that will build, deploy, and verify a Node.js/MongoDB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/a OpenShift/an OpenShift/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in next push

@bparees
Copy link
Contributor

bparees commented Oct 26, 2017

one last nit, otherwise lgtm and over to @openshift/team-documentation for final review/merge.

@bmcelvee bmcelvee self-assigned this Oct 27, 2017
Updating the Developers Guide section to include better documentation about
Jenkins Pipelines, how they work, how to create one, etc.

Trello: https://trello.com/c/rBojNLGj/1121-5-better-devguide-pipeline-docs-techdebt
@coreydaley
Copy link
Member Author

@openshift/team-documentation @bmcelvee ptal

@bmcelvee
Copy link
Contributor

Thanks, @coreydaley! This is going into 3.7?

@coreydaley
Copy link
Member Author

@bmcelvee yes, the features are already there, it's just updating docs for them.

@bparees
Copy link
Contributor

bparees commented Oct 27, 2017 via email

openshift-merge-robot added a commit to openshift/origin that referenced this pull request Oct 27, 2017
…e_example

Automatic merge from submit-queue.

Adding sample Jenkins Pipeline

Adding a sample Jenkins Pipeline in support of documentation updates.

Supports: openshift/openshift-docs#5720

Trello: https://trello.com/c/rBojNLGj/1121-5-better-devguide-pipeline-docs-techdebt
@coreydaley
Copy link
Member Author

@bmcelvee looks like openshift/origin#16880 merged, so this should be good now

@coreydaley
Copy link
Member Author

@bmcelvee
Copy link
Contributor

bmcelvee commented Nov 2, 2017

[rev_history]
|xref:../dev_guide/app_tutorials/openshift_pipeline.adoc#dev-guide-openshift-pipeline-builds[OpenShift Pipeline Builds]
|Added section.
%
|xref:../dev_guide/openshift_pipeline.adoc#dev-guide-openshift-pipeline[OpenShift Pipeline]
|Added section.
%
|xref:../install_config/configuring_pipeline_execution.adoc#install-config-configuring-pipeline-execution[Configuring Pipeline Execution]
|Added the xref:../install_config/configuring_pipeline_execution.adoc#install-openshift-jenkins-client-plugin[OpenShift Jenkins Client Plug-in] and xref:../install_config/configuring_pipeline_execution.adoc#openshift-jenkins-sync-plugin[OpenShift Jenkins Sync Plug-in] sections.
%
|xref:../using_images/other_images/jenkins.adoc#using-images-other-images-jenkins[Jenkins]
|Added the xref:../using_images/other_images/jenkins.adoc#memory-requirements[Memory Requirements] section.
%

@bmcelvee bmcelvee merged commit 2e65003 into openshift:master Nov 2, 2017
bmcelvee pushed a commit to bmcelvee/openshift-docs that referenced this pull request Nov 2, 2017
Updating the Developers Guide section to include better documentation about
Jenkins Pipelines, how they work, how to create one, etc.

Trello: https://trello.com/c/rBojNLGj/1121-5-better-devguide-pipeline-docs-techdebt
(cherry picked from commit 45ff79b) xref:"openshift#5720"
bmcelvee added a commit that referenced this pull request Nov 2, 2017
[dedicated-3.5-stage] Adding/updating Jenkins Pipeline documentation #5720
@vikram-redhat
Copy link
Contributor

@bmcelvee - Hey Brandi, this shouldn't have gone into dedicated 3.5 or online 3.6 branches. It should have gone into dedicated-3.7-stage and online-3.7-stage branches instead as this is a 3.7 release. I am going to revert these commits from the stage branches. Same applies to your follow up as well: #6083.

Can you pick them to the right branches on Monday?

@vikram-redhat
Copy link
Contributor

@bmcelvee - I can't seem to revert the PRs in the stage branches. I have added new commits to just remove them from _topic_map.yml for those branches: #6135 and #6136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants