scripts: Allow configuring a custom CA bundle for build process.

For building Zulip in an environment where a custom CA certificate is
required to access the public Internet, one needs to be able to
specify that CA certificate for all network access done by the Zulip
installer/build process.  This change allows configuring that via the
environment.
This commit is contained in:
xificurC
2018-08-02 16:29:47 +02:00
committed by Tim Abbott
parent 4dbf59dbaa
commit 9e053c74cf
5 changed files with 23 additions and 3 deletions

View File

@@ -28,7 +28,11 @@ fi
if [ "$current_node_version" != "v$node_version" ] || ! [ -L "$node_wrapper_path" ]; then
export NVM_DIR=/usr/local/nvm
if ! [ -e "$NVM_DIR/nvm.sh" ]; then
wget -nv -O- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
wget_opts=(-nv)
if [ -n "${CUSTOM_CA_CERTIFICATES:-}" ]; then
wget_opts+=(--ca-certificate "${CUSTOM_CA_CERTIFICATES}")
fi
wget "${wget_opts[@]}" -O- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
fi
# shellcheck source=/dev/null