|
|
|
@ -33,13 +33,12 @@ email=${ARTIFACTORY_EMAIL}
|
|
|
|
|
registry=${JFROG_URL}/artifactory/api/npm/${REPOSITORY_NPM}
|
|
|
|
|
EOF
|
|
|
|
|
if [ "$(npm --version | cut -d. -f1)" -ge 9 ]; then
|
|
|
|
|
echo "//${JFROG_HOST}/artifactory/api/npm/${REPOSITORY_NPM}/:_authToken=$(jf rt curl /api/npm/auth | awk -F'= ' '/_auth =/{print $2}')" >> ~/.npmrc
|
|
|
|
|
echo "//${JFROG_HOST}/artifactory/api/npm/${REPOSITORY_NPM}/:_authToken=${ARTIFACTORY_ACCESS_TOKEN}" >> ~/.npmrc
|
|
|
|
|
else
|
|
|
|
|
echo "_auth=$(jf rt curl /api/npm/auth | awk -F'= ' '/_auth =/{print $2}')" >> ~/.npmrc
|
|
|
|
|
echo "_auth=$(echo -n '${ARTIFACTORY_USERNAME}:${ARTIFACTORY_ACCESS_TOKEN}' | base64)" >> ~/.npmrc
|
|
|
|
|
echo "always-auth=true" >> ~/.npmrc
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Configure the `pip` to use the Artifactory "python" repository.
|
|
|
|
|
if [ -z "${REPOSITORY_PYPI}" ]; then
|
|
|
|
|
echo "🤔 no pypi repository is set, skipping pip configuration."
|
|
|
|
|