Last active
February 23, 2017 20:10
-
-
Save tkambler/400cf764afe5e5b515c2eaa7c4952c91 to your computer and use it in GitHub Desktop.
Jenkinsfile
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
#!groovy | |
try { | |
node('mac') { | |
ansiColor('xterm') { | |
stage 'Clean workspace' | |
deleteDir() | |
stage 'Checkout' | |
checkout scm | |
stage 'Build' | |
withCredentials( | |
[ | |
[$class: 'UsernamePasswordMultiBinding', credentialsId: 'npm', usernameVariable: 'NPM_USERNAME', passwordVariable: 'NPM_PASSWORD'], | |
[$class: 'StringBinding', credentialsId: 'npmEmail', variable: 'NPM_EMAIL'], | |
[$class: 'StringBinding', credentialsId: 'npmRegistry', variable: 'NPM_REGISTRY'] | |
]) { | |
sh "printenv" | |
sh "npm set registry ${NPM_REGISTRY}" | |
sh "npm-cli-login -u ${NPM_USERNAME} -p ${NPM_PASSWORD} -e ${NPM_EMAIL} -r ${NPM_REGISTRY}" | |
sh "npm i" | |
sh "security -v unlock-keychain -p ... $HOME/Library/Keychains/login.keychain" | |
sh "grunt build --sign --beta" | |
} | |
} | |
} | |
} catch(err) { | |
echo "Caught: ${err}" | |
// Send an email... or something. | |
throw err; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment