-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add advanced pipeline examples #12177
Conversation
@bparees ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like to see this driven entirely via the openshift webconsole, since that should be possible.
|
||
If you monitor the pods in your default project, you will also see the slave pod get created and deleted. | ||
|
||
|
||
## Pipeline of Pipelines Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orchestration Pipeline Example sounds nicer :)
oc new-project mapsapp | ||
``` | ||
|
||
3. To instantiate the pipeline via the Web Console, create the template from this directory first: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just instantiate it in the console via the "upload" path instead of installing/registering it.
1. Ensure that you have a running OpenShift environment as described in the basic example | ||
2. Create a new project for your pipeline: | ||
``` | ||
oc new-project mapsapp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this from the web console
7. Navigate to *Builds* -> *Pipelines* | ||
8. Click on *Start Pipeline* | ||
|
||
The pipeline will instantiate other pipelines and those will in turn instantiate OpenShift objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's going to take some time for jenkins to come up before the pipeline will start, probably worth warning users about that so they aren't immediately wondering why it's not running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and making it clear that's a first time only thing)
|
||
## Blue Green Deployment Example | ||
|
||
The `bluegreen-pipeline.yaml` template contains a pipeline that demonstrates alternating blue/green deployments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with a manual confirmation/approval step.
2. Create a new project for your pipeline: | ||
``` | ||
oc new-project bluegreen | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
via webconsole
4. Modify the *Git Repository URL* to contain the URL of your fork | ||
5. Click on *Create* | ||
6. Navigate to *Builds* -> *Pipelines* | ||
7. Click on *Start Pipeline* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(wait for jenkins to start up...then pipeline will run...)
5. Click on *Create* | ||
6. Navigate to *Builds* -> *Pipelines* | ||
7. Click on *Start Pipeline* | ||
8. Once code has been deployed, the pipeline will pause for your approval. Click on the pause icon to approve the pipeline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/approve the pipeline/approve deployment of the changes/
@@ -0,0 +1,327 @@ | |||
apiVersion: v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you convert samplepipeline.json to yaml? if so, let's delete the json one. (might need to make sure no tests are referencing it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samplepipeline.json removed. I didn't find any tests that referred to it. Only the cluster up code, which I fixed up.
@csrwng I feel like this part of the card has gotten neglected in these samples (I know you included it in your other CI sample):
Is there something we can do either to the original samplepipeline.json/yaml, or one of these 2 samples, to better cover demonstrating using a slave node for its intended purpose? |
0ffaf2c
to
b84360a
Compare
I will switch the bluegreen pipeline to use the nodejs slave for building |
76e0703
to
22121a4
Compare
I added a new pipeline that uses a maven slave to build a WAR |
dockerfile: |- | ||
FROM wildfly | ||
COPY ROOT.war /opt/app-root/src/target/ROOT.war | ||
RUN $STI_SCRIPTS_PATH/assemble |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you really need to run assemble vs just copying the war directly into the deployment dir?
## Maven Slave Example | ||
|
||
The `maven-pipeline.yaml` template contains a pipeline that uses a maven node to build and package a WAR. | ||
It then builds an image with the WAR using a Docker build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a Docker-strategy OpenShift build.
10. Navigate to *Builds* -> *Pipelines* | ||
11. Click on *Start Pipeline* next to *openshift-jee-sample* | ||
|
||
When the pipeline completes, the openshift-jee-sample application should be deployed and running. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment you have below about waiting for jenkins the first time.
8. Modify the *Git Repository URL* to contain the URL of your fork | ||
9. Click on *Create* | ||
10. Navigate to *Builds* -> *Pipelines* | ||
11. Click on *Start Pipeline* next to *bluegreen-pipeline* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment you have above about waiting for jenkins the first time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you missed this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it's fixed. Also added some text to explain how the routes work with this example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of nits but otherwise lgtm.
22121a4
to
77f941f
Compare
comments addressed |
77f941f
to
d0b9dc7
Compare
lgtm [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12199/) (Image: devenv-rhel7_5516) |
Evaluated for origin merge up to d0b9dc7 |
[Test]ing while waiting on the merge queue |
Evaluated for origin test up to d0b9dc7 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12199/) (Base Commit: cbc0af0) |
Adds 2 more pipeline examples to origin. Updates the existing README with instructions for the examples.