Skip to content

Commit

Permalink
🏗️build: update
Browse files Browse the repository at this point in the history
  • Loading branch information
blinko-space committed Nov 7, 2024
1 parent c45e2ea commit b6b18ea
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ fi
echo -e "${YELLOW}1. 🗑 Removing existing blinkospace/blinko Docker image...${NC}"
docker rmi "$image_name" -f

# Check if the container has a volume mounted
volume_path=$(docker inspect -f '{{ range .Mounts }}{{ if eq .Destination "/app/.blinko" }}{{ .Source }}{{ end }}{{ end }}' "$container_name")
if [ -z "$volume_path" ]; then
echo -e "${YELLOW}No existing volume found for container $container_name.${NC}"
else
echo -e "${YELLOW}Using existing volume: $volume_path${NC}"
docker_volume="-v $volume_path:/app/.blinko"
fi

if [ $? -ne 0 ]; then
echo -e "${RED}Failed to remove Docker image. It may not exist or there may be an issue with Docker.${NC}"
else
Expand All @@ -52,14 +61,6 @@ if [ "$(docker ps -q -f name=$container_name)" ]; then
docker rm "$container_name"
fi

# Check if the container has a volume mounted
volume_path=$(docker inspect -f '{{ range .Mounts }}{{ if eq .Destination "/app/.blinko" }}{{ .Source }}{{ end }}{{ end }}' "$container_name")
if [ -z "$volume_path" ]; then
echo -e "${YELLOW}No existing volume found for container $container_name.${NC}"
else
echo -e "${YELLOW}Using existing volume: $volume_path${NC}"
docker_volume="-v $volume_path:/app/.blinko"
fi

# Run the new container with the existing volume if found
docker run -d \
Expand Down

0 comments on commit b6b18ea

Please sign in to comment.