Skip to content

Commit

Permalink
rewrite to docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
ghidalgo3 committed Sep 6, 2024
1 parent dd22066 commit 6dc418d
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
run: ./scripts/citest-integration
if: ${{ github.base_ref == 'main' }}

- name: Get docker-compose logs
run: docker-compose logs
- name: Get docker compose logs
run: docker compose logs
if: always()

- name: Clean up CosmosDB test containers
Expand Down
2 changes: 1 addition & 1 deletion scripts/cideploy
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ while [[ "$#" -gt 0 ]]; do case $1 in
;;
esac done

DOCKER_COMPOSE="docker-compose -f deployment/docker-compose.yml"
DOCKER_COMPOSE="docker compose -f deployment/docker-compose.yml"

if [[ "${CI}" != "true" ]]; then
echo "Only CI can deploy to staging!"
Expand Down
2 changes: 1 addition & 1 deletion scripts/cipublish-pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ while [[ "$#" -gt 0 ]]; do case $1 in
;;
esac done

DOCKER_COMPOSE="docker-compose -f deployment/docker-compose.yml"
DOCKER_COMPOSE="docker compose -f deployment/docker-compose.yml"

# Set terraform to deploy to dev or staging
if [[ "${CI}" != "true" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions scripts/console
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ esac; done
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [ "${DEPLOY}" ]; then
# Run deployment container
docker-compose \
docker compose \
-f deployment/docker-compose.yml \
run --rm \
deploy /bin/bash;

else

docker-compose \
docker compose \
-f docker-compose.console.yml \
run --rm \
-e AZURE_TENANT_ID="${AZURE_TENANT_ID}" \
Expand Down
2 changes: 1 addition & 1 deletion scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [[ "${1}" == "--help" ]]; then
usage
else
docker-compose \
docker compose \
-f docker-compose.console.yml \
run --rm \
dev \
Expand Down
4 changes: 2 additions & 2 deletions scripts/server
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
fi
if [ "${STOP_SERVERS}" ]; then
echo "Stopping servers"
docker-compose -f docker-compose.yml -f docker-compose.aux.yml -f docker-compose.cosmosdb.yml down
docker compose -f docker-compose.yml -f docker-compose.aux.yml -f docker-compose.cosmosdb.yml down
else
echo "Starting servers"
docker-compose -f docker-compose.yml ${AUX_SERVERS} ${COSMOSDB_EMULATOR} \
docker compose -f docker-compose.yml ${AUX_SERVERS} ${COSMOSDB_EMULATOR} \
up ${DETACHED_ARG} "$@"
fi
fi
18 changes: 9 additions & 9 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ source scripts/env
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [ "${CLEAR_RECORDS}" ]; then
echo "Clearing records from Azurite Tables..."
docker-compose -f docker-compose.console.yml run --rm \
docker compose -f docker-compose.console.yml run --rm \
dev \
pctasks-dev azurite clear-records

Expand All @@ -87,18 +87,18 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
fi
if [ "${RESET_COSMOS_DB}" ]; then
echo "Reset cosmos db..."
docker-compose -f docker-compose.cosmosdb.yml stop cosmosdb
docker-compose -f docker-compose.cosmosdb.yml rm -f cosmosdb
docker compose -f docker-compose.cosmosdb.yml stop cosmosdb
docker compose -f docker-compose.cosmosdb.yml rm -f cosmosdb
docker volume rm pctasks_pctasks-cosmosdb-data
docker-compose -f docker-compose.cosmosdb.yml up -d cosmosdb
docker compose -f docker-compose.cosmosdb.yml up -d cosmosdb
fi
if [ "${RM_TEST_CONTAINERS}" ]; then
if [ -z "${PCTASKS_COSMOSDB__TEST_CONTAINER_SUFFIX}" ]; then
echo "No test container suffix set, not removing test containers."
exit 1
fi
echo "Removing test containers..."
docker-compose ${COSMOSDB_EMULATOR} -f docker-compose.console.yml run --rm \
docker compose ${COSMOSDB_EMULATOR} -f docker-compose.console.yml run --rm \
dev \
pctasks-dev cosmosdb rm-test-containers;

Expand Down Expand Up @@ -133,14 +133,14 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then

echo " -- SETTING UP COSMOSDB"
if [ "${COSMOSDB_EMULATOR}" ]; then
if [ -z $(docker-compose ${COSMOSDB_EMULATOR} ps -q cosmosdb) ]; then
if [ -z $(docker compose ${COSMOSDB_EMULATOR} ps -q cosmosdb) ]; then

echo "CosmosDB is not running. Starting it..."
docker-compose ${COSMOSDB_EMULATOR} up -d cosmosdb
docker compose ${COSMOSDB_EMULATOR} up -d cosmosdb
fi
fi

docker-compose ${COSMOSDB_EMULATOR} -f docker-compose.console.yml run --rm \
docker compose ${COSMOSDB_EMULATOR} -f docker-compose.console.yml run --rm \
dev \
pctasks-dev cosmosdb setup
fi
Expand All @@ -153,7 +153,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then

if [ -z "${COSMOS_ONLY}" ]; then
echo " -- SETTING UP AZURITE"
docker-compose -f docker-compose.console.yml run --rm \
docker compose -f docker-compose.console.yml run --rm \
dev \
pctasks-dev azurite setup
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fi

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then

docker-compose \
docker compose \
-f docker-compose.console.yml \
run --rm \
dev \
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-integration
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fi

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then

docker-compose \
docker compose \
-f docker-compose.console.yml \
run --rm \
integration-tests \
Expand Down
6 changes: 3 additions & 3 deletions scripts/update
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ while [[ $# -gt 0 ]]; do case $1 in
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
# Build deployment image
if [ "${BUILD_DEPLOY}" ]; then
docker-compose \
docker compose \
-f deployment/docker-compose.yml \
build
fi

# Build project images
if [ -z "${DEPLOY_ONLY}" ]; then
docker-compose ${BUILD_SERVERS} ${BUILD_TASK} ${BUILD_DEV} ${BUILD_AUX_SERVERS} \
docker compose ${BUILD_SERVERS} ${BUILD_TASK} ${BUILD_DEV} ${BUILD_AUX_SERVERS} \
build ${BUILD_ONLY};
fi

if [ "${BUILD_FRONTEND}" ]; then
docker-compose run --rm --no-deps \
docker compose run --rm --no-deps \
frontend \
npm install --legacy-peer-deps
fi
Expand Down

0 comments on commit 6dc418d

Please sign in to comment.