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

Jenkins persistence switch #285

Merged
merged 12 commits into from
Aug 14, 2019
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ roles/*
*.iml
gdsl
*.retry
*.swp
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ Note:

After running the playbook, the pipeline should execute in Jenkins, build the spring boot app, deploy artifacts to nexus, deploy the container to the dev stage and then wait approval to deploy to the demo stage. See Common Issues

## Persistent vs Ephemeral Jenkins

`labs-ci-cd` will default to deploying a persistent Jenkins, if you do not wish to use persistent jenkins please add on the extra variable `jenkins_persistence_type` and set it to `ephemeral` For Example:

```bash
ansible-playbook site.yml -e jenkins_persistence_type=ephemeral
```

## Running a Subset of the Inventory

In some cases you might not want to deploy all of the components in this repo; but only a subset such as Jenkins and the customisations to it.
Expand All @@ -92,7 +100,7 @@ In some cases you might not want to deploy all of the components in this repo; b
3. Here is an example that runs the tags that provision projects, ci, and jenkins objects:
```bash
ansible-playbook site.yml \
-e "filter_tags=jenkins,ci,projects"
-e "include_tags=jenkins,ci,projects"
```

## Scope and Direction
Expand Down
2 changes: 1 addition & 1 deletion docs/run-with-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ In some cases you might not want to deploy all of the components in this repo; b
./run.sh ansible-playbook /tmp/src/apply.yml \
-i /tmp/src/inventory/ \
-e target=tools \
-e "filter_tags=jenkins,ci,projects"
-e "include_tags=jenkins,ci,projects"
```
18 changes: 5 additions & 13 deletions inventory/host_vars/ci-cd-tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ sonarqube_name: sonarqube
hoverfly_name: hoverfly
nexus_password: "admin123"

jenkins_persistence_type: "persistent"

jenkins:
build:
NAME: "{{ jenkins_name }}"
Expand Down Expand Up @@ -270,24 +272,14 @@ openshift_cluster_content:
- nexus
- nexus-deploy
- ci-cd-deployments
# Want to use Ephemeral Jenkins? Just swap out these two lines
# - name: jenkins-ephemeral
# template: "{{ openshift_templates_raw }}/{{ openshift_templates_raw_version_tag }}/jenkins/jenkins-ephemeral-template.yml"
# params_from_vars: "{{ jenkins.deploy }}"
# namespace: "{{ ci_cd_namespace }}"
# tags:
# - jenkins
# - jenkins-deploy
# - jenkins-ephemeral
# - ci-cd-deployments
- name: jenkins-persistent
template: "{{ openshift_templates_raw }}/{{ openshift_templates_raw_version_tag }}/jenkins/jenkins-persistent-template.yml"
- name: jenkins
template: "{{ openshift_templates_raw }}/{{ openshift_templates_raw_version_tag }}/jenkins/jenkins-{{ jenkins_persistence_type }}-template.yml"
params_from_vars: "{{ jenkins.deploy }}"
namespace: "{{ ci_cd_namespace }}"
tags:
- jenkins
- jenkins-deploy
- jenkins-persistent
- jenkins-{{ jenkins_persistence_type }}
- ci-cd-deployments
- name: zalenium
template: "{{ cop_quickstarts_raw }}/{{ cop_quickstarts_raw_version_tag }}/zalenium/.openshift/templates/zalenium-deployment.yml"
Expand Down
7 changes: 4 additions & 3 deletions minimal-ci-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- include_role:
name: openshift-applier/roles/openshift-applier
vars:
filter_tags: "{{ ci_cd_namespace }}"
include_tags: "{{ ci_cd_namespace }}"

- name: Create CI/CD tools
hosts: tools
Expand All @@ -17,12 +17,13 @@
tags:
- openshift-applier
vars:
filter_tags: "jenkins,ansible-slave"
include_tags: "jenkins,ansible-slave"

- name: Create CI Job
hosts: ci-for-labs
tasks:
- include_role:
name: openshift-applier/roles/openshift-applier
tags:
- openshift-applier
- openshift-applier
- ci-for-ci
2 changes: 1 addition & 1 deletion pre_post_requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
- src: https://github.com/redhat-cop/infra-ansible
scm: git
version: v1.0.10
name: infra-ansible
name: infra-ansible
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# From 'openshift-applier'
- src: https://github.com/redhat-cop/openshift-applier
scm: git
version: v2.0.10
version: v2.1.0
name: openshift-applier