-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gem publishing portion of Jenkinsfile
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
1 parent
e05adef
commit fb06296
Showing
1 changed file
with
3 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
) | ||
} |