Skip to content

Commit

Permalink
chore: change use docker v2 command (#3703)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-luna authored Nov 2, 2023
1 parent dd0dfd8 commit affe884
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
20 changes: 10 additions & 10 deletions .ci/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ NODE_VERSION=${NODE_VERSION} \
NODE_FULL_VERSION=${NODE_FULL_VERSION} \
TAV_MODULE=${TAV_MODULE} \
USER_ID="$(id -u):$(id -g)" \
docker-compose \
--no-ansi \
--log-level ERROR \
docker --log-level error\
compose \
--ansi never \
-f .ci/docker/${DOCKER_COMPOSE_FILE} \
build >docker-compose.log 2>docker-compose.err

Expand All @@ -253,24 +253,24 @@ NODE_VERSION=${NODE_VERSION} \
NODE_FULL_VERSION=${NODE_FULL_VERSION} \
TAV_MODULE=${TAV_MODULE} \
USER_ID="$(id -u):$(id -g)" \
docker-compose \
--no-ansi \
--log-level ERROR \
docker --log-level error\
compose \
--ansi never \
-f .ci/docker/${DOCKER_COMPOSE_FILE} \
up \
--exit-code-from node_tests \
--remove-orphans \
--abort-on-container-exit \
node_tests

if ! NODE_VERSION=${NODE_VERSION} docker-compose \
--no-ansi \
--log-level ERROR \
if ! NODE_VERSION=${NODE_VERSION} docker --log-level error\
compose \
--ansi never \
-f .ci/docker/${DOCKER_COMPOSE_FILE} \
down -v --remove-orphans; then
# Workaround for this commonly seen error:
# error while removing network: network docker_default id $id has active endpoints
echo "error: Unexpected error in 'docker-compose down ...'. Forcing removal of unused networks."
echo "error: Unexpected error in 'docker compose down ...'. Forcing removal of unused networks."
docker network inspect docker_default || true
docker network inspect -f '{{range .Containers}}{{ .Name }} {{end}}' docker_default || true
docker network prune --force || true
Expand Down
6 changes: 3 additions & 3 deletions .ci/scripts/windows/prepare-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ NODE_VERSION=${1:?Nodejs version missing NODE_VERSION is not set}

NODE_VERSION=${NODE_VERSION} \
USER_ID="$(id -u):$(id -g)" \
docker-compose \
--no-ansi \
--log-level ERROR \
docker --log-level error\
compose \
--ansi never \
-f .ci/docker/docker-compose-all.yml \
up \
--build \
Expand Down
11 changes: 6 additions & 5 deletions .ci/scripts/windows/stop-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ set -exo pipefail

NODE_VERSION=${1:?Nodejs version missing NODE_VERSION is not set}

NODE_VERSION=${NODE_VERSION} docker-compose \
--no-ansi \
NODE_VERSION=${NODE_VERSION} docker --log-level error\
compose \
--ansi never \
-f .ci/docker/docker-compose-all.yml \
logs \
--timestamps > docker-compose-logs.txt

NODE_VERSION=${NODE_VERSION} docker-compose \
--no-ansi \
--log-level ERROR \
NODE_VERSION=${NODE_VERSION} docker --log-level error\
compose \
--ansi never \
-f .ci/docker/docker-compose-all.yml \
down -v
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"bench:ci": "./test/benchmarks/scripts/run-benchmarks-ci.sh",
"local:start": "./test/script/local-deps-start.sh",
"local:stop": "./test/script/local-deps-stop.sh",
"docker:start": "docker-compose -f ./test/docker-compose.yml up -d",
"docker:stop": "docker-compose -f ./test/docker-compose.yml down",
"docker:start": "docker compose -f ./test/docker-compose.yml up -d",
"docker:stop": "docker compose -f ./test/docker-compose.yml down",
"docker:clean": "./test/script/docker/cleanup.sh",
"docker:dev": "docker-compose -f ./dev-utils/docker-compose.yml run --workdir=/agent nodejs-agent",
"docker:dev": "docker compose -f ./dev-utils/docker-compose.yml run --workdir=/agent nodejs-agent",
"package:snapshot": "rm -rf ./build/snapshot && mkdir -p ./build/snapshot && npm pack --pack-destination ./build/snapshot"
},
"directories": {
Expand Down

0 comments on commit affe884

Please sign in to comment.