Skip to content

Commit

Permalink
Fix gem publishing portion of Jenkinsfile
Browse files Browse the repository at this point in the history
govuk-jenkinslib does a lot of what we have defined explicitly,
out of the box. For example, gem publishing will automatically
default to the name of the repository, so we don't need to
specify 'REPOSITORY' globally.
  • Loading branch information
ChrisBAshton committed Jul 27, 2020
1 parent e05adef commit fb06296
Showing 1 changed file with 3 additions and 45 deletions.
48 changes: 3 additions & 45 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,8 @@

library("govuk")

REPOSITORY = 'govuk_schemas'

node {

try {
stage('Checkout') {
checkout scm
}

stage('Clean') {
govuk.cleanupGit()
govuk.mergeMasterBranch()
}

stage("Set up content schema dependency") {
govuk.contentSchemaDependency()
}

stage('Bundle') {
echo 'Bundling'
sh("bundle install --path ${JENKINS_HOME}/bundles/${JOB_NAME}")
}

stage('Linter') {
govuk.lintRuby()
}

stage('Tests') {
govuk.setEnvar('RAILS_ENV', 'test')
govuk.runTests('spec')
}

if(env.BRANCH_NAME == "master") {
stage('Publish Gem') {
govuk.publishGem(REPOSITORY, env.BRANCH_NAME)
}
}

} catch (e) {
currentBuild.result = 'FAILED'
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: '[email protected]',
sendToIndividuals: true])
throw e
}
govuk.buildProject(
rubyLintDiff: false,
)
}

0 comments on commit fb06296

Please sign in to comment.