Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #253 from fchavant/simplify-jenkinsfile
Browse files Browse the repository at this point in the history
Simplify Jenkinsfile
  • Loading branch information
willclarktech committed Sep 27, 2017
2 parents 2e0d9fe + 000b062 commit 2a38927
Showing 1 changed file with 16 additions and 34 deletions.
50 changes: 16 additions & 34 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,54 +1,36 @@
node('lisky-01') {
lock(resource: 'lisky-01', inversePrecedence: true) {
stage ('Prepare Workspace') {
deleteDir()
checkout scm
pipeline {
agent { node { label 'lisky' } }
stages {
stage('Prepare workspace') {
steps {
deleteDir()
checkout scm
}
}

stage ('Install dependencies') {
try {
stage('Install dependencies') {
steps {
sh '''
npm install --verbose
cp ~/.coveralls.yml-lisky .coveralls.yml
'''
} catch (err) {
currentBuild.result = 'FAILURE'
error('Stopping build, installation failed')
}
}

stage ('Run lint') {
try {
stage('Run lint') {
steps {
sh 'npm run lint'
} catch (err) {
currentBuild.result = 'FAILURE'
error('Stopping build, linting failed')
}
}

stage ('Run tests') {
try {
stage('Run tests') {
steps {
sh 'npm run test'
} catch (err) {
currentBuild.result = 'FAILURE'
error('Stopping build, tests failed')
}
}

stage ('Run vulnerabilities check') {
try {
stage('Run vulnerabilities check') {
steps {
withCredentials([string(credentialsId: 'liskhq-snyk-token', variable: 'SNYK_TOKEN')]) {
sh 'snyk test'
}
} catch (err) {
currentBuild.result = 'FAILURE'
error('Stopping build, vulnerabilities check failed')
}
}

stage ('Set milestone') {
milestone 1
currentBuild.result = 'SUCCESS'
}
}
}

0 comments on commit 2a38927

Please sign in to comment.