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

Add support for OpenShift applier #13

Merged
merged 3 commits into from
Dec 8, 2017

Conversation

pabrahamsson
Copy link
Contributor

This is for the following two Trello cards:

@etsauer I had to update the pipeline.groovy for both apps (tomcat & spring-boot-web) to support the new build project. Let me know if you'd prefer PRs for those two as well (though it looks like #12 will be helpful once merged).

Copy link
Contributor

@etsauer etsauer left a comment

Choose a reason for hiding this comment

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

@pabrahamsson before we start testing, let's make the build namespace specific to the app.. so basic-tomcat-build

@pabrahamsson
Copy link
Contributor Author

@etsauer updated with basic-tomcat-build and spring-boot-web-build namespaces.

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

@pabrahamsson This is really good!

I made a couple comments related to making sure normal users would be able to instantiate these pipelines instead of needing to be cluster admins.

- object: projectrequest
content:
- name: basic-tomcat-spaces
file: "{{ inventory_dir }}/../files/projects/projects.yml"
Copy link
Contributor

Choose a reason for hiding this comment

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

add file_action: create to allow non privileged users to create projects

- object: projectrequest
content:
- name: simple-spring-boot-spaces
file: "{{ inventory_dir }}/../files/projects/projects.yml"
Copy link
Contributor

Choose a reason for hiding this comment

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

add file_action: create to allow non privileged users to create projects

file: "{{ inventory_dir }}/../files/projects/projects.yml"
- object: imagestreams
content:
- name: redhat-openjdk18-openshift
Copy link
Contributor

Choose a reason for hiding this comment

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

Creation in the openshift namespace restricts this example to cluster admins

buildconfig "basic-tomcat-pipeline" created
buildconfig "basic-tomcat" created
```

At this point you should be able to go to the Web Console and follow the pipeline by clicking in your `myapp-dev` project, and going to *Builds* -> *Pipelines*. At several points you will be prompted for input on the pipeline. You can interact with it by clicking on the _input required_ link, which takes you to Jenkins, where you can click the *Proceed* button. By the time you get through the end of the pipeline you should be able to visit the Route for your app deployed to the `myapp-prod` project to confirm that your image has been promoted through all stages.

## Cleanup
Copy link
Contributor

Choose a reason for hiding this comment

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

Add basic-tomcat-build to delete command

@@ -0,0 +1,32 @@
apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an assumption that this ImageStream already exists in the cluster. Otherwise running these examples would require cluster-admin privileges

content:
- name: basic-tomcat-spaces
file: "{{ inventory_dir }}/../files/projects/projects.yml"
- object: imagestreams
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove imagestreams section as it requires cluster-admin privileges

At this point you should be able to go to the Web Console and follow the pipeline by clicking in your `myapp-dev` project, and going to *Builds* -> *Pipelines*. There is a prompt for input on the pipeline before the production route is switched to the new deployment. You can interact with it by clicking on the _input required_ link, which takes you to Jenkins, where you can click the *Proceed* button. By the time you get through the end of the pipeline you should be able to visit the Route for your app deployed to the `myapp-prod` project to confirm that your image has been promoted through all stages.

## Cleanup

Cleaning up this example is as simple as deleting the projects we created at the beginning.

```
oc delete project simple-spring-boot-dev simple-spring-boot-prod simple-spring-boot-stage
oc delete project spring-boot-web-dev spring-boot-web-prod spring-boot-web-stage
Copy link
Contributor

Choose a reason for hiding this comment

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

Add spring-boot-web-build to the delete command

@@ -0,0 +1,32 @@
apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an assumption that this ImageStream already exists in the cluster. Otherwise running these examples would require cluster-admin privileges

@pabrahamsson
Copy link
Contributor Author

Thank you for the comments @sabre1041, I've updated accordingly.

@sabre1041
Copy link
Contributor

@pabrahamsson LGTM.

@etsauer Please review latest changes

Copy link
Contributor

@etsauer etsauer left a comment

Choose a reason for hiding this comment

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

Awesome! thanks @pabrahamsson !

@etsauer etsauer merged commit 796948b into redhat-cop:master Dec 8, 2017
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.

None yet

3 participants