From 2e400c0e70f099676a4f456457aa280c9d42f1c7 Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Wed, 18 Jul 2018 17:25:22 +0200 Subject: [PATCH 1/7] Fix wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a8b00c8..3c593f6 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ It also depends on the role to install/uninstall the plugins needed by the [jenkins-pipeline-library](https://github.com/wcm-io-devops/jenkins-pipeline-library) -As transinient dependency this role uses the +As transitive dependency this role uses the [wcm-io-devops.jenkins-facts](https://github.com/wcm-io-devops/ansible-jenkins-facts) role to retrieve the list of installed plugins from the Jenkins instance. From 276bc07d7d5b9acfea22db6aeec15c4ba11c7607 Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Fri, 17 Aug 2018 16:22:45 +0200 Subject: [PATCH 2/7] Adjust galaxy namespace and role name --- README.md | 6 +++--- meta/main.yml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3c593f6..c1365aa 100644 --- a/README.md +++ b/README.md @@ -110,17 +110,17 @@ Plugins that must be absent for jenkins-pipeline-library. ## Dependencies This role depends on the -[wcm-io-devops.jenkins-service](https://github.com/wcm-io-devops/ansible-jenkins-service) +[wcm_io_devops.jenkins_plugins](https://github.com/wcm-io-devops/ansible-jenkins-plugins) role to ensure that the Jenkins service is started before plugins are managed. It also depends on the -[wcm-io-devops.jenkins-plugins](https://github.com/wcm-io-devops/ansible-jenkins-plugins) +[wcm_io_devops.jenkins_plugins](https://github.com/wcm-io-devops/ansible-jenkins-plugins) role to install/uninstall the plugins needed by the [jenkins-pipeline-library](https://github.com/wcm-io-devops/jenkins-pipeline-library) As transitive dependency this role uses the -[wcm-io-devops.jenkins-facts](https://github.com/wcm-io-devops/ansible-jenkins-facts) +[wcm_io_devops.jenkins_facts](https://github.com/wcm-io-devops/ansible-jenkins-facts) role to retrieve the list of installed plugins from the Jenkins instance. diff --git a/meta/main.yml b/meta/main.yml index 8846f1e..c7ddf66 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,4 +1,5 @@ galaxy_info: + role_name: jenkins_pipeline_library author: Tobias Richter description: Ansible role for setting up a Jenkins instance for the jenkins-pipeline-library. company: pro!vision @@ -43,7 +44,7 @@ dependencies: jenkins_service_state: started } # install plugins - - { role: wcm-io-devops.jenkins-plugins, + - { role: wcm_io_devops.jenkins_plugins, jenkins_plugins_admin_username: "{{ jenkins_pipeline_library_admin_username }}", jenkins_plugins_admin_password: "{{ jenkins_pipeline_library_admin_password }}", jenkins_plugins_jenkins_home: "{{ jenkins_pipeline_library_jenkins_home }}", @@ -52,4 +53,4 @@ dependencies: jenkins_plugins_jenkins_url_prefix: "{{ jenkins_pipeline_library_jenkins_url_prefix }}", jenkins_plugins_present: "{{ jenkins_pipeline_library_plugins_present }}", jenkins_plugins_absent: "{{ jenkins_pipeline_library_plugins_absent }}", - } \ No newline at end of file + } From be98595615326906bd17681a84cf0bce500cbc33 Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Fri, 17 Aug 2018 17:04:38 +0200 Subject: [PATCH 3/7] Update documentation --- README.md | 14 +++++++------- meta/main.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c1365aa..96346a7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# wcm-io-devops.jenkins-pipeline-library +# wcm_io_devops.jenkins_pipeline_library This role is a utility roles to setup jenkins instances for the usage of the wcm-io-devops @@ -14,13 +14,13 @@ Optionally the role also directly setups a Jenkins instance using [geerlingguy.j The Version number will follow the following versioning schema: -`v[JenkinsVersion]-[ReleaseCount]` +`[JenkinsVersion]-[ReleaseCount]` So for example: -* `v2.107.2-1` - first release for Jenkins 2.107.2 -* `v2.107.2-2` - second release for Jenkins 2.107.2 -* `v2.107.2-N` - nth release for Jenkins 2.107.2 -* `v2.107.3-1` - first release for Jenkins 2.107.3 +* `2.107.2-1` - first release for Jenkins 2.107.2 +* `2.107.2-2` - second release for Jenkins 2.107.2 +* `2.107.2-N` - nth release for Jenkins 2.107.2 +* `2.107.3-1` - first release for Jenkins 2.107.3 ## Requirements @@ -131,7 +131,7 @@ https://github.com/wcm-io-devops/jenkins-pipeline-library. - hosts: jenkins roles: - - role: wcm-io-devops.jenkins-pipeline-library + - role: wcm_io_devops.jenkins_pipeline_library ## License diff --git a/meta/main.yml b/meta/main.yml index c7ddf66..04acfe7 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -32,7 +32,7 @@ dependencies: jenkins_pkg_url: "{{ jenkins_pipeline_library_jenkins_pkg_url }}", jenkins_process_user: "{{ jenkins_pipeline_library_jenkins_process_user }}", jenkins_process_group: "{{ jenkins_pipeline_library_jenkins_process_group }}", - tags: ['wcm-io-devops.jenkins-pipeline-library.jenkins-installation'], + tags: ['wcm_io_devops.jenkins_pipeline_library.jenkins-installation'], # only setup jenkins when enabled when: jenkins_pipeline_library_jenkins_install == true } From 4ee147283cd19ae122b9a3d32dd04a1e2a060a8e Mon Sep 17 00:00:00 2001 From: tobias-richter Date: Tue, 28 Aug 2018 16:27:03 +0200 Subject: [PATCH 4/7] Add travis (#2) --- .ansible-lint | 2 ++ .travis.yml | 36 ++++++++++++++++++++++++++++++++++++ tests/inventory | 3 +++ tests/requirements.yml | 8 ++++++++ tests/test.yml | 4 ++++ 5 files changed, 53 insertions(+) create mode 100644 .ansible-lint create mode 100644 .travis.yml create mode 100644 tests/inventory create mode 100644 tests/requirements.yml create mode 100644 tests/test.yml diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..6236b62 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,2 @@ +exclude_paths: + - ./tests/requirements \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3507f87 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,36 @@ +--- +language: python +cache: pip +python: "2.7" + +# Use the new container infrastructure +sudo: false + +# Install pip +addons: + apt: + packages: + - python-pip + +install: + # Install ansible and dependencies + - pip install ansible ansible-lint + + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=./tests/requirements/:../' > ansible.cfg + +script: + # Install requirements + - ansible-galaxy install -r tests/requirements.yml -p ./tests/requirements + + # Run ansible-lint + - ansible-lint . + + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..e03e58f --- /dev/null +++ b/tests/inventory @@ -0,0 +1,3 @@ +[test] +localhost + diff --git a/tests/requirements.yml b/tests/requirements.yml new file mode 100644 index 0000000..0953e76 --- /dev/null +++ b/tests/requirements.yml @@ -0,0 +1,8 @@ +- name: wcm_io_devops.jenkins_facts + version: master +- name: wcm_io_devops.jenkins_service + version: master +- name: wcm_io_devops.jenkins_plugins + version: master +- name: geerlingguy.jenkins + version: 3.5.0 \ No newline at end of file diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..a6cb811 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,4 @@ +- name: test role syntax + hosts: test + roles: + - ansible-jenkins-pipeline-library \ No newline at end of file From f1e180300798ab3261f8f8ac276515e4970eb36f Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Tue, 28 Aug 2018 16:27:33 +0200 Subject: [PATCH 5/7] Set versions for dependencies --- meta/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/main.yml b/meta/main.yml index 04acfe7..1840e54 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -23,6 +23,7 @@ galaxy_info: dependencies: # install jenkins - { role: geerlingguy.jenkins, + version: 3.5.0, jenkins_admin_username: "{{ jenkins_pipeline_library_admin_username }}", jenkins_admin_password: "{{ jenkins_pipeline_library_admin_password }}", jenkins_http_port: "{{ jenkins_pipeline_library_jenkins_port }}", @@ -45,6 +46,7 @@ dependencies: } # install plugins - { role: wcm_io_devops.jenkins_plugins, + version: 1.0.0, jenkins_plugins_admin_username: "{{ jenkins_pipeline_library_admin_username }}", jenkins_plugins_admin_password: "{{ jenkins_pipeline_library_admin_password }}", jenkins_plugins_jenkins_home: "{{ jenkins_pipeline_library_jenkins_home }}", From 1f8a6cfbba305fb9eb31842342254fc2520ba1cc Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Tue, 28 Aug 2018 16:40:53 +0200 Subject: [PATCH 6/7] Fixed galaxy tags --- meta/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 1840e54..d15f75f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -14,9 +14,6 @@ galaxy_info: galaxy_tags: - jenkins - - jenkins-pipeline-library - - jenkine-pipeline - - jenkins-shared-library - pipeline - wcmio From 57fc9c93b8594cde4db5e23d0a64bd4701752433 Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Tue, 28 Aug 2018 16:56:45 +0200 Subject: [PATCH 7/7] Set version for wcm_io_devops.jenkins_service dependency --- meta/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/main.yml b/meta/main.yml index d15f75f..fef9dae 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -35,7 +35,8 @@ dependencies: when: jenkins_pipeline_library_jenkins_install == true } # ensure service is started - - { role: wcm-io-devops.jenkins-service, + - { role: wcm_io_devops.jenkins_service, + version: 1.0.0, jenkins_service_hostname: "{{ jenkins_pipeline_library_jenkins_hostname }}", jenkins_service_port: "{{ jenkins_pipeline_library_jenkins_port }}", jenkins_service_url_prefix: "{{ jenkins_pipeline_library_jenkins_url_prefix }}",