Giter Club home page Giter Club logo

alphagov.govuk-jenkinslib's Introduction

GOV.UK Jenkinslib

A library for setting up CI environments in GOV.UK.

The library will need to be loaded into a Jenkins instance before being able to use it. This will depend on Jenkins being configured to load it.

To load the library, use the library function:

library("govuk")

To specify a different branch for testing:

library("govuk@my-new-branch")

Setting up CI on GOV.UK

For most Ruby projects, the following Jenkinsfile is sufficient:

#!/usr/bin/env groovy

library("govuk")

node {
  govuk.buildProject()
}

This will set up dependencies, run the tests and report back to GitHub.

For applications: the master branch of applications will be deployed to integration

For gems: if the version has changed, the latest version will be released to rubygems.org

Exceptions

If you need to run tests using a command other than the default rake task you can do this by specifying the overrideTestTask option:

#!/usr/bin/env groovy

library("govuk")

node {
  govuk.buildProject(overrideTestTask: {
    stage("Run custom tests") {
      govuk.runRakeTask("super-special-tests")
    }
  })
}
Parameter Description Default
afterTest A closure containing commands to run after the test stage, such as report publishing
beforeTest A closure containing commands to run before the test stage, such as environment variable configuration
brakeman Whether or not to run the Brakeman security scanner true if a Rails app, otherwise false
extraParameters Provide details here of any extra parameters that can be used to configure this build. See: https://jenkins.io/doc/pipeline/steps/workflow-multibranch/#code-properties-code-set-job-properties for details on the format and structure of these extra parameters.
extraRubyVersions Ruby versions to run the tests against in addition to the versions currently supported by all GOV.UK applications. Only applies to gems because they may be used in projects with different Ruby versions. []
gemName If publishing a Rubygem, you can specify the Gem name. Repository name
overrideTestTask A closure containing commands to run to test the project. This will run instead of the default bundle exec rake
publishingE2ETests Whether or not to run the Publishing end-to-end tests. false
skipDeployToIntegration Whether or not to skip the "Deploy to integration" stage false
yarnInstall Whether or not to install Yarn dependencies if a yarn.lock file is found true

alphagov.govuk-jenkinslib's People

Contributors

cbaines avatar tijmenb avatar kevindew avatar surminus avatar thomasleese avatar barrucadu avatar issyl0 avatar theseanything avatar sihugh avatar benthorner avatar fredericfran-gds avatar rubenarakelyan avatar brucebolt avatar dwhenry avatar matmoore avatar boffbowsh avatar camdesgov avatar

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.