Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions code-samples/eventing/bookstore-sample-app/start/setup.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# Prompt the user to start the installation process
echo "🚀 Shortcut: This script will install Knative, and deploy the bookstore's frontend and backend on your cluster"

# Validate that the user is in the correct directory /start
if [ "${PWD##*/}" != "start" ]; then
echo "⚠️ Please run this script in the /start directory. Exiting..."
exit
fi
echo "✅ You are in the correct directory: /start"
read -p "🛑 Press ENTER to continue or Ctrl+C to abort..."

# Install Knative Serving
Expand Down Expand Up @@ -40,7 +36,7 @@ echo "✅ Knative In-Memory Channel and Broker installed successfully."
if ! command -v func &> /dev/null
then
echo ""
echo "⚠️ Knative CLI 'func' not found. Please install the Knative CLI by following the instructions at https://knative.dev/docs/admin/install/kn-cli/."
echo "⚠️ Knative CLI 'func' not found. Please install the Knative CLI by following the instructions at https://knative.dev/docs/functions/install-func"
exit
fi

Expand All @@ -57,8 +53,7 @@ echo "📚 Installing the Sample Bookstore Frontend"
read -p "🛑 Press ENTER to continue..."

# Install the front end first
cd frontend
kubectl apply -f config
kubectl apply -f "${SCRIPT_DIR}/frontend/config"

# Wait for the frontend to be ready
echo ""
Expand All @@ -76,8 +71,7 @@ echo ""
echo "📚 Installing the Sample Bookstore Backend (node-server)"

# Install the node-server
cd ../node-server
kubectl apply -f config/100-deployment.yaml
kubectl apply -f "${SCRIPT_DIR}/node-server/config/100-deployment.yaml"

# Wait for the backend to be ready
echo ""
Expand Down
Loading