Skip to content

Commit 72d9da6

Browse files
Merge pull request CrunchyData#280 from jkatz/quickstart-curl
Add support for curl in the quickstart scripts.
2 parents c0017d8 + 66c4d50 commit 72d9da6

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

examples/quickstart-for-gke.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@
1616
LOG="pgo-installer.log"
1717

1818
export PGORELEASE=3.1
19+
PGO_RELEASE_REMOTE_URL="https://github.com/CrunchyData/postgres-operator/releases/download/$PGORELEASE/postgres-operator.$PGORELEASE.tar.gz"
20+
PGO_RELEASE_LOCAL_PATH="/tmp/postgres-operator.$PGORELEASE.tar.gz"
1921

2022
echo "Testing for dependencies..." | tee -a $LOG
2123

2224
which wget > /dev/null 2> /dev/null
2325
if [[ $? -ne 0 ]]; then
24-
echo "The required dependency wget is missing on your system." | tee -a $LOG
25-
exit 1
26+
which curl > /dev/null 2> /dev/null
27+
if [[ $? -ne 0 ]]; then
28+
echo "The required dependency wget and/or curl is missing on your system." | tee -a $LOG
29+
exit 1
30+
else
31+
PGO_HTTP_CMD="curl -L -s -o ${PGO_RELEASE_LOCAL_PATH} ${PGO_RELEASE_REMOTE_URL}"
32+
fi
33+
else
34+
PGO_HTTP_CMD="wget --quiet ${PGO_RELEASE_REMOTE_URL} -O ${PGO_RELEASE_LOCAL_PATH}"
2635
fi
2736
which kubectl > /dev/null 2> /dev/null
2837
if [[ $? -ne 0 ]]; then
@@ -83,11 +92,7 @@ mkdir -p $GOPATH/src/github.com/crunchydata/postgres-operator
8392

8493
echo ""
8594
echo "Installing pgo server configuration..." | tee -a $LOG
86-
wget --quiet https://github.com/CrunchyData/postgres-operator/releases/download/$PGORELEASE/postgres-operator.$PGORELEASE.tar.gz -O /tmp/postgres-operator.$PGORELEASE.tar.gz
87-
if [[ $? -ne 0 ]]; then
88-
echo "ERROR: Problem getting the pgo server configuration."
89-
exit 1
90-
fi
95+
`${PGO_HTTP_CMD}`
9196

9297
cd $COROOT
9398
tar xzf /tmp/postgres-operator.$PGORELEASE.tar.gz

examples/quickstart-for-ocp.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,22 @@
1616
LOG="pgo-installer.log"
1717

1818
export PGORELEASE=3.1
19+
PGO_RELEASE_REMOTE_URL="https://github.com/CrunchyData/postgres-operator/releases/download/$PGORELEASE/postgres-operator.$PGORELEASE.tar.gz"
20+
PGO_RELEASE_LOCAL_PATH="/tmp/postgres-operator.$PGORELEASE.tar.gz"
1921

2022
echo "Testing for dependencies..." | tee -a $LOG
2123

2224
which wget > /dev/null 2> /dev/null
2325
if [[ $? -ne 0 ]]; then
24-
echo "The required dependency wget is missing on your system." | tee -a $LOG
25-
exit 1
26-
fi
27-
which oc > /dev/null 2> /dev/null
28-
if [[ $? -ne 0 ]]; then
29-
echo "The required dependency oc is missing on your system." | tee -a $LOG
30-
exit 1
26+
which curl > /dev/null 2> /dev/null
27+
if [[ $? -ne 0 ]]; then
28+
echo "The required dependency wget and/or curl is missing on your system." | tee -a $LOG
29+
exit 1
30+
else
31+
PGO_HTTP_CMD="curl -L -s -o ${PGO_RELEASE_LOCAL_PATH} ${PGO_RELEASE_REMOTE_URL}"
32+
fi
33+
else
34+
PGO_HTTP_CMD="wget --quiet ${PGO_RELEASE_REMOTE_URL} -O ${PGO_RELEASE_LOCAL_PATH}"
3135
fi
3236

3337
echo ""
@@ -87,7 +91,7 @@ mkdir -p $GOPATH/src/github.com/crunchydata/postgres-operator
8791

8892
echo ""
8993
echo "Installing pgo server configuration..." | tee -a $LOG
90-
wget --quiet https://github.com/CrunchyData/postgres-operator/releases/download/$PGORELEASE/postgres-operator.$PGORELEASE.tar.gz -O /tmp/postgres-operator.$PGORELEASE.tar.gz
94+
`${PGO_HTTP_CMD}`
9195
#if [[ $? -ne 0 ]]; then
9296
# echo "problem getting pgo server config"
9397
# exit 1

0 commit comments

Comments
 (0)