Guest User

Untitled

a guest
Feb 6th, 2018
2,946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. npm login << EOF
  2. username
  3. password
  4. email
  5. EOF
  6.  
  7. Username: Password: npm ERR! cb() never called!
  8. npm ERR! not ok code 0
  9.  
  10. TOKEN=$(curl -s
  11. -H "Accept: application/json"
  12. -H "Content-Type:application/json"
  13. -X PUT --data '{"name": "username_here", "password": "password_here"}'
  14. http://your_registry/-/user/org.couchdb.user:username_here 2>&1 | grep -Po
  15. '(?<="token": ")[^"]*')
  16.  
  17. npm set registry "http://your_registry"
  18. npm set //your_registry/:_authToken $TOKEN
  19.  
  20. {
  21. name: username,
  22. password: password
  23. }
  24.  
  25. apt-get install expect-dev
  26.  
  27. #!/usr/bin/expect -f
  28.  
  29. # set our args into variables
  30. set i 0; foreach n $argv {set "p[incr i]" $n}
  31.  
  32. set timeout 60
  33. #npm login command, add whatever command-line args are necessary
  34. spawn npm login
  35. match_max 100000
  36.  
  37. expect "Username"
  38. send "$p1r"
  39.  
  40. expect "Password"
  41. send "$p2r"
  42.  
  43. expect "Email"
  44. send "$p3r"
  45.  
  46. expect {
  47. timeout exit 1
  48. eof
  49. }
  50.  
  51. expect -f npm_login_expect myuser mypassword "myuser@domain.com"
  52.  
  53. export NPM_USERNAME=mUs34
  54. export NPM_PASSWORD=mypassW0rD
  55. export NPM_EMAIL=user@domain.com
  56. npm adduser<<!
  57. $NPM_USERNAME
  58. $NPM_PASSWORD
  59. $NPM_EMAIL
  60. !
  61.  
  62. - echo "//<npm-registry>:8080/:_authToken=$AUTH_TOKEN" > ~/.npmrc
  63. - npm publish
  64.  
  65. publish:
  66. stage: deploy
  67. only:
  68. - tags
  69. script:
  70. - yarn run build
  71. - echo "//<npm-registry>:8080/:_authToken=$NPME_AUTH_TOKEN" > ~/.npmrc
  72. - npm publish
  73. - echo 'Congrats on your publication!'
Add Comment
Please, Sign In to add comment