File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,17 @@ if [ "$GIT_SSH_KEY" != "" ]; then
18
18
# Clear that sensitive key data from the environment
19
19
export GIT_SSH_KEY=0
20
20
fi
21
+
22
+ # Clean up Artifactory npm setup
23
+ if [ ! -z " $NPM_REGISTRY_TOKEN " ] && [ ! -z " $NPM_REGISTRY_USER " ] && [ ! -z " $NPM_REGISTRY_URL " ] && [ ! -z " $NPM_REGISTRY_AUTH " ]; then
24
+ echo " Cleaning up NPM config" >&1
25
+
26
+ # Now that npm has finished running, we shouldn't need the registry config anymore.
27
+ # Remove the files that we created.
28
+ rm -f ~ /.npmrc
29
+
30
+ # Clear that sensitive key data from the environment
31
+ export NPM_REGISTRY_TOKEN=0
32
+ echo " ... done."
33
+ echo " " >&1
34
+ fi
Original file line number Diff line number Diff line change @@ -46,3 +46,17 @@ shopt -u dotglob
46
46
47
47
commitHash=$( git rev-parse --short HEAD)
48
48
echo " Docs site successfully setup. auth0-docs commit: $commitHash "
49
+
50
+ # Setup Artifactory npm registry and permissions
51
+ if [ ! -z " $NPM_REGISTRY_TOKEN " ] && [ ! -z " $NPM_REGISTRY_USER " ] && [ ! -z " $NPM_REGISTRY_URL " ] && [ ! -z " $NPM_REGISTRY_AUTH " ]; then
52
+ echo " Detected NPM Registry. Adding Artifactory config..." >&1
53
+ echo " registry=$NPM_REGISTRY_URL " > ~ /.npmrc
54
+ curl -s -u $NPM_REGISTRY_USER :$NPM_REGISTRY_TOKEN $NPM_REGISTRY_AUTH >> ~ /.npmrc
55
+ success=$?
56
+ if [ $success -ne 0 ]; then
57
+ echo " ... failed!"
58
+ else
59
+ echo " ... done."
60
+ fi
61
+ echo " " >&1
62
+ fi
You can’t perform that action at this time.
0 commit comments