Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…v-setup

# Conflicts:
#	README.md
  • Loading branch information
Ari LiVigni committed May 30, 2018
2 parents dda2481 + 93d6838 commit db88c7a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
- [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: Setup on a local machine :: Start Minishift w/profile mysetup + OS templates + Jenkins 2.0 pipelines](#example-4-setup-on-a-local-machine--start-minishift-wprofile-mysetup--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 @@ -85,7 +89,6 @@ contra-env-setup/playbooks/group_vars/all/global.yml
* memory: Memory size to use for the VM : default=6400mb
* cpus: Number of cpus to use for minishift VM: default=2
* minishift_iso: ISO image to use : default=http://artifacts.ci.centos.org/fedora-atomic/minishift/iso/minishift.iso
* start_minishift: start an existing minishift instance: default=false

### oc setup options
* openshift_project: OpenShift project name : default:contra-sample-project
Expand Down Expand Up @@ -210,6 +213,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 @@ -7,6 +7,7 @@ startup_minishift: false
setup_containers: true
setup_pipelines: false
setup_sample_project: false
setup_playbook_hooks: false
force_minishift_install: false
force_repo_clone: true

Expand Down
4 changes: 2 additions & 2 deletions playbooks/roles/os_temps/tasks/setup_os_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,5 @@

# Setup tag if container image build successful
- name: Modify tags on images
shell: "{{ oc_bin }} get is | awk '{print $2}' | grep -v DOCKER | sed 's/.*5000\\///g' | grep '{{ build_config_name_file.stdout }}' | xargs -i {{ oc_bin }} tag {}:latest {}:{{ tag }}"
when: modify_tags|bool == true and build_success|bool == true
shell: "{{ oc_bin }} get imagestream | awk '{print $2}' | grep -v DOCKER | sed 's/.*5000\\///g' | grep '{{ build_config_name_file.stdout }}' | xargs -i {{ oc_bin }} tag {}:latest {}:{{ tag }}"
when: modify_tags|bool == true and build_success|bool == true
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 and start_minishift == false" }
- { 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 }

0 comments on commit db88c7a

Please sign in to comment.