Skip to content

Instantly share code, notes, and snippets.

@jcarsique
Last active March 13, 2020 12:18
Show Gist options
  • Save jcarsique/49465ce0c2df6a61884dce6d8dc50a9f to your computer and use it in GitHub Desktop.
Save jcarsique/49465ce0c2df6a61884dce6d8dc50a9f to your computer and use it in GitHub Desktop.
npm login against Nexus https://packages.nuxeo.com/
(
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
)
(
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
)
@jcarsique
Copy link
Author

jcarsique commented Mar 13, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment