-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun
More file actions
executable file
·58 lines (49 loc) · 1.67 KB
/
Copy pathrun
File metadata and controls
executable file
·58 lines (49 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Define colors
ORANGE='\e[0;33m'
BLUE='\e[0;34m'
RED='\e[0;31m'
GREEN='\e[0;32m'
NC='\e[0m'
# Check if .env file exists
if [ ! -f .env ]; then
if [ -f .env.example ]; then
echo -e "${RED}Error${NC}: .env file not found."
echo -ne "${ORANGE}Do you want to use .env.example and rename it to .env? (yes/no): ${NC}"
read -r rename_confirm
if [[ "$rename_confirm" =~ ^(yes|y)$ ]]; then
mv .env.example .env
echo -e "${GREEN}.env.example has been renamed to .env.${NC}"
else
echo "Exiting."
exit 1
fi
else
echo -e "${RED}Error${NC}: .env and .env.example files not found. Exiting."
exit 1
fi
fi
# Load environment variables from .env file
# shellcheck disable=SC1091
source .env
# Initialize the command
command="docker compose"
# Add profiles based on SEQUENCER_MODE and Celestia support
[ "$SEQUENCER_MODE" = "true" ] && command+=" --profile sequencer"
[ "$CELESTIA_MODE" = "true" ] && command+=" --profile celestia"
if [ "$SKIP_DEPLOYMENT_CHECK" = "true" ]; then
echo -e "${ORANGE}NOTE${NC}: Only genesis.json and rollup.json will be checked (SKIP_DEPLOYMENT_CHECK=$SKIP_DEPLOYMENT_CHECK)."
fi
if [ "$SKIP_HEALTHCHECK" = "true" ]; then
echo -e "${ORANGE}WARNING${NC}: Celestia da light node sync check will be skipped (SKIP_HEALTHCHECK=$SKIP_HEALTHCHECK)."
fi
# Add the rest of the command
command+=" up --build -d"
# Confirm before running the command
echo -ne "About to run: ${BLUE}$command${NC} (SEQUENCER_MODE: $SEQUENCER_MODE, CELESTIA_MODE: $CELESTIA_MODE). Do you want to continue? (yes/no): "
read -r confirm
if [[ "$confirm" =~ ^(yes|y)$ ]]; then
eval "$command"
else
echo "Command execution cancelled."
fi