Skip to content

Commit

Permalink
Merge pull request #40 from firemanxbr/post_deployment_v1
Browse files Browse the repository at this point in the history
Add the ability to specify adhoc oc commands
  • Loading branch information
arilivigni authored May 18, 2018
2 parents 93b87f2 + 73c821f commit 8065c9a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
- [Project repo options that has s2i templates and Jenkins Pipelines](#project-repo-options-that-has-s2i-templates-and-jenkins-pipelines)
- [OpenShift s2i template setup options](#openshift-s2i-template-setup-options)
- [Jenkins 2.0 pipeline setup options](#jenkins-20-pipeline-setup-options)
- [Templates](#templates)
- [Usage examples](#usage-examples)
- [Example 1: Setup on a local server :: Setup Minishift + OS templates](#example-1-setup-on-a-local-server--setup-minishift--os-templates)
- [Example 2: Setup on a local server :: Setup Minishift + OS templates + Jenkins 2.0 pipelines](#example-2-setup-on-a-local-server--setup-minishift--os-templates--jenkins-20-pipelines)
- [Example 3: Setup on a local server :: Setup Minishift + OS templates + Jenkins 2.0 pipelines](#example-3-setup-on-a-local-server--setup-minishift--os-templates--jenkins-20-pipelines)
- [Example 1: Setup on a local machine :: Setup Minishift + OS templates](#example-1-setup-on-a-local-machine--setup-minishift--os-templates)
- [Example 2: Setup on a local machine :: Setup Minishift + OS templates + Jenkins 2.0 pipelines](#example-2-setup-on-a-local-machine--setup-minishift--os-templates--jenkins-20-pipelines)
- [Example 3: Setup on a local machine :: Setup Minishift + OS templates + Jenkins 2.0 pipelines](#example-3-setup-on-a-local-machine--setup-minishift--os-templates--jenkins-20-pipelines)
- [Example 4: Using the playbook hooks on contra-env-setup](#example-4-using-the-playbook-hooks-on-contra-env-setup)
- [Debugging Issues](#debugging-issues)
- [Issue #1: Can't push images to the Minishift cluster](#issue-1-cant-push-images-to-the-minishift-cluster)
- [Solution #1:](#solution-1)
Expand Down Expand Up @@ -182,6 +184,20 @@ _Note: The -K is used to prompt you for your password for sudo (if you require o
The -k is used to prompt you for your ssh password can hit enter if using -K and they are the same<br>
Instead of -k you could use --private-key=<absolute_path_to_ssh_private_key>_

### Example 4: Using the playbook hooks on contra-env-setup

This resource permit to create your playbooks to included as the last role that will be
executed on contra-env-setup.

```
ansible-playbook -vv -i "localhost," contra-env-setup/playbooks/setup.yml \
-e user=cloud-user -e project_repo=https://github.com/arilivigni/ci-pipeline \
-e openshift_project=ari-ci-pipeline -e tag=develop -e setup_pipelines=true \
-e setup_sample_project -K -k
--extra-vars='{"hooks": ["/contra-env-setup/playbook_a.yml","/contra-env-setup/playbook_b.yml"]}'
```

## Debugging Issues

### Issue #1: Can't push images to the Minishift cluster
Expand Down
1 change: 1 addition & 0 deletions playbooks/group_vars/all/global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ setup_minishift: true
setup_containers: true
setup_pipelines: false
setup_sample_project: false
setup_playbook_hooks: false
force_minishift_install: false
force_repo_clone: true

Expand Down
6 changes: 6 additions & 0 deletions playbooks/roles/playbook_hooks/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- debug: msg="{{ hooks }}"

- name: "Adding external playbooks"
include: "{{ item }}"
with_items: "{{ hooks }}"
3 changes: 2 additions & 1 deletion playbooks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
- { role: prereqs, when: "run_prereqs|bool == true and setup_minishift|bool == true" }
- { role: minishift, when: setup_minishift|bool == true }
- { role: os_temps, when: setup_containers|bool == true }
- { role: pipeline, when: setup_pipelines|bool == true }
- { role: pipeline, when: setup_pipelines|bool == true }
- { role: playbook_hooks, when: setup_playbook_hooks|bool == true }
13 changes: 13 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [contra-env-setup CI](#contra-env-setup-ci)
- [Avocado](#avocado)
- [How to install](#how-to-install)
- [Tests](#tests)
- [Running the test](#running-the-test)
- [References](#references)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# contra-env-setup CI
This document describes how works the tests in the contra-env-setup repository.

Expand Down

0 comments on commit 8065c9a

Please sign in to comment.