Skip to content

Shared lib for Jenkins pipelines to interact with Hesperides

License

Notifications You must be signed in to change notification settings

sncf-connect-tech/hesperides-jenkins-lib

Repository files navigation

License: GPL v3

This is a Groovy shared lib for Jenkins 2 pipelines, but also useable as a Groovy command-line script.

It lets you interact with Hesperides. It provides some high level features over the bare HTTP REST API:

  • setPlatformModulesVersion: change the version of all modules on a plateform
  • updateProperties: change instance/module/global properties on a given Hesperides platform, from a JSON file listing deltas
  • upsertFromDescriptor: upsert (create or update) one or several workingcopy module(s) and their templates from a file descriptor

This project is actively maintained. A detailed releases changelog is available here: CHANGELOG.md

A documentation for the exposed Groovy functions is available here: https://voyages-sncf-technologies.github.io/hesperides-jenkins-lib/

Summary

Installation

In "Manage Jenkins > Configure System" aka /jenkins/configure, adds the git@... URL to this repo in Global Pipeline Libraries, and ticks the "load implicitly" checkbox. You can use either the master branch to use the latest version, or specify a tag to ensure more stability.

You will also need to install the http_request Jenkins plugin from its .hpi.

Usage

Jenkins pipeline

cf. examples/Jenkinsfile & vars/*.txt documentation files for examples.

Note: to check your Jenkinsfiles syntax, use a linter ! cf. https://github.com/Lucas-C/pre-commit-hooks#other-useful-local-hooks

CLI script for the standard Groovy interpreter

cf. examples/createPlatform.groovy

Contributing / Development

cf. CONTRIBUTING.md