Last active
April 6, 2019 05:19
-
-
Save branflake2267/c9555cf3cf4c2c73682652538a6bda68 to your computer and use it in GitHub Desktop.
Teamcity Sencha NPM Login Method. This Generates the ~/.npmrc login credentials.
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
| # Build step | |
| # You can replicate this by running `npm login --registry=https://npm.sencha.com --scope=@sencha` on your system. | |
| # Get your authtoken by logging in on your system and finding the auth token in ~/.npmrc. | |
| # Remove previous file | |
| rm -f ~/.npmrc | |
| # Write new ~/.npmrc | |
| echo "Writing auth tokens to ~/.npmrc" | |
| echo "@sencha:registry=http://npm.sencha.com" >> ~/.npmrc | |
| echo "//npm.sencha.com/:_authToken=%npm.sencha.com-authtoken%" >> ~/.npmrc | |
| # Debug | |
| echo "Debug contents of ~/.npmrc:" | |
| echo "~~~~~~~~~~~~~~~~~~~~~~" | |
| cat ~/.npmrc | |
| echo "~~~~~~~~~~~~~~~~~~~~~~" | |
| # Check login with whoami | |
| echo "Invoking NPM whoami" | |
| echo "~~~~~~~~~~~~~~~~~~~~~~" | |
| npm --registry http://npm.sencha.com/ whoami | |
| echo "~~~~~~~~~~~~~~~~~~~~~~" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TeamCity Variable:
%npm.sencha.com-authtoken%- It doesn't have to be a variable.Replace:
%npm.sencha.com-authtoken%with your token from the account you want to use. I copy the token from my local ~/.npmrc file.