diff --git a/stack_orchestrator/data/compose/docker-compose-uniswap-interface.yml b/stack_orchestrator/data/compose/docker-compose-uniswap-interface.yml index 77c22c7f..5025a85d 100644 --- a/stack_orchestrator/data/compose/docker-compose-uniswap-interface.yml +++ b/stack_orchestrator/data/compose/docker-compose-uniswap-interface.yml @@ -30,9 +30,9 @@ services: command: ["./deploy-to-urbit.sh"] volumes: - uniswap_build:/app/build - - pier_data: /app/pier + - urbit_data:/urbit - ../config/uniswap-frontend/deploy-to-urbit.sh:/app/deploy-to-urbit.sh volumes: uniswap_build: - pier_data: + urbit_data: diff --git a/stack_orchestrator/data/compose/docker-compose-urbit.yml b/stack_orchestrator/data/compose/docker-compose-urbit.yml index aee61a9e..71244da2 100644 --- a/stack_orchestrator/data/compose/docker-compose-urbit.yml +++ b/stack_orchestrator/data/compose/docker-compose-urbit.yml @@ -4,9 +4,10 @@ services: urbit-fake-ship: restart: unless-stopped image: tloncorp/vere - entrypoint: ["bash", "-c", "urbit -t -F zod"] + entrypoint: ["bash", "-c", "./run-urbit-ship.sh"] volumes: - - pier_data:/urbit/zod/ + - urbit_data:/urbit + - ../config/uniswap-frontend/run-urbit-ship.sh:/urbit/run-urbit-ship.sh ports: - "8080:80" - "12321:12321" @@ -18,4 +19,4 @@ services: start_period: 10s volumes: - pier_data: + urbit_data: diff --git a/stack_orchestrator/data/config/uniswap-frontend/deploy-to-urbit.sh b/stack_orchestrator/data/config/uniswap-frontend/deploy-to-urbit.sh old mode 100644 new mode 100755 diff --git a/stack_orchestrator/data/config/uniswap-frontend/run-urbit-ship.sh b/stack_orchestrator/data/config/uniswap-frontend/run-urbit-ship.sh new file mode 100755 index 00000000..bb3445dd --- /dev/null +++ b/stack_orchestrator/data/config/uniswap-frontend/run-urbit-ship.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi + +pier_dir="/urbit/zod" + +# Check if the directory exists +if [ -d "$pier_dir" ]; then + echo "Pier directory already exists, rebooting..." + urbit -t zod +else + echo "Creating a new fake ship..." + urbit -t -F zod +fi diff --git a/stack_orchestrator/data/container-build/cerc-uniswap-urbit-deployment/build.sh b/stack_orchestrator/data/container-build/cerc-uniswap-urbit-deployment/build.sh index 65192d95..c8921f19 100755 --- a/stack_orchestrator/data/container-build/cerc-uniswap-urbit-deployment/build.sh +++ b/stack_orchestrator/data/container-build/cerc-uniswap-urbit-deployment/build.sh @@ -6,4 +6,4 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh # See: https://stackoverflow.com/a/246128/1701505 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -docker build -t cerc/uniswap-urbit-deployment:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} +docker build -t cerc/uniswap-urbit-deployment:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${SCRIPT_DIR}