Skip to content

Commit

Permalink
fix: switching to docker compose v2 (#13590)
Browse files Browse the repository at this point in the history
  • Loading branch information
julien51 authored Apr 2, 2024
1 parent 0357d31 commit d5ed44a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fi
OPTS="$SERVICE $ENV_TARGET $COMMIT $PUBLISH"

# First we need to build
docker-compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE build $SERVICE
docker compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE build $SERVICE

# Run deploy code!
docker-compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE run $ENV_VARS $ALL_ENV_VARS -e UNLOCK_ENV=$ENV_TARGET $SERVICE $NPM_SCRIPT $OPTS
docker compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE run $ENV_VARS $ALL_ENV_VARS -e UNLOCK_ENV=$ENV_TARGET $SERVICE $NPM_SCRIPT $OPTS
2 changes: 1 addition & 1 deletion scripts/docker-compose-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# The script exposes the logs of all docker running instances when using compose
# This should be invoked upon failure to provide details about the failure

docker-compose -f docker/docker-compose.yml -f docker/docker-compose.ci.yml logs --timestamps --tail="all"
docker compose -f docker/docker-compose.yml -f docker/docker-compose.ci.yml logs --timestamps --tail="all"
4 changes: 2 additions & 2 deletions scripts/integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export UNLOCK_ENV=test
# run the actual tests
echo "Running integration tests \n"
COMMAND="yarn workspace tests ci --network docker"
docker-compose $COMPOSE_CONFIG build integration-tests
docker-compose $COMPOSE_CONFIG run -e UNLOCK_ENV=test -e CI=true $EXTRA_ARGS integration-tests bash -c "$COMMAND"
docker compose $COMPOSE_CONFIG build integration-tests
docker compose $COMPOSE_CONFIG run -e UNLOCK_ENV=test -e CI=true $EXTRA_ARGS integration-tests bash -c "$COMMAND"
14 changes: 7 additions & 7 deletions scripts/run-stack-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ COMPOSE_CONFIG="-f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE"
export UNLOCK_ENV=test

# clean things up
docker-compose $COMPOSE_CONFIG down
docker compose $COMPOSE_CONFIG down

# Take ETH node up
docker-compose $COMPOSE_CONFIG up -d postgres ipfs graph-node eth-node
docker compose $COMPOSE_CONFIG up -d postgres ipfs graph-node eth-node

# Deploy Unlock etc
docker-compose $COMPOSE_CONFIG exec -T eth-node yarn provision --network docker
docker compose $COMPOSE_CONFIG exec -T eth-node yarn provision --network docker

# Make the correct subgraph config
docker-compose $COMPOSE_CONFIG exec -T eth-node cat networks.json > $BASE_DOCKER_FOLDER/development/subgraph/networks.json
docker compose $COMPOSE_CONFIG exec -T eth-node cat networks.json > $BASE_DOCKER_FOLDER/development/subgraph/networks.json

# show subgraph networks config (for debug purposes)
docker-compose $COMPOSE_CONFIG exec -T eth-node cat networks.json
docker compose $COMPOSE_CONFIG exec -T eth-node cat networks.json

# deploy the subgraph
docker-compose $COMPOSE_CONFIG up --build subgraph
docker compose $COMPOSE_CONFIG up --build subgraph

# Launch
# docker-compose $COMPOSE_CONFIG up --build locksmith websub unlock-app
# docker compose $COMPOSE_CONFIG up --build locksmith websub unlock-app
4 changes: 2 additions & 2 deletions scripts/run-stack-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ COMPOSE_CONFIG="-f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE"
export UNLOCK_ENV=test

# clean things up
docker-compose $COMPOSE_CONFIG down
docker compose $COMPOSE_CONFIG down

# Take db, IPFS, graph and postgres nodes up
docker-compose $COMPOSE_CONFIG up -d postgres ipfs graph-node eth-node
docker compose $COMPOSE_CONFIG up -d postgres ipfs graph-node eth-node

# deploy contracts
cd $REPO_ROOT/docker/development/eth-node
Expand Down
4 changes: 2 additions & 2 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV_VARS_PREFIX="${UPCASE_SERVICE//-/_}_"
ENV_VARS=$(env | grep "^$ENV_VARS_PREFIX" | awk '{print "-e ",$1}' ORS=' ' | sed -e "s/$ENV_VARS_PREFIX//g")

# First we need to build the base
docker-compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE build $UNLOCK_SERVICE_NAME
docker compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE build $UNLOCK_SERVICE_NAME

# Run tests
docker-compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE run -e CI=true $ENV_VARS $UNLOCK_SERVICE_NAME $COMMAND
docker compose -f $BASE_DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE run -e CI=true $ENV_VARS $UNLOCK_SERVICE_NAME $COMMAND

0 comments on commit d5ed44a

Please sign in to comment.