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/README.md b/README.md index 941b66d..0e0adee 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 @@ -110,12 +110,12 @@ Plugins that must be absent for jenkins-pipeline-library. ## Dependencies This role 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. @@ -126,7 +126,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 e08c289..480969d 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 @@ -13,15 +14,13 @@ galaxy_info: galaxy_tags: - jenkins - - jenkins-pipeline-library - - jenkine-pipeline - - jenkins-shared-library - pipeline - wcmio 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 }}", @@ -31,12 +30,12 @@ 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 - } - # install plugins - - { role: wcm-io-devops.jenkins-plugins, + } # 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 }}", @@ -45,4 +44,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 + } 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