Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
new script to run frontend connected to the other services in the clu…
Browse files Browse the repository at this point in the history
…ster
  • Loading branch information
leoporoli committed Sep 6, 2024
1 parent 59ab921 commit 35ff864
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
27 changes: 27 additions & 0 deletions scripts/run-frontend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -euo pipefail

# Source the common script
source ./scripts/common.sh

run_frontend() {
export CARTSERVICEHOST="cartservice"
export PRODUCTCATALOGSERVICEHOST="productcatalogservice"
cd ./src/frontend
go build -o frontend
./frontend
}

main() {
# Check if an argument is provided
if [ $# -gt 0 ] && [ "$1" = "--verbose" ]; then
VERBOSE=true
log "Verbose mode enabled."
fi

run_frontend

}

main "$@"
28 changes: 2 additions & 26 deletions scripts/telepresence-flow-bootstrap.sh → scripts/telepresence.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#!/bin/bash

BOUTIQUE_DEMO_APP_REPO="https://github.com/kurtosis-tech/new-obd.git"
BOUTIQUE_DEMO_APP_DIRNAME="new-obd"

set -euo pipefail

# Source the common script
source ./scripts/common.sh

download_boutique_repo() {
log "⏬ Downloading the frontend project from the boutique demo app repository..."
if [ -d "$BOUTIQUE_DEMO_APP_DIRNAME" ]; then
log "The folder '$BOUTIQUE_DEMO_APP_DIRNAME' already exists, so it means the project has bean already downloaded"
else
run_command_with_spinner git clone --no-checkout $BOUTIQUE_DEMO_APP_REPO || log_error "Failed to download the frontend project"
cd $BOUTIQUE_DEMO_APP_DIRNAME
git sparse-checkout init --cone
git sparse-checkout set src/frontend
git checkout main
log_verbose "Frontend project successfully downloaded."
fi
}

telepresence_install() {
log "🗂️ Checking if Telepresence is already installed..."
if check_binary_file_exists "/usr/local/bin/telepresence"; then
Expand Down Expand Up @@ -57,16 +39,10 @@ main() {
log "Verbose mode enabled."
fi

# log "🕰️ This can take around 3 minutes! Familiarize yourself with the repository while this happens."

download_boutique_repo
telepresence_install
telepresence_connect

# 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
log "✅ Telepresence installation and connection completed!"
}

main "$@"
main "$@"

0 comments on commit 35ff864

Please sign in to comment.