Commit 3b2739d8 authored by Simon Brass's avatar Simon Brass
Browse files

[OCaml] Template for OCaml Pipeline

parent 5240ce6a
#!groovy
/*
The MIT License
Copyright (c) 2015-, CloudBees, Inc., and a number of other of contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
String email_to = ""
if (getBinding().hasVariable("EMAIL_TO")) {
email_to = EMAIL_TO
}
node('master') {
def err = null
currentBuild.result = "SUCCESS"
try {
stage 'Checkout'
checkout scm
// stage 'Test'
// env.NODE_ENV = "test"
// print "Environment will be : ${env.NODE_ENV}"
// sh 'node -v'
// sh 'npm prune'
// sh 'npm install'
// sh 'npm test'
// stage 'Build Docker'
// sh './dockerBuild.sh'
// stage 'Deploy'
// echo 'Push to Repo'
// sh './dockerPushToRepo.sh'
// echo 'ssh to web server and tell it to pull new image'
// sh 'ssh deploy@xxxxx.xxxxx.com running/xxxxxxx/dockerRun.sh'
// stage 'Cleanup'
// echo 'prune and cleanup'
// sh 'npm prune'
// sh 'rm node_modules -rf'
}
catch (caughtError) {
err = caughtError
currentBuild.result = "FAILURE"
} finally {
(currentBuild.result != "ABORTED") && node("master") {
// Send e-mail notifications for failed or unstable builds.
// currentBuild.result must be non-null for this step to work.
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: "${email_to}",
sendToIndividuals: true])
}
/* Must re-throw exception to propagate error */
if (err) {
throw err
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment