diff --git a/inventory.yml b/inventory.yml index ad576d4..7e16944 100644 --- a/inventory.yml +++ b/inventory.yml @@ -1,6 +1,12 @@ all: hosts: test-jenkins-via-ansible.example.net: + jenkins_plugins_system_dependency_supp: + - php-gd + - php-xml + - php-mbstring + - php-pgsql + - postgresql jobs: template-php-v1: # Job template (deactivated) which can be manually cloned. foo: @@ -12,6 +18,24 @@ all: baz: # Just a test to see if the default template can # be run without any vars + jenkins2.example.net: + jenkins_plugins_system_dependency_supp: + - php-gd + - php-xml + - php-mbstring + - php-curl + - php-zip + - php-bcmath + - php-intl + - php-soap + - php-mysql + - mariadb-server + jobs: + template-php-v1: # Job template (deactivated) which can be manually cloned. + jsmith-project: + repository_url: git@github.com:jsmith/project.git + branch_spec: 'refs/heads/feature/continuous-integration' + #branch_spec: '*/develop' vars: # Check if etckeeper is installed and /etc is clean checketckeeper: True diff --git a/roles/jenkins-php-v1/defaults/main.yml b/roles/jenkins-php-v1/defaults/main.yml index 632182e..52fe558 100644 --- a/roles/jenkins-php-v1/defaults/main.yml +++ b/roles/jenkins-php-v1/defaults/main.yml @@ -38,29 +38,28 @@ jenkins_plugins: - ant - ws-cleanup # workspace-cleanup : I prefer to be clean at each build start # Taken from jenkins-php.org - - checkstyle - cloverphp - crap4j - - dry - htmlpublisher - jdepend - plot - - pmd - violations - - warnings - xunit + - warnings-ng + - checkstyle # integrated into 'warnings-ng' ? + - dry # integrated into 'warnings-ng' ? + - pmd # integrated into 'warnings-ng' ? + - warnings # integrated into 'warnings-ng' ? + #- configuration-as-code # this playbook needs more rework... + #- job-dsl # too much work as of 2020-03 +# note: you can add dependencies to a specific host with +# the variable jenkins_plugins_system_dependency_supp +jenkins_plugins_system_dependency_supp: jenkins_plugins_system_dependency: - ant - composer - - php-gd - - php-xml - - php-mbstring - - php-mysql - - php-pgsql - php-xdebug # for the code coverage - - mariadb-server - - postgresql - phpunit # TODO: test if we can use the /vendor one ? - php-codesniffer - phploc diff --git a/roles/jenkins-php-v1/tasks/20_install-plugins.yml b/roles/jenkins-php-v1/tasks/20_install-plugins.yml index 1575586..acfc5f2 100644 --- a/roles/jenkins-php-v1/tasks/20_install-plugins.yml +++ b/roles/jenkins-php-v1/tasks/20_install-plugins.yml @@ -44,7 +44,10 @@ when: item not in current_plugin_list.stdout_lines notify: safe-restart jenkins and wait +# For convenience, we concatenate two lists of packages : +# - jenkins_plugins_system_dependency +# - jenkins_plugins_system_dependency_supp - name: Install system packages needed by Jenkins plugins apt: - name: "{{ jenkins_plugins_system_dependency }}" + name: "{{ jenkins_plugins_system_dependency | union(jenkins_plugins_system_dependency_supp | default([])) }}" state: present