Giter VIP home page Giter VIP logo

ansible-jenkins-pipeline-library's Introduction

CI

wcm_io_devops.jenkins_pipeline_library

This role is a utility roles to setup jenkins instances for the usage of the wcm-io-devops jenkins-pipeline-library.

This role installs all necessary plugins in specific versions which ensures that the shared pipeline library is always running with the latest compatible plugins.

โ— Starting with version 2.138.1-1 the role will also configure the script security to allow some signatures!

Optionally the role also directly setups a Jenkins instance using geerlingguy.jenkins.

Versioning

The Version number will follow the following versioning schema:

[JenkinsVersion]-[ReleaseCount]

So for example:

  • 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.121.3-1 - first release for Jenkins 2.121.3

Requirements

This role requires Ansible 2.4 or higher and a running Jenkins on the target instance. If this role is taking care about the jenkins installation process you need to have java installed on the target machine. Please also have a look at https://github.com/geerlingguy/ansible-role-jenkins.

For the java installation we recommend:

Role Variables

Available variables are listed below, along with their default values:

jenkins_pipeline_library_jenkins_version: # see defaults.yaml for up-to-date value

The version of the jenkins when it is installed with the jenkins role dependency.

jenkins_pipeline_library_jenkins_install: false

Controls if the jenkins will be installed by the jenkins role dependency.

jenkins_pipeline_library_jenkins_process_user: jenkins

Linux jenkins user.

jenkins_pipeline_library_jenkins_process_group: "{{ jenkins_pipeline_library_jenkins_process_user }}"

Linux group of jenkins user.

URL for the repo key.

jenkins_pipeline_library_admin_username: admin

Jenkins admin username.

jenkins_pipeline_library_admin_password: admin

Jenkins admin password.

jenkins_pipeline_library_jenkins_home: /var/lib/jenkins

Path to the jenkins directory.

jenkins_pipeline_library_jenkins_hostname: localhost

Hostname of the jenkins instance.

jenkins_pipeline_library_jenkins_port: 8080

HTTP port of the jenkins instance.

jenkins_pipeline_library_jenkins_url_prefix: ""

Url prefix of the jenkins instance, e.g. when running in tomcat.

jenkins_pipeline_library_jenkins_update_dir: "{{ jenkins_pipeline_library_jenkins_home }}/updates"

Path to the jenkins update directory.

jenkins_pipeline_library_jenkins_base_url: "http://{{ jenkins_facts_jenkins_hostname }}:{{ jenkins_facts_jenkins_port }}{{ jenkins_facts_jenkins_url_prefix }}"

The base url of the jenkins instance.

jenkins_pipeline_library_updates_expiration: 86400

Maximum seconds since the last jenkins plugin update check.

jenkins_pipeline_library_updates_timeout: 60

Timeout for jenkins update operation.

jenkins_pipeline_library_debug: false

When set to enable the role will log some debug information.

jenkins_pipeline_library_plugins_present: [...]

Plugins and their versions that must be present for jenkins-pipeline-library.

jenkins_pipeline_library_approved_signatures_present:

Signatures that need to be approved for jenkins-pipeline-library, otherwise the signatures will be blocked by script-security.

๐Ÿ’ก Since this list is long please refer to defaults

jenkins_pipeline_library_plugins_absent: []

Plugins that must be absent for jenkins-pipeline-library.

Dependencies

This role depends on the wcm_io_devops.jenkins_plugins role to install/uninstall the plugins needed by the jenkins-pipeline-library

In order to allow to run the jenkins-pipeline-library with the Pipeline Supporting APIs 1.18+ (workflow-support) and with Script Security ( script-security) 1.44+ this role also depends on wcm_io_devops.jenkins_script_plugin for whitelisting some signatures in the Groovy Sandbox.

For installing a Jenkins on the target instance the role is using geerlingguy.jenkins.

As transitive dependency this role uses the wcm_io_devops.jenkins_facts role to retrieve the list of installed plugins from the Jenkins instance.

Example Playbook

Prepares the Jenkins instance for the use of the https://github.com/wcm-io-devops/jenkins-pipeline-library on a debian based OS.

- hosts: localhost
  become: yes
  vars:
    # values for geerlingguy.jenkins
    jenkins_prefer_lts: true
    # required until https://github.com/geerlingguy/ansible-role-jenkins/pull/294 is merged    
    jenkins_pkg_url: "https://pkg.jenkins.io/debian-stable/binary"
    
    # values for wcm_io_devops.jenkins_pipeline_library
    jenkins_pipeline_library_jenkins_install: true
  roles:
    - role: geerlingguy.java
    - role: wcm_io_devops.jenkins_pipeline_library

License

Apache 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.