Skip to content

Commit 4d62534

Browse files
committed
install script
1 parent 75f9372 commit 4d62534

File tree

3 files changed

+101
-3
lines changed

3 files changed

+101
-3
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/opentelemetry-demo)](https://artifacthub.io/packages/helm/opentelemetry-helm/opentelemetry-demo)
1111
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9247/badge)](https://www.bestpractices.dev/en/projects/9247)
1212

13+
## Usage (of this version of the demo only!)
14+
15+
### Docker
16+
17+
```bash
18+
curl -fsSL https://raw.githubusercontent.com/BetterStackHQ/opentelemetry-demo/main/install.sh | bash
19+
```
20+
1321
## Welcome to the OpenTelemetry Astronomy Shop Demo
1422

1523
This repository contains the OpenTelemetry Astronomy Shop, a microservice-based

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ services:
287287
- IMAGE_PROVIDER_PORT
288288
- ENVOY_PORT
289289
- FLAGD_HOST
290-
- FLAGD_PORT
291-
- FLAGD_UI_HOST
292-
- FLAGD_UI_PORT
290+
- FLAGD_PORT
291+
- FLAGD_UI_HOST
292+
- FLAGD_UI_PORT
293293
dns_search: ""
294294

295295
# image-provider

install.sh

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Colors for output
5+
RED='\033[0;31m'
6+
GREEN='\033[0;32m'
7+
YELLOW='\033[1;33m'
8+
NC='\033[0m' # No Color
9+
10+
# Configuration
11+
GITHUB_REPO="BetterStackHQ/opentelemetry-demo"
12+
BRANCH="main"
13+
PROJECT_NAME="opentelemetry-demo-deinstrumented"
14+
COMPOSE_FILE_URL="https://raw.githubusercontent.com/${GITHUB_REPO}/${BRANCH}/docker-compose.yml"
15+
ENV_FILE_URL="https://raw.githubusercontent.com/${GITHUB_REPO}/${BRANCH}/.env"
16+
WORK_DIR="/tmp/${PROJECT_NAME}"
17+
18+
echo -e "${GREEN}OpenTelemetry Demo Installer${NC}"
19+
echo "==============================="
20+
echo ""
21+
22+
# Check for Docker
23+
if ! command -v docker &> /dev/null; then
24+
echo -e "${RED}Error: Docker is not installed${NC}"
25+
echo "Please install Docker first: https://docs.docker.com/get-docker/"
26+
exit 1
27+
fi
28+
29+
# Determine Docker Compose command
30+
DOCKER_COMPOSE=""
31+
if docker compose version &> /dev/null; then
32+
DOCKER_COMPOSE="docker compose"
33+
echo -e "${GREEN}${NC} Found Docker Compose (plugin)"
34+
elif command -v docker-compose &> /dev/null; then
35+
DOCKER_COMPOSE="docker-compose"
36+
echo -e "${GREEN}${NC} Found docker-compose (standalone)"
37+
else
38+
echo -e "${RED}Error: Docker Compose is not installed${NC}"
39+
echo "Please install Docker Compose: https://docs.docker.com/compose/install/"
40+
exit 1
41+
fi
42+
43+
# Create working directory
44+
echo -e "${YELLOW}${NC} Creating working directory: ${WORK_DIR}"
45+
mkdir -p "${WORK_DIR}"
46+
cd "${WORK_DIR}"
47+
48+
# Download docker-compose.yml
49+
echo -e "${YELLOW}${NC} Downloading docker-compose.yml..."
50+
if ! curl -fsSL "${COMPOSE_FILE_URL}" -o docker-compose.yml; then
51+
echo -e "${RED}Error: Failed to download docker-compose.yml${NC}"
52+
exit 1
53+
fi
54+
echo -e "${GREEN}${NC} Downloaded docker-compose.yml"
55+
56+
# Download .env file
57+
echo -e "${YELLOW}${NC} Downloading .env file..."
58+
if ! curl -fsSL "${ENV_FILE_URL}" -o .env; then
59+
echo -e "${RED}Error: Failed to download .env file${NC}"
60+
exit 1
61+
fi
62+
echo -e "${GREEN}${NC} Downloaded .env file"
63+
64+
# Pull images
65+
echo ""
66+
echo -e "${YELLOW}${NC} Pulling Docker images (this may take a few minutes)..."
67+
${DOCKER_COMPOSE} -p "${PROJECT_NAME}" pull
68+
69+
# Start containers
70+
echo ""
71+
echo -e "${YELLOW}${NC} Starting containers..."
72+
${DOCKER_COMPOSE} -p "${PROJECT_NAME}" up -d
73+
74+
# Check if containers are running
75+
echo ""
76+
echo -e "${GREEN}${NC} OpenTelemetry Demo is starting!"
77+
echo ""
78+
echo "Services are being launched. You can check the status with:"
79+
echo " ${DOCKER_COMPOSE} -p ${PROJECT_NAME} ps"
80+
echo ""
81+
echo "To view logs:"
82+
echo " ${DOCKER_COMPOSE} -p ${PROJECT_NAME} logs -f"
83+
echo ""
84+
echo "To stop the demo:"
85+
echo " ${DOCKER_COMPOSE} -p ${PROJECT_NAME} down"
86+
echo ""
87+
echo "The demo will be available at:"
88+
echo " → Frontend: http://localhost:8080"
89+
echo " → Load Generator UI: http://localhost:8089"
90+
echo " → Feature Flags UI: http://localhost:4000"

0 commit comments

Comments
 (0)