Skip to content

Instantly share code, notes, and snippets.

@tkambler
Last active February 23, 2017 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkambler/400cf764afe5e5b515c2eaa7c4952c91 to your computer and use it in GitHub Desktop.
Save tkambler/400cf764afe5e5b515c2eaa7c4952c91 to your computer and use it in GitHub Desktop.
Jenkinsfile
#!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