Upgrade CI to use docker-compose v2 (#3543)

## Motivation and Context
- https://github.com/actions/runner-images/issues/9557
- https://docs.docker.com/compose/migrate/

## Description
It seems like they should be drop-in compatible for our use case.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This commit is contained in:
Russell Cohen 2024-04-02 12:12:02 -04:00 committed by GitHub
parent 31e7b1a9ee
commit 88405d6383
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

2
ci
View File

@ -10,7 +10,7 @@ if [[ $# -lt 1 ]]; then
echo "Usage: ci <action> [args...]"
echo
echo "Runs a CI action from tools/ci-build/scripts within the Docker build image."
echo "Requires Docker and docker-compose to both be installed."
echo "Requires Docker and docker compose to both be installed."
echo
echo "Note: Some actions may require 'aws-sdk-rust' and/or 'aws-doc-sdk-examples'"
echo "to be checked out in the same directory as 'smithy-rs'."

View File

@ -33,7 +33,7 @@ ACTION_PATH="$("${SCRIPT_PATH}"/ci-create-workspace)"
cd "${SCRIPT_PATH}"
function cleanup {
docker-compose -f build.docker-compose.yml down
docker compose -f build.docker-compose.yml down
cd "${START_PATH}"
mv "${ACTION_PATH}/workspace/artifacts" .
if [[ -d "${ACTION_PATH}/workspace/smithy-rs/target" ]]; then
@ -51,10 +51,10 @@ GROUP_ID="$(id -g)"
export USER_ID
export GROUP_ID
export GRADLE_CACHE_PATH="${START_PATH}/gradle"
docker-compose -f build.docker-compose.yml up -d
docker compose -f build.docker-compose.yml up -d
if [[ "${ACTION_NAME}" == "--shell" ]]; then
docker-compose -f build.docker-compose.yml exec smithy-rs-build /bin/bash
docker compose -f build.docker-compose.yml exec smithy-rs-build /bin/bash
else
docker-compose -f build.docker-compose.yml exec -T smithy-rs-build bash -c "cd workspace; ./ci-scripts/${ACTION_NAME} ${ACTION_ARGS[*]}"
docker compose -f build.docker-compose.yml exec -T smithy-rs-build bash -c "cd workspace; ./ci-scripts/${ACTION_NAME} ${ACTION_ARGS[*]}"
fi
exit $?