Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #!groovy
  2.  
  3. try {
  4.  
  5. node('mac') {
  6.  
  7. ansiColor('xterm') {
  8.  
  9.  
  10. stage 'Clean workspace'
  11. deleteDir()
  12.  
  13. stage 'Checkout'
  14. checkout scm
  15.  
  16. stage 'Build'
  17.  
  18. withCredentials(
  19. [
  20. [$class: 'UsernamePasswordMultiBinding', credentialsId: 'npm', usernameVariable: 'NPM_USERNAME', passwordVariable: 'NPM_PASSWORD'],
  21. [$class: 'StringBinding', credentialsId: 'npmEmail', variable: 'NPM_EMAIL'],
  22. [$class: 'StringBinding', credentialsId: 'npmRegistry', variable: 'NPM_REGISTRY']
  23. ]) {
  24.  
  25. sh "printenv"
  26. sh "npm set registry ${NPM_REGISTRY}"
  27. sh "npm-cli-login -u ${NPM_USERNAME} -p ${NPM_PASSWORD} -e ${NPM_EMAIL} -r ${NPM_REGISTRY}"
  28. sh "npm i"
  29. sh "security -v unlock-keychain -p ... $HOME/Library/Keychains/login.keychain"
  30. sh "grunt build --sign --beta"
  31.  
  32. }
  33.  
  34. }
  35.  
  36. }
  37.  
  38. } catch(err) {
  39.  
  40. echo "Caught: ${err}"
  41.  
  42. // Send an email... or something.
  43.  
  44. throw err;
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement