Jenkins Pipeline
This playbook is used for creating Bitbucket to Jenkins Pipelines for Chef cookbooks and roles. It creates a pipeline by cloning an existing ones; the base pipelines need to be created manually before hand. The purpose of that is maintain a consistent configuration as the application is updated and the config.xml
changes.
Note: The play will fail if the Bitbucket repository doesn’t exist or is not publicly accessible.
---
- name: Create a Jenkins Pipeline
hosts: localhost
vars:
base_pipeline_1: <COOKBOOK_PIPELINE_TO_CLONE>
base_pipeline_2: <ROLE_PIPELINE_TO_CLONE>
jenkinsurl: https://jenkins.example.com
scmurl: https://git.example.com/rest/api/latest/projects
gather_facts: False
become: False
tasks:
roles:
- collect_scm_data
- create_pipeline
...