Compare commits
No commits in common. "b62d45d0d846f099f4551b94f257ad50c370f85c" and "ca4182d798680fba0f6c80be4e42a680625324ac" have entirely different histories.
b62d45d0d8
...
ca4182d798
|
|
@ -1,5 +1,3 @@
|
|||
def buildArtifact = true
|
||||
|
||||
pipeline {
|
||||
agent { label 'ruby && freebsd' }
|
||||
|
||||
|
|
@ -20,6 +18,7 @@ pipeline {
|
|||
}
|
||||
stage('Build dependencies') {
|
||||
steps {
|
||||
sh 'bundle config set --local path "vendor"'
|
||||
sh 'bundle install'
|
||||
sh 'sequel -m db/migrations sqlite://db/${DB_NAME}'
|
||||
}
|
||||
|
|
@ -27,57 +26,25 @@ pipeline {
|
|||
stage('Audit Dependencies') {
|
||||
steps {
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec ruby-audit check'
|
||||
sh 'bundle exec bundle-audit check >> audit.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
sh 'bundle exec ruby-audit check'
|
||||
sh 'bundle exec bundle-audit check >> audit.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Code Linting') {
|
||||
steps {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec rubocop --format html --out rubocop.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
sh 'bundle exec rubocop --format html --out rubocop.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Run tests') {
|
||||
steps {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec cucumber features --format html --out cucumber.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
sh 'bundle exec cucumber features --format html --out cucumber.html'
|
||||
}
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec rspec spec --format html --out spec.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
sh 'bundle exec rspec spec --format html --out spec.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -94,19 +61,13 @@ pipeline {
|
|||
}
|
||||
}
|
||||
stage('Build production deliverable') {
|
||||
when {
|
||||
expression {
|
||||
buildArtifact
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
sh ''' #!/usr/local/bin/bash
|
||||
ZIP_FILE="url-shortener_${BRANCH_NAME}_$(date "+%Y-%m-%d_%H-%M-%S").tgz"
|
||||
CUR_DIR=$(pwd)
|
||||
bundle config set --local without 'test'
|
||||
bundle config set --local path "vendor"
|
||||
bundle install
|
||||
bundle clean
|
||||
mkdir -p /tmp/url-shortener
|
||||
cp -R * /tmp/url-shortener
|
||||
cp .env.rb /tmp/url-shortener/
|
||||
|
|
@ -122,13 +83,9 @@ pipeline {
|
|||
}
|
||||
}
|
||||
stage('Clean up deliverable') {
|
||||
when {
|
||||
expression {
|
||||
buildArtifact
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'rm -rf /tmp/url-shortener'
|
||||
sh 'rm -rf *.tgz'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue