From 7c8a7632720a5793de1c271c1342af23fba6cc90 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 26 Sep 2023 16:02:12 +0300 Subject: [PATCH] fix script --- jfrog/run.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/jfrog/run.sh b/jfrog/run.sh index f4e413d..17fc8bf 100644 --- a/jfrog/run.sh +++ b/jfrog/run.sh @@ -3,24 +3,27 @@ BOLD='\033[0;1m' echo "$${BOLD}Installing JFrog CLI..." +# Install the JFrog CLI. +curl -fL https://getcli.jfrog.io | sh + # The jf CLI checks $CI when determining whether to use interactive # flows. export CI=true - +# Authenticate with the JFrog CLI. jf c rm 0 || true -echo ${ARTIFACTORY_ACCESS_TOKEN} | jf c add --access-token-stdin --url https://${JFROG_HOST} 0 +echo "${ARTIFACTORY_ACCESS_TOKEN}" | jf c add --access-token-stdin --url "https://${JFROG_HOST}" 0 # Configure the `npm` CLI to use the Artifactory "npm" repository. if [ -z "${REPOSITORY_NPM}" ]; then echo "🤔 REPOSITORY_NPM is not set, skipping npm configuration." else echo "📦 Configuring npm..." - jf rt npm-config set registry https://${JFROG_HOST}/artifactory/api/npm/${REPOSITORY_NPM} + jf rt npm-config set registry "https://${JFROG_HOST}/artifactory/api/npm/${REPOSITORY_NPM}" cat << EOF > ~/.npmrc - email = ${ARTIFACTORY_USERNAME} - registry = https://${JFROG_HOST}/artifactory/api/npm/${REPOSITORY_NPM} - EOF - jf rt curl /api/npm/auth >> .npmrc +email = ${ARTIFACTORY_USERNAME} +registry = https://${JFROG_HOST}/artifactory/api/npm/${REPOSITORY_NPM} +EOF + jf rt curl /api/npm/auth >> ~/.npmrc fi # Configure the `pip` to use the Artifactory "python" repository. @@ -30,9 +33,9 @@ else echo "🐍 Configuring pip..." mkdir -p ~/.pip cat << EOF > ~/.pip/pip.conf - [global] - index-url = https://${ARTIFACTORY_USERNAME}:${ARTIFACTORY_ACCESS_TOKEN}@${JFROG_HOST}/artifactory/api/pypi/${REPOSITORY_PYPI}/simple - EOF +[global] +index-url = https://${ARTIFACTORY_USERNAME}:${ARTIFACTORY_ACCESS_TOKEN}@${JFROG_HOST}/artifactory/api/pypi/${REPOSITORY_PYPI}/simple +EOF fi # Set GOPROXY to use the Artifactory "go" repository. @@ -42,5 +45,4 @@ else echo "🐹 Configuring go..." export GOPROXY="https://${ARTIFACTORY_USERNAME}:${ARTIFACTORY_ACCESS_TOKEN}@${JFROG_HOST}/artifactory/api/go/${REPOSITORY_GO}" fi -echo "🥳 Configuration comlete!" - +echo "🥳 Configuration complete!" \ No newline at end of file