This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
download boutique demo app frontend project and install Telepresence …
…script and instructions
- Loading branch information
Showing
4 changed files
with
125 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
VERBOSE=false | ||
|
||
# Spinning cursor animation | ||
spinner() { | ||
local pid=$1 | ||
local delay=0.1 | ||
local spinstr='|/-\' | ||
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do | ||
local temp=${spinstr#?} | ||
printf " [%c] " "$spinstr" | ||
local spinstr=$temp${spinstr%"$temp"} | ||
sleep $delay | ||
printf "\b\b\b\b\b\b" | ||
done | ||
printf " \b\b\b\b" | ||
} | ||
|
||
log() { | ||
echo "$1" | ||
} | ||
|
||
log_verbose() { | ||
if $VERBOSE; then | ||
echo "$1" | ||
fi | ||
} | ||
|
||
log_error() { | ||
echo "❌ Error: $1" >&2 | ||
echo "Please email us at [email protected] for assistance." >&2 | ||
exit 1 | ||
} | ||
|
||
run_command_with_spinner() { | ||
if $VERBOSE; then | ||
"$@" | ||
else | ||
"$@" >/dev/null 2>&1 & | ||
local pid=$! | ||
spinner $pid | ||
wait $pid | ||
return $? | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,55 +2,14 @@ | |
|
||
set -euo pipefail | ||
|
||
VERBOSE=false | ||
|
||
TENANT_UUID="" | ||
KARDINAL_CLI_PATH="" | ||
KARDINAL_DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/kardinal" | ||
UUID_FILE="$KARDINAL_DATA_DIR/fk-tenant-uuid" | ||
|
||
|
||
# Spinning cursor animation | ||
spinner() { | ||
local pid=$1 | ||
local delay=0.1 | ||
local spinstr='|/-\' | ||
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do | ||
local temp=${spinstr#?} | ||
printf " [%c] " "$spinstr" | ||
local spinstr=$temp${spinstr%"$temp"} | ||
sleep $delay | ||
printf "\b\b\b\b\b\b" | ||
done | ||
printf " \b\b\b\b" | ||
} | ||
|
||
log() { | ||
echo "$1" | ||
} | ||
|
||
log_verbose() { | ||
if $VERBOSE; then | ||
echo "$1" | ||
fi | ||
} | ||
|
||
log_error() { | ||
echo "❌ Error: $1" >&2 | ||
echo "Please email us at [email protected] for assistance." >&2 | ||
exit 1 | ||
} | ||
|
||
run_command_with_spinner() { | ||
if $VERBOSE; then | ||
"$@" | ||
else | ||
"$@" >/dev/null 2>&1 & | ||
local pid=$! | ||
spinner $pid | ||
wait $pid | ||
return $? | ||
fi | ||
} | ||
# Source the common script | ||
source ./common.sh | ||
|
||
setup_docker() { | ||
log "🐳 Setting up Docker..." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
BOUTIQUE_DEMO_APP_REPO="https://github.com/kurtosis-tech/new-obd.git" | ||
|
||
set -euo pipefail | ||
|
||
# Source the common script | ||
source ./common.sh | ||
|
||
download_boutique_remo() { | ||
log "⏬ Downloading the frontend project from the boutique demo app repository..." | ||
run_command_with_spinner git clone --no-checkout $BOUTIQUE_DEMO_APP_REPO || log_error "Failed to download the frontend project" | ||
cd ./new-obd | ||
git sparse-checkout init --cone | ||
git sparse-checkout set src/frontend | ||
git checkout main | ||
log_verbose "Frontend project successfully downloaded." | ||
} | ||
|
||
install_telepresence() { | ||
log "⏬ Installing Telepresence CLI..." | ||
run_command_with_spinner curl -fL https://app.getambassador.io/download/tel2/linux/amd64/latest/telepresence -o /usr/local/bin/telepresence | ||
|
||
chmod a+x /usr/local/bin/telepresence | ||
log_verbose "Telepresence CLI successfully installed." | ||
|
||
log "⏬ Installing Telepresence traffic manager in the cluster..." | ||
run_command_with_spinner telepresence helm install --set trafficManager.serviceMesh.type=istio | ||
log_verbose "Telepresence traffic manager successfully installed." | ||
} | ||
|
||
|
||
main() { | ||
# Check if an argument is provided | ||
if [ $# -gt 0 ] && [ "$1" = "--verbose" ]; then | ||
VERBOSE=true | ||
log "Verbose mode enabled." | ||
fi | ||
|
||
# log "🕰️ This can take around 3 minutes! Familiarize yourself with the repository while this happens." | ||
|
||
download_boutique_remo | ||
|
||
# log "✅ Startup completed! Minikube, Istio, Kontrol, and Kardinal Manager are ready." | ||
# log "🏠 Tenant UUID: $TENANT_UUID" | ||
# log "📊 Kardinal Dashboard: https://app.kardinal.dev/$(cat ~/.local/share/kardinal/fk-tenant-uuid)/traffic-configuration" | ||
# exec bash | ||
} | ||
|
||
main "$@" |