This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from fchavant/simplify-jenkinsfile
Simplify Jenkinsfile
- Loading branch information
Showing
1 changed file
with
16 additions
and
34 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 |
---|---|---|
@@ -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' | ||
} | ||
} | ||
} |