Last active
March 13, 2020 12:18
-
-
Save jcarsique/49465ce0c2df6a61884dce6d8dc50a9f to your computer and use it in GitHub Desktop.
npm login against Nexus https://packages.nuxeo.com/
This file contains 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
( | |
export NPM_USER=<LdapUsername> | |
export NPM_PASS=<LdapPassword> | |
export NPM_EMAIL=<GitHubEmail> | |
sudo npm install -g npm-cli-adduser | |
npm config set email $NPM_EMAIL | |
for repo in $(curl -s -u "$NPM_USER:$NPM_PASS" -X GET "https://mavenin.nuxeo.com/nexus/service/rest/v1/repositories" -H "accept: application/json"|jq -r ' .[] | select(.format == "npm") | .name'); do | |
[[ $repo == "npm-internal" ]] && continue | |
echo $repo | |
npm-cli-adduser -r https://mavenin.nuxeo.com/nexus/repository/$repo/ | |
echo | |
done | |
unset NPM_PASS | |
) |
This file contains 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
( | |
export NPM_USER=<GitHubUsername> | |
export NPM_PASS=<GitHubToken> | |
export NPM_EMAIL=<GitHubEmail> | |
sudo npm install -g npm-cli-adduser | |
npm config set email $NPM_EMAIL | |
npm config set registry https://packages.nuxeo.com/repository/npm-internal | |
npm-cli-adduser | |
npm-cli-adduser -s @nuxeo | |
for repo in $(curl -s -u "$NPM_USER:$NPM_PASS" -X GET "https://packages.nuxeo.com/service/rest/v1/repositories" -H "accept: application/json"|jq -r ' .[] | select(.format == "npm") | .name'); do | |
[[ $repo == "npm-internal" ]] && continue | |
echo $repo | |
npm-cli-adduser -r https://packages.nuxeo.com/repository/$repo/ | |
echo | |
done | |
unset NPM_PASS | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs
jq
https://stedolan.github.io/jq/download/Use a GitHub token as password : https://github.com/settings/tokens/new?scopes=read:org