Skip to content

Commit

Permalink
install script args
Browse files Browse the repository at this point in the history
  • Loading branch information
ettec committed Oct 15, 2020
1 parent 8a9dbfa commit 764a675
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
4 changes: 2 additions & 2 deletions install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Checkout the otp source code from https://github.com/ettec/open-trading-platform

Run the installation script, from the root of the checkout as follows:

`./install/install.sh 1.0.10 true `
`./install/install.sh -v 1.0.11 `

That's it. After the install script completes it will inform you of the port to use to run the OTP client. You can login using any of the [user ids](#userids) at the bottom of this README, no password is required out of the box (the authentication-service has a hook for a token/password validation plugin).

Expand All @@ -30,7 +30,7 @@ Checkout the otp source code from https://github.com/ettec/open-trading-platform

Run the installation script, from the root of the checkout:

`./install/install.sh 1.0.10 `
`./install/install.sh -v 1.0.11 -m `

That's it. After the install script completes it will inform you of the port to use to run the OTP client. You can login using any of the following user ids, no password is required out of the box (the authentication-service has a hook for a token/password validation plugin).

Expand Down
34 changes: 27 additions & 7 deletions install/install.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
# Usage: install.sh <TAG> <use own cluster> e.g. install.sh 1.0.8 leave it blank to install latest ci build
VERSION=$1


usage() { echo "Usage: $0 [-v <version number>] [-m]" 1>&2; exit 1; }

while getopts ":v:m" o; do
case "${o}" in
v)
VERSION=${OPTARG}
;;
m)
USEMICROK8S="true"
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))

if [ -z "${VERSION}" ]; then
usage
fi


DOCKERREPO="ettec/opentp:"
TAG=-$VERSION
if [ -z "$VERSION" ]; then
echo "installing latest Open Trading Platform ci build";
DOCKERREPO="ettec/opentp-ci-build:"
TAG=""
else

echo "installing Open Trading Platform version $VERSION";
fi

# If installing on a non microk8s cluster comment out the three lines below
USINGOWNCLUSTER=$2
if [ "$USINGOWNCLUSTER" = "true" ]; then
echo installing into kubernetes cluster using kubectl current context
else
if [ "$USEMICROK8S" = "true" ]; then
echo installing into MicroK8s cluster
shopt -s expand_aliases
alias kubectl=microk8s.kubectl
alias helm=microk8s.helm3
else
echo installing into kubernetes cluster using kubectl current context
fi


Expand Down

0 comments on commit 764a675

Please sign in to comment.