donal
2018-04-09 d98f409f02a0a34a006995ff98a51b6c936ee660
WIP - adding openshift-applier dir
1 files added
2 files modified
63 ■■■■ changed files
2-attack-of-the-pipelines/README.md 48 ●●●●● patch | view | raw | blame | history
README.md 15 ●●●●● patch | view | raw | blame | history
images/exercise1/jenkins-docker-star-wars.jpg patch | view | raw | blame | history
2-attack-of-the-pipelines/README.md
@@ -306,7 +306,53 @@
### Part 3 - Add configs to cluster 
> _In this exercise; we will use the OpenShift Applier to drive the creation of cluster content required by the app such and MongoDB and the Apps Build / Deploy Config_
4. TODO - waiting for Justins example before proceeding here
4. On your terminal navigate to the root of the `todolist-fe` application. The app contains a hidden folder called `.openshift-applier`. Move (cd .openshift-applier) into this directory and your should seem a familiar looking directory structure for an ansible playbook.
```
.openshift-applier
├── README.md
├── apply.yml
├── inventory
│   ├── group_vars
│   │   └── all.yml
│   └── hosts
├── params
│   ├── build
│   ├── dev
│   └── test
├── requirements.yml
└── templates
    ├── todolist-api-build.yml
    └── todolist-api-deploy.yml
```
where the following
    * the `apply.yml` file is the entrypoint.
    * the `inventory` contains the objects to populate the cluster with.
    * the `params` contains the variables we'll apply to the `templates`
    * the `templates` required by the app. These include the Build, Deploy configs as well as the services, health checks and other app definitions.
4. There are a few updates to these manifests we need to make before applying the cluster content. In the `apply.yml` update the namespace `<YOUR_NAME>` variables accordingly.
```yaml
    ci_cd_namespace: donal-ci-cd
    dev_namespace: donal-dev
    test_namespace: donal-test
```
4. In the `params` folder update the `dev` and `test` files with the correct `<YOUR_NAME>` as you've done above.
```bash
PIPELINES_NAMESPACE=donal-ci-cd
NAME=todolist-api
DEPLOYER_USER=jenkins
APP_TAG=latest
NAMESPACE=donal-dev
```
4. With those changes in place we can now run the playbook. First install the `openshift-applier` dependency and then run the playbook. This will populate the cluster with all the config needed for the front end app.
```bash
$ ansible-galaxy install -r requirements.yml --roles-path=roles
$ ansible-playbook apply.yml -i inventory/
```
### Part 4 - Build > Bake > Deploy 
> _In this exercise; we take what we have working locally and get it working in OpenShift_
README.md
@@ -1,11 +1,16 @@
# Enablement Material
> Red Hat Open Innovation Labs Enablement Material.
![jenkins-docker-star-wars](../images/exercise1/jenkins-docker-star-wars.jpg)
This is a collection of practices and exercises to take a learner through a four day simulated residency experience. Learners can expect to be exposed to labs practices such as [Event Storming](https://rht-labs.github.io/practice-library/practices/event-storming/), [Social Contract](https://rht-labs.github.io/practice-library/practices/social-contract/) and [Impact Mapping](https://rht-labs.github.io/practice-library/practices/impact-mapping/) amoung many more which can be found in our (Practice Library)[https://rht-labs.github.io/practice-library/]. Learners will also be exposed to `Labs CI/CD` - how we use OpenShift & Ansible in conjunction with Jenkins to automate build and deploy of a sample todolist application and it's required infrastructure.
## Learner pre-requisites
 - OCP CLI <version> installed
 - Ansible <version> installed
 - NodeJS <version>
 - OCP CLI v3.9
 - Ansible v2.5
 - NodeJS v8.x
 - Git Installed
 - Access to cluster `oc login -u <username> -p <password> <cluster_url>`
 - Access to an OpenShift cluster `oc login -u <username> -p <password> <cluster_url>`
> Or Download the tools-container containing most of these (TODO)
@@ -15,5 +20,3 @@
<!-- links to slides here! -->
______
## Practice Library
images/exercise1/jenkins-docker-star-wars.jpg