Update authentication in run.sh scripts

pull/115/head
Muhammad Atif Ali 2 years ago
parent 7d857838c2
commit 168e20d5dc

@ -33,9 +33,9 @@ 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

@ -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."

Loading…
Cancel
Save