Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Added docs for declarative pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
marcingrzejszczak committed Mar 24, 2017
1 parent ac95544 commit 6ba1e85
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 15 deletions.
60 changes: 60 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ All in all there are the following projects taking part in the whole `microservi
[source,bash]
----
.
├── declarative-pipeline
│   └── Jenkinsfile-sample.groovy
├── jobs
│   ├── jenkins_pipeline_empty.groovy
│   ├── jenkins_pipeline_jenkinsfile_empty.groovy
Expand All @@ -759,6 +761,9 @@ All in all there are the following projects taking part in the whole `microservi
   └── test
----

In the `declarative-pipeline` you can find a definition of a `Jenkinsfile-sample.groovy` declarative
pipeline. It's used together with the Blueocean UI.

In the `jobs` folder you have all the seed jobs that will generate pipelines.

- `jenkins_pipeline_empty.groovy` - is a template of a pipeline with empty steps using the Jenkins Job DSL plugin
Expand All @@ -776,6 +781,8 @@ Currently we have tests only cause the whole logic resides in the `jenkins_pipel

=== Step by step

This is a guide for Jenkins JOB Dsl based pipeline.

If you want to just run the demo as far as possible using PCF Dev and Docker Compose

- <<jenkins_fork,Fork repos>>
Expand Down Expand Up @@ -972,6 +979,53 @@ image::{jenkins-root-docs}/pipeline_finished.png[caption="Step 5: ", title="The
{nbsp}
{nbsp}

=== Declarative pipeline & Blue Ocean

You can also use the https://jenkins.io/doc/book/pipeline/syntax/[declarative pipeline] approach with the
https://jenkins.io/projects/blueocean/[Blue Ocean UI]. Here is a step by step guide to run a pipeline via
this approach.

The Blue Ocean UI is available under the `blue/` URL. E.g. for Docker Machine based setup `http://192.168.99.100:8080/blue`.

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_1.png[caption="Step 1: ", title="Open Blue Ocean UI and click on `github-webhook-declarative-pipeline`"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_2.png[caption="Step 2: ", title="Your first run will look like this. Click `Run` button"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_3.png[caption="Step 3: ", title="Enter parameters required for the build and click `run`"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_4.png[caption="Step 4: ", title="A list of pipelines will be shown. Click your first run."]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_5.png[caption="Step 5: ", title="State if you want to go to production or not and click `Proceed`"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_6.png[caption="Step 6: ", title="The build is in progress..."]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_6.png[caption="Step 7: ", title="The pipeline is done!"]

{nbsp}
{nbsp}


=== Optional steps

[[jenkins_optional]] All the steps below are not necessary to run the demo. They are needed only
Expand Down Expand Up @@ -1073,6 +1127,11 @@ The env vars that are used in all of the jobs are as follows:
|PIPELINE_VERSION | What should be the version of the pipeline (ultimately also version of the jar) | 1.0.0.M1-${GROOVY,script ="new Date().format('yyMMdd_HHmmss')"}-VERSION
|GIT_EMAIL | The email used by Git to tag repo | [email protected]
|GIT_NAME | The name used by Git to tag repo | Pivo Tal
|CF_HOSTNAME_UUID | Additional suffix for the route. In a shared environment the default routes can be already taken |
|AUTO_DEPLOY_TO_STAGE | Should deployment to stage be automatic | false
|AUTO_DEPLOY_TO_PROD | Should deployment to prod be automatic | false
|ROLLBACK_STEP_REQUIRED | Should rollback step be present | true
|DEPLOY_TO_STAGE_STEP_REQUIRED | Should deploy to stage step be present | true
|======================

==== Set Git email / user
Expand Down Expand Up @@ -1170,6 +1229,7 @@ image::{jenkins-root-docs}/configure_system.png[caption="Step 2: ", title="Click
image::{jenkins-root-docs}/groovy_token.png[caption="Step 3: ", title="Click 'Allow token macro processing'"]

=== Docker Image

If you would like to run the pre-configured Jenkins image somewhere other than your local machine, we
have an image you can pull and use on https://hub.docker.com/r/springcloud/spring-cloud-pipeline-jenkins/[DockerHub].
The `latest` tag corresponds to the latest snapshot build. You can also find tags
Expand Down
62 changes: 61 additions & 1 deletion docs/JENKINS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ All in all there are the following projects taking part in the whole `microservi
[source,bash]
----
.
├── declarative-pipeline
│   └── Jenkinsfile-sample.groovy
├── jobs
│   ├── jenkins_pipeline_empty.groovy
│   ├── jenkins_pipeline_jenkinsfile_empty.groovy
Expand All @@ -29,6 +31,9 @@ All in all there are the following projects taking part in the whole `microservi
   └── test
----

In the `declarative-pipeline` you can find a definition of a `Jenkinsfile-sample.groovy` declarative
pipeline. It's used together with the Blueocean UI.

In the `jobs` folder you have all the seed jobs that will generate pipelines.

- `jenkins_pipeline_empty.groovy` - is a template of a pipeline with empty steps using the Jenkins Job DSL plugin
Expand All @@ -46,6 +51,8 @@ Currently we have tests only cause the whole logic resides in the `jenkins_pipel

=== Step by step

This is a guide for Jenkins JOB Dsl based pipeline.

If you want to just run the demo as far as possible using PCF Dev and Docker Compose

- <<jenkins_fork,Fork repos>>
Expand Down Expand Up @@ -242,6 +249,53 @@ image::{jenkins-root-docs}/pipeline_finished.png[caption="Step 5: ", title="The
{nbsp}
{nbsp}

=== Declarative pipeline & Blue Ocean

You can also use the https://jenkins.io/doc/book/pipeline/syntax/[declarative pipeline] approach with the
https://jenkins.io/projects/blueocean/[Blue Ocean UI]. Here is a step by step guide to run a pipeline via
this approach.

The Blue Ocean UI is available under the `blue/` URL. E.g. for Docker Machine based setup `http://192.168.99.100:8080/blue`.

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_1.png[caption="Step 1: ", title="Open Blue Ocean UI and click on `github-webhook-declarative-pipeline`"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_2.png[caption="Step 2: ", title="Your first run will look like this. Click `Run` button"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_3.png[caption="Step 3: ", title="Enter parameters required for the build and click `run`"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_4.png[caption="Step 4: ", title="A list of pipelines will be shown. Click your first run."]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_5.png[caption="Step 5: ", title="State if you want to go to production or not and click `Proceed`"]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_6.png[caption="Step 6: ", title="The build is in progress..."]

{nbsp}
{nbsp}

image::{jenkins-root-docs}/blue_6.png[caption="Step 7: ", title="The pipeline is done!"]

{nbsp}
{nbsp}


=== Optional steps

[[jenkins_optional]] All the steps below are not necessary to run the demo. They are needed only
Expand Down Expand Up @@ -343,6 +397,11 @@ The env vars that are used in all of the jobs are as follows:
|PIPELINE_VERSION | What should be the version of the pipeline (ultimately also version of the jar) | 1.0.0.M1-${GROOVY,script ="new Date().format('yyMMdd_HHmmss')"}-VERSION
|GIT_EMAIL | The email used by Git to tag repo | [email protected]
|GIT_NAME | The name used by Git to tag repo | Pivo Tal
|CF_HOSTNAME_UUID | Additional suffix for the route. In a shared environment the default routes can be already taken |
|AUTO_DEPLOY_TO_STAGE | Should deployment to stage be automatic | false
|AUTO_DEPLOY_TO_PROD | Should deployment to prod be automatic | false
|ROLLBACK_STEP_REQUIRED | Should rollback step be present | true
|DEPLOY_TO_STAGE_STEP_REQUIRED | Should deploy to stage step be present | true
|======================

==== Set Git email / user
Expand Down Expand Up @@ -440,10 +499,11 @@ image::{jenkins-root-docs}/configure_system.png[caption="Step 2: ", title="Click
image::{jenkins-root-docs}/groovy_token.png[caption="Step 3: ", title="Click 'Allow token macro processing'"]

=== Docker Image

If you would like to run the pre-configured Jenkins image somewhere other than your local machine, we
have an image you can pull and use on https://hub.docker.com/r/springcloud/spring-cloud-pipeline-jenkins/[DockerHub].
The `latest` tag corresponds to the latest snapshot build. You can also find tags
corresponding to stable releases that you can use as well.
corresponding to stable releases that you can use as well.

=== FAQ

Expand Down
Binary file added docs/img/jenkins/blue_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/jenkins/blue_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/jenkins/blue_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/jenkins/blue_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/jenkins/blue_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/jenkins/blue_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/jenkins/blue_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/jenkins/jenkinsfile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
126 changes: 123 additions & 3 deletions docs/spring-cloud-pipelines.html
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ <h1>Spring Cloud Pipelines</h1>
<li><a href="#_run_the_code_github_webhook_code_pipeline_2">Run the <code>github-webhook</code> pipeline</a></li>
</ul>
</li>
<li><a href="#_declarative_pipeline_blue_ocean">Declarative pipeline &amp; Blue Ocean</a></li>
<li><a href="#_optional_steps">Optional steps</a>
<ul class="sectlevel3">
<li><a href="#_deploying_infra_jars_to_a_different_location">Deploying infra jars to a different location</a></li>
Expand Down Expand Up @@ -1945,6 +1946,8 @@ <h3 id="_project_setup_2">Project setup</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">.
├── declarative-pipeline
│   └── Jenkinsfile-sample.groovy
├── jobs
│   ├── jenkins_pipeline_empty.groovy
│   ├── jenkins_pipeline_jenkinsfile_empty.groovy
Expand All @@ -1961,6 +1964,10 @@ <h3 id="_project_setup_2">Project setup</h3>
</div>
</div>
<div class="paragraph">
<p>In the <code>declarative-pipeline</code> you can find a definition of a <code>Jenkinsfile-sample.groovy</code> declarative
pipeline. It&#8217;s used together with the Blueocean UI.</p>
</div>
<div class="paragraph">
<p>In the <code>jobs</code> folder you have all the seed jobs that will generate pipelines.</p>
</div>
<div class="ulist">
Expand Down Expand Up @@ -1993,6 +2000,9 @@ <h3 id="_project_setup_2">Project setup</h3>
<div class="sect2">
<h3 id="_step_by_step_2">Step by step</h3>
<div class="paragraph">
<p>This is a guide for Jenkins JOB Dsl based pipeline.</p>
</div>
<div class="paragraph">
<p>If you want to just run the demo as far as possible using PCF Dev and Docker Compose</p>
</div>
<div class="ulist">
Expand Down Expand Up @@ -2356,6 +2366,91 @@ <h4 id="_run_the_code_github_webhook_code_pipeline_2">Run the <code>github-webho
</div>
</div>
<div class="sect2">
<h3 id="_declarative_pipeline_blue_ocean">Declarative pipeline &amp; Blue Ocean</h3>
<div class="paragraph">
<p>You can also use the <a href="https://jenkins.io/doc/book/pipeline/syntax/">declarative pipeline</a> approach with the
<a href="https://jenkins.io/projects/blueocean/">Blue Ocean UI</a>. Here is a step by step guide to run a pipeline via
this approach.</p>
</div>
<div class="paragraph">
<p>The Blue Ocean UI is available under the <code>blue/</code> URL. E.g. for Docker Machine based setup <code><a href="http://192.168.99.100:8080/blue" class="bare">http://192.168.99.100:8080/blue</a></code>.</p>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
<div class="imageblock">
<div class="content">
<img src="img/jenkins/blue_1.png" alt="blue 1">
</div>
<div class="title">Step 1: Open Blue Ocean UI and click on <code>github-webhook-declarative-pipeline</code></div>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
<div class="imageblock">
<div class="content">
<img src="img/jenkins/blue_2.png" alt="blue 2">
</div>
<div class="title">Step 2: Your first run will look like this. Click <code>Run</code> button</div>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
<div class="imageblock">
<div class="content">
<img src="img/jenkins/blue_3.png" alt="blue 3">
</div>
<div class="title">Step 3: Enter parameters required for the build and click <code>run</code></div>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
<div class="imageblock">
<div class="content">
<img src="img/jenkins/blue_4.png" alt="blue 4">
</div>
<div class="title">Step 4: A list of pipelines will be shown. Click your first run.</div>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
<div class="imageblock">
<div class="content">
<img src="img/jenkins/blue_5.png" alt="blue 5">
</div>
<div class="title">Step 5: State if you want to go to production or not and click <code>Proceed</code></div>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
<div class="imageblock">
<div class="content">
<img src="img/jenkins/blue_6.png" alt="blue 6">
</div>
<div class="title">Step 6: The build is in progress&#8230;&#8203;</div>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
<div class="imageblock">
<div class="content">
<img src="img/jenkins/blue_6.png" alt="blue 6">
</div>
<div class="title">Step 7: The pipeline is done!</div>
</div>
<div class="paragraph">
<p>&#160;
&#160;</p>
</div>
</div>
<div class="sect2">
<h3 id="_optional_steps">Optional steps</h3>
<div class="paragraph">
<p><a id="jenkins_optional"></a> All the steps below are not necessary to run the demo. They are needed only
Expand Down Expand Up @@ -2525,9 +2620,9 @@ <h5 id="_all_env_vars">All env vars</h5>
</thead>
<tfoot>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">GIT_NAME</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name used by Git to tag repo</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Pivo Tal</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">DEPLOY_TO_STAGE_STEP_REQUIRED</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should deploy to stage step be present</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
</tr>
</tfoot>
<tbody>
Expand Down Expand Up @@ -2601,6 +2696,31 @@ <h5 id="_all_env_vars">All env vars</h5>
<td class="tableblock halign-left valign-top"><p class="tableblock">The email used by Git to tag repo</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="mailto:[email protected]">[email protected]</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">GIT_NAME</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name used by Git to tag repo</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Pivo Tal</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">CF_HOSTNAME_UUID</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Additional suffix for the route. In a shared environment the default routes can be already taken</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">AUTO_DEPLOY_TO_STAGE</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should deployment to stage be automatic</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">AUTO_DEPLOY_TO_PROD</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should deployment to prod be automatic</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ROLLBACK_STEP_REQUIRED</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should rollback step be present</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
</tr>
</tbody>
</table>
</div>
Expand Down
Loading

0 comments on commit 6ba1e85

Please sign in to comment.