Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
adds scripts to launch and stop the UI (proxy)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhausenblas committed Jun 21, 2019
1 parent d20d13b commit 4491ed4
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
53 changes: 53 additions & 0 deletions launch-ui.sh
@@ -0,0 +1,53 @@
#!/usr/bin/env bash

set -o errexit
set -o errtrace
set -o nounset
set -o pipefail

###############################################################################
### DEPENDENCIES CHECKS

EKSPHEMERAL_URL=$(aws cloudformation describe-stacks --stack-name eksp | jq '.Stacks[].Outputs[] | select(.OutputKey=="EKSphemeralAPIEndpoint").OutputValue' -r)

CONTROLPLANE_STATUS=$(curl -sL -w "%{http_code}" -o /dev/null "$EKSPHEMERAL_URL/status/*")

if [ ! $CONTROLPLANE_STATUS == "200" ]
then
echo "I don't know which EKSphemeral control plane to use, please set the EKSPHEMERAL_URL environment variable"
exit 1
else
export EKSPHEMERAL_URL=$EKSPHEMERAL_URL
fi

if [[ $(docker info >/dev/null 2>&1) -ne 0 ]]
then
echo "Pre-flight check failed: Docker is not running" >&2
exit 1
fi

###############################################################################
### MAIN


cd ui/

# if the container image is not yet available locally, build it:
if [[ $(make verify > /dev/null 2>&1) -ne 0 ]]
then
make build
fi

# make sure to stop the already running one and otherwise launch the UI proxy:

if [[ $(docker ps | grep ekspui >/dev/null 2>&1) -eq 0 ]]
then
make stop > /dev/null
fi

make run > /dev/null

# show user the logs:
docker logs --follow ekspui

cd -
17 changes: 17 additions & 0 deletions stop-ui.sh
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -o errexit
set -o errtrace
set -o nounset
set -o pipefail


###############################################################################
### MAIN


cd ui/

make stop

cd -

0 comments on commit 4491ed4

Please sign in to comment.