forked from okta/okta-developer-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·60 lines (47 loc) · 1.62 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·60 lines (47 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
export NODE_OPTIONS=--max_old_space_size=8192
cd ${OKTA_HOME}/${REPO}
export GENERATED_SITE_LOCATION=dist
# Use latest version of Node
setup_service node v12.22.7
if [[ -z "${BUILD_FAILURE}" ]]; then
export BUILD_FAILURE=1
fi
if [[ -z "${SUCCESS}" ]]; then
export SUCCESS=0
fi
# fix for bacon to be able to function.
YARN_REGISTRY=https://registry.yarnpkg.com
OKTA_REGISTRY=${ARTIFACTORY_URL}/api/npm/npm-okta-master
# Replace yarn artifactory with Okta's
sed -i "s#${YARN_REGISTRY}#${OKTA_REGISTRY}#" yarn.lock
export PATH="${PATH}:$(yarn global bin)"
# Install required dependencies
yarn global add @okta/ci-append-sha
yarn global add @okta/ci-pkginfo
if ! yarn install ; then
echo "yarn install failed! Exiting..."
exit ${FAILED_SETUP}
fi
# Revert the original change
sed -i "s#${OKTA_REGISTRY}#${YARN_REGISTRY}#" yarn.lock
function interject() {
echo "===== ${1} ====="
}
function send_promotion_message() {
curl -H "Authorization: Bearer ${TESTSERVICE_SLAVE_JWT}" \
-H "Content-Type: application/json" \
-X POST -d "[{\"artifactId\":\"$1\",\"repository\":\"$2\",\"artifact\":\"$3\",\"version\":\"$4\",\"promotionType\":\"ARTIFACT\"}]" \
-k "${APERTURE_BASE_URL}/v1/artifact-promotion/createPromotionEvent"
}
function generate_conductor_file() {
pushd $GENERATED_SITE_LOCATION
CONDUCTOR_FILE=conductor.yml
find -type f -iname 'index.html' | xargs dirname | sed -s "s/^\.//" | while read -r line ; do
if [ ! -z "${line}" ]; then
echo " - from: ${line}" >> ${CONDUCTOR_FILE}
echo " to: ${line}/" >> ${CONDUCTOR_FILE}
fi
done
popd
}