added try catch wrappers around other parts. if they fail, don't build
Gitea Bucky/url-shortener/pipeline/head This commit looks good
Gitea Bucky/url-shortener/pipeline/head This commit looks good
the deliverable
This commit is contained in:
Vendored
+25
-1
@@ -1,4 +1,4 @@
|
|||||||
def buildArtifact = false
|
def buildArtifact = true
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'ruby && freebsd' }
|
agent { label 'ruby && freebsd' }
|
||||||
@@ -43,17 +43,41 @@ pipeline {
|
|||||||
stage('Code Linting') {
|
stage('Code Linting') {
|
||||||
steps {
|
steps {
|
||||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||||
|
script {
|
||||||
|
try {
|
||||||
sh 'bundle exec rubocop --format html --out rubocop.html'
|
sh 'bundle exec rubocop --format html --out rubocop.html'
|
||||||
|
} catch (e) {
|
||||||
|
script {
|
||||||
|
buildArtifact = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Run tests') {
|
stage('Run tests') {
|
||||||
steps {
|
steps {
|
||||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||||
|
script {
|
||||||
|
try {
|
||||||
sh 'bundle exec cucumber features --format html --out cucumber.html'
|
sh 'bundle exec cucumber features --format html --out cucumber.html'
|
||||||
|
} catch (e) {
|
||||||
|
script {
|
||||||
|
buildArtifact = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||||
|
script {
|
||||||
|
try {
|
||||||
sh 'bundle exec rspec spec --format html --out spec.html'
|
sh 'bundle exec rspec spec --format html --out spec.html'
|
||||||
|
} catch (e) {
|
||||||
|
script {
|
||||||
|
buildArtifact = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user