Skip to content

Commit db0051a

Browse files
BOOTSTRATP_DOCKER_VERSION=2
* BOOTSTRAP_DOCKER_VERSION=2 * --compose fix
1 parent 6e5f92a commit db0051a

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

strato

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
set -e
33

4+
BOOTSTRAP_DOCKER_VERSION=2
5+
46
Green='\033[0;32m'
57
Red='\033[0;31m'
68
Yellow='\033[0;33m'
@@ -40,13 +42,22 @@ function checkComposeFile {
4042
fi
4143

4244
if ! grep -q '^[[:space:]]*strato:' docker-compose.yml; then
43-
echo -e "${Red}Wrong docker-compose.yml provided - no 'strato' service found in it. Use the docker-compose.allDocker.yml as the docker-compose.yml${NC}"
45+
echo -e "${Red}Wrong docker-compose.yml provided - no 'strato' service found in it.${NC}"
4446
exit 4
4547
fi
48+
49+
# Check bootstrap-docker version compatibility
50+
min_version=$(grep -oP '#bootstrap-docker-min-version:\K.*' docker-compose.yml 2>/dev/null || true)
51+
if [ -n "$min_version" ]; then
52+
if [ "$(printf '%s\n' "$min_version" "$BOOTSTRAP_DOCKER_VERSION" | sort -V | head -1)" != "$min_version" ]; then
53+
echo -e "${Red}This docker-compose.yml requires bootstrap-docker version >= ${min_version}, but this is version ${BOOTSTRAP_DOCKER_VERSION}. Please update the strato bootstrap scripts.${NC}"
54+
exit 3
55+
fi
56+
fi
4657
}
4758

4859
function help {
49-
echo -e "${Yellow}STRATO run script${NC}
60+
echo -e "${Yellow}STRATO run script${NC}
5061
Kickstart a STRATO node.
5162
5263
${Yellow}Optional flags:${NC}
@@ -67,6 +78,7 @@ The flags are mutually exclusive:
6778
function wipe {
6879
echo -e "${Yellow}Removing STRATO containers and wiping out volumes${NC}"
6980
${docker_compose} down -v -t 0 --remove-orphans
81+
sudo rm -rf nodedata/
7082
}
7183

7284
function down {
@@ -76,7 +88,7 @@ function down {
7688

7789
function getCompose {
7890
echo -e "${Yellow}Fetching the docker-compose.yml of the latest STRATO release...${NC}"
79-
curl -L https://github.com/blockapps/strato-getting-started/releases/latest/download/docker-compose.yml -o docker-compose.yml
91+
curl -fLo docker-compose.yml https://github.com/strato-net/strato-platform/releases/download/$(curl -s -L https://github.com/strato-net/strato-platform/releases/latest | grep -om1 '"/strato-net/strato-platform/releases/tag/[^"]*' | grep -oE "[^/]+$")/docker-compose.yml
8092
echo -e "${Yellow}docker-compose.yml downloaded successfully.${NC}"
8193
}
8294

@@ -95,7 +107,7 @@ function getMetadata {
95107
;;
96108
000):
97109
echo -e "${Red}Metadata endpoint is unreachable through strato docker network${NC}"
98-
;;
110+
;;
99111
*):
100112
echo -e "${Red}Error: Unknown response from metadata endpoint${NC}"
101113
exit 24
@@ -191,6 +203,8 @@ while [ ${#} -gt 0 ]; do
191203
done
192204

193205
checkDocker
206+
207+
# Ensure docker-compose.yml exists (download from releases if missing)
194208
checkComposeFile
195209

196210
export NODE_HOST=${NODE_HOST:-localhost}

0 commit comments

Comments
 (0)