Skip to content

Commit ef9f767

Browse files
dtseilerJeff McCormick
authored andcommitted
Changes to sed to support both GNU and BSD versions, also looking at OS before copying binaries to GOBIN (#516)
1 parent 8177160 commit ef9f767

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

examples/quickstart.sh

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,27 @@ fi
205205
echo ""
206206
echo "Installing pgo client..." | tee -a $LOG
207207

208-
mv pgo $GOBIN
209-
mv pgo-mac $GOBIN
210-
mv pgo.exe $GOBIN
211-
mv expenv.exe $GOBIN
212-
mv expenv-mac $GOBIN
213-
mv expenv $GOBIN
208+
unameOut="$(uname -s)"
209+
case "${unameOut}" in
210+
Linux*)
211+
cp -a pgo $GOBIN/pgo
212+
cp -a expenv $GOBIN/expenv
213+
;;
214+
Darwin*)
215+
cp -a pgo-mac $GOBIN/pgo
216+
cp -a expenv-mac $GOBIN/expenv
217+
;;
218+
CYGWIN*)
219+
cp -a pgo.exe $GOBIN/pgo
220+
cp -a expenv.exe $GOBIN/expenv
221+
;;
222+
MINGW*)
223+
cp -a pgo.exe $GOBIN/pgo
224+
cp -a expenv.exe $GOBIN/expenv
225+
;;
226+
*)
227+
machine="UNKNOWN:${unameOut}"
228+
esac
214229

215230
echo "The available storage classes on your system:"
216231
$CO_CMD get sc
@@ -220,13 +235,13 @@ read STORAGE_CLASS
220235

221236
echo ""
222237
echo "Setting up pgo storage configuration for the selected storageclass..." | tee -a $LOG
223-
sed --in-place=.bak 's/Storage: nfsstorage/'"Storage: storageos"'/' $COROOT/conf/postgres-operator/pgo.yaml
224-
sed --in-place=.bak 's/fast/'"$STORAGE_CLASS"'/' $COROOT/conf/postgres-operator/pgo.yaml
225-
sed --in-place=.bak 's/COImagePrefix: crunchydata/'"COImagePrefix: $CO_IMAGE_PREFIX"'/' $COROOT/conf/postgres-operator/pgo.yaml
226-
sed --in-place=.bak 's/CCPImagePrefix: crunchydata/'"CCPImagePrefix: $CCP_IMAGE_PREFIX"'/' $COROOT/conf/postgres-operator/pgo.yaml
227-
sed --in-place=.bak 's/centos7/'"$CO_BASEOS"'/' $COROOT/conf/postgres-operator/pgo.yaml
228-
sed --in-place=.bak 's/demo/'"$CO_NAMESPACE"'/' $COROOT/deploy/cluster-rbac.yaml
229-
sed --in-place=.bak 's/demo/'"$CO_NAMESPACE"'/' $COROOT/deploy/rbac.yaml
238+
sed -i'.bak' -e 's/Storage: nfsstorage/'"Storage: storageos"'/' $COROOT/conf/postgres-operator/pgo.yaml
239+
sed -i'.bak' -e 's/fast/'"$STORAGE_CLASS"'/' $COROOT/conf/postgres-operator/pgo.yaml
240+
sed -i'.bak' -e 's/COImagePrefix: crunchydata/'"COImagePrefix: $CO_IMAGE_PREFIX"'/' $COROOT/conf/postgres-operator/pgo.yaml
241+
sed -i'.bak' -e 's/CCPImagePrefix: crunchydata/'"CCPImagePrefix: $CCP_IMAGE_PREFIX"'/' $COROOT/conf/postgres-operator/pgo.yaml
242+
sed -i'.bak' -e 's/centos7/'"$CO_BASEOS"'/' $COROOT/conf/postgres-operator/pgo.yaml
243+
sed -i'.bak' -e 's/demo/'"$CO_NAMESPACE"'/' $COROOT/deploy/cluster-rbac.yaml
244+
sed -i'.bak' -e 's/demo/'"$CO_NAMESPACE"'/' $COROOT/deploy/rbac.yaml
230245

231246
echo ""
232247
echo "Setting up pgo client authentication..." | tee -a $LOG

0 commit comments

Comments
 (0)