Forked from g0t4/solitaire-pipeline-starting-point.groovy
Last active
April 23, 2017 16:37
-
-
Save nurrony/b47c8a2e7919b0f42e3ade781357590a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| stage "CI" | |
| node { | |
| /**git branch: 'jenkins2-course', | |
| url: 'https://github.com/nmrony/solitaire-systemjs-course.git'*/ | |
| checkout scm | |
| nodejs(nodeJSInstallationName: 'node') { | |
| sh 'npm install --verbose' | |
| stash excludes: 'test-results/**', includes: '**', name: 'everything' | |
| } | |
| } | |
| node('mac') { | |
| sh 'ls' | |
| sh ' rm -fr *' | |
| unstash 'everything' | |
| sh 'ls' | |
| } | |
| stage 'Browser Testing' | |
| parallel chrome: { | |
| runTests("Chrome") | |
| }, safari: { | |
| runTests("Safari") | |
| } | |
| input 'Deploy to staging?' | |
| // limit concurrency so we don't perform simultinious deploys | |
| // and if multiple pipelines are executing, | |
| // newest is only that will be allowed throughm rest will be canceled | |
| stage name: 'Deploy', concurrency: 1 | |
| node { | |
| sh "echo '<h1>${env.BUILD_DISPLAY_NAME}</h1>' >> app/index.html" | |
| sh 'docker-compose up -d --build' | |
| } | |
| def runTests(browser) { | |
| node { | |
| sh 'rm -fr *' | |
| unstash 'everything' | |
| nodejs(nodeJSInstallationName: 'node') { | |
| sh "npm run test-single-run -- --browsers ${browser}" | |
| } | |
| step([$class: 'JUnitResultArchiver', | |
| testResults: 'test-results/**/test-results.xml']) | |
| } | |
| } |
This file contains hidden or 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
| stage "CI" | |
| node { | |
| git branch: 'jenkins2-course', | |
| url: 'https://github.com/nmrony/solitaire-systemjs-course.git' | |
| nodejs(nodeJSInstallationName: 'node') { | |
| sh 'npm install --verbose' | |
| stash excludes: 'test-results/**', includes: '**', name: 'everything' | |
| } | |
| } | |
| node('mac') { | |
| sh 'ls' | |
| sh ' rm -fr *' | |
| unstash 'everything' | |
| sh 'ls' | |
| } | |
| stage 'Browser Testing' | |
| parallel chrome: { | |
| runTests("Chrome") | |
| }, safari: { | |
| runTests("Safari") | |
| } | |
| input 'Deploy to staging?' | |
| // limit concurrency so we don't perform simultinious deploys | |
| // and if multiple pipelines are executing, | |
| // newest is only that will be allowed throughm rest will be canceled | |
| stage name: 'Deploy', concurrency: 1 | |
| node { | |
| sh "echo '<h1>${env.BUILD_DISPLAY_NAME}</h1>' >> app/index.html" | |
| sh 'docker-compose up -d --build' | |
| } | |
| def runTests(browser) { | |
| node { | |
| sh 'rm -fr *' | |
| unstash 'everything' | |
| nodejs(nodeJSInstallationName: 'node') { | |
| sh "npm run test-single-run -- --browsers ${browser}" | |
| } | |
| step([$class: 'JUnitResultArchiver', | |
| testResults: 'test-results/**/test-results.xml']) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment