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

Basic spring applier update #40

Merged
merged 5 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions basic-spring-boot/.applier/group_vars/seed-hosts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
openshift_cluster_content:
- object: projects
content:
- name: "create environments"
file: "{{ inventory_dir }}/../.openshift/projects/projects.yml"
action: create
- object: deployments
content:
- name: "deploy dev environment"
template: "{{ inventory_dir }}/../.openshift/templates/deployment.yml"
params: "{{ inventory_dir }}/../.openshift/params/deployment-dev"
- name: "deply stage environment"
template: "{{ inventory_dir }}/../.openshift/templates/deployment.yml"
params: "{{ inventory_dir }}/../.openshift/params/deployment-stage"
- name: "deply prod environment"
template: "{{ inventory_dir }}/../.openshift/templates/deployment.yml"
params: "{{ inventory_dir }}/../.openshift/params/deployment-prod"
- object: builds
content:
- name: "deploy build pipeline to dev"
template: "{{ inventory_dir }}/../.openshift/templates/build.yml"
params: "{{ inventory_dir }}/../.openshift/params/build-dev"
9 changes: 5 additions & 4 deletions basic-spring-boot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ This example demonstrates how to implement a full end-to-end Jenkins Pipeline fo
* Running both custom and oob Jenkins slaves as pods in OpenShift
* "One Click" instantiation of a Jenkins Pipeline using OpenShift's Jenkins Pipeline Strategy feature
* Promotion of an application's container image within an OpenShift Cluster (using `oc tag`)
* Promotion of an application's container image to a separate OpenShift Cluster (using `skopeo`) - Coming Soon!
* Automated rollout using the [openshift-appler](https://github.com/redhat-cop/openshift-applier) project.

## Automated Quickstart
## Automated Deployment

This quickstart can be deployed quickly using Ansible. Here are the steps.

1. Clone [this repo](https://github.com/redhat-cop/container-pipelines) and the [openshift-applier](https://github.com/redhat-cop/openshift-applier) repo.
1. Clone [this repo](https://github.com/redhat-cop/container-pipelines)
2. `cd container-pipelines/basic-spring-boot`
3. Run `ansible-galaxy install -r requirements.yml --roles-path=galaxy`
2. Log into an OpenShift cluster, then run the following command.
```
$ oc login
$ ansible-playbook -i ./applier/inventory/ /path/to/openshift-applier/playbooks/openshift-cluster-seed.yml
$ ansible-playbook -i ./.applier/ galaxy/openshift-applier/playbooks/openshift-cluster-seed.yml
```

At this point you should have 3 projects deployed (`basic-spring-boot-build`, `basic-spring-boot-dev`, `basic-spring-boot-stage`, and `basic-spring-boot-prod`) with our [Spring Rest](https://github.com/redhat-cop/spring-rest) demo application deployed to all 3.
Copy link

Choose a reason for hiding this comment

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

@etsauer could be a follow-up PR, but this talks about 3 projects, while in reality it's really 4 projects if you include the -build one ... it will deploy to the 3 (dev, stage, prod).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oybed addressed.

Expand Down
22 changes: 0 additions & 22 deletions basic-spring-boot/applier/inventory/group_vars/seed-hosts.yml

This file was deleted.

8 changes: 8 additions & 0 deletions basic-spring-boot/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is the Ansible Galaxy requirements file to pull in the correct roles
# to support the operation of CASL provisioning/runs.

# From 'openshift-applier'
- name: openshift-applier
scm: git
src: https://github.com/redhat-cop/openshift-applier
version: v2.0.2
Copy link

Choose a reason for hiding this comment

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

Since v2.0.3 has been out for a couple of weeks, I'd recommend going to that version.

Also, if you are targeting remote hosts, I'd recommend waiting on v2.0.4 (or submit a follow-up PR) as it will contain this PR: redhat-cop/openshift-applier#68

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oybed not planning on targeting remote hosts. updated to 2.0.3