From 6d52fce26a2546f4ed1487f36c07c38e0a09bee1 Mon Sep 17 00:00:00 2001 From: Domenico Sibilio Date: Mon, 22 Jul 2024 15:07:13 +0200 Subject: [PATCH] ACS-8352 Migrate to Docker Compose v2 (#2799) Co-authored-by: Aleksandra Onych --- .github/workflows/ci.yml | 20 +++++++++---------- amps/ags/README.md | 6 +++--- amps/ags/ci/scripts/getLogs.sh | 6 +++--- packaging/tests/scripts/start-compose.sh | 6 +++--- packaging/tests/scripts/stop-compose.sh | 8 ++++---- .../tests/scripts/wait-for-alfresco-start.sh | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 930f57912fe..c96170d58f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,7 +198,7 @@ jobs: - name: "Set transformers tag" run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d - name: "Run tests" run: mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - name: "Clean Maven cache" @@ -227,7 +227,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: Run MariaDB ${{ matrix.version }} database - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d env: MARIADB_VERSION: ${{ matrix.version }} - name: "Run tests" @@ -254,7 +254,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run MariaDB 10.6 database" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d env: MARIADB_VERSION: 10.6 - name: "Run tests" @@ -281,7 +281,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run MySQL 8 database" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d env: MYSQL_VERSION: 8 - name: "Run tests" @@ -307,7 +307,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run PostgreSQL 13.12 database" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 13.12 - name: "Run tests" @@ -333,7 +333,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run PostgreSQL 14.9 database" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 14.9 - name: "Run tests" @@ -359,7 +359,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run PostgreSQL 15.4 database" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 15.4 - name: "Run tests" @@ -383,7 +383,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run ActiveMQ" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d - name: "Run tests" run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false - name: "Clean Maven cache" @@ -454,7 +454,7 @@ jobs: echo "HOSTNAME_VERIFICATION_DISABLED=false" >> "$GITHUB_ENV" fi - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d - name: "Run tests" run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.mvn-options }} - name: "Clean Maven cache" @@ -546,7 +546,7 @@ jobs: - name: "Init" run: bash ./scripts/ci/init.sh - name: "Run Postgres 15.4 database" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d + run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d - name: "Run tests" run: mvn -B test -pl :alfresco-share-services -am -Dtest=ShareServicesTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - name: "Clean Maven cache" diff --git a/amps/ags/README.md b/amps/ags/README.md index 5a321152ab6..14d37c5eafb 100644 --- a/amps/ags/README.md +++ b/amps/ags/README.md @@ -71,7 +71,7 @@ the _alfresco-internal_ repository: ``` - + For additional instructions you can check the official Maven documentation: * [setting up repositories](https://maven.apache.org/guides/mini/guide-multiple-repositories.html) @@ -227,7 +227,7 @@ If only the Community or Enterprise images need to be built than the same comman The Docker images of the Repo can be started independently from Share running the following command in the rm-repo-enterprise or rm-repo-community folder which contains the Docker-compose.yml file: ``` -docker-compose up +docker compose up ``` > Be aware of the fact that the Share images can not be started independently from Repo @@ -237,5 +237,5 @@ e.g. In order to start an instance of rm-enterprise-repo and rm-enterprise-share If you have a license for jRebel then this can be used from the rm-community-share or rm-enterprise-share directories with: ``` -docker-compose -f docker-compose.yml -f jrebel-docker-compose.yml --project-name agsdev up --build --force-recreate +docker compose -f docker-compose.yml -f jrebel-docker-compose.yml --project-name agsdev up --build --force-recreate ``` diff --git a/amps/ags/ci/scripts/getLogs.sh b/amps/ags/ci/scripts/getLogs.sh index b84c4086899..e3785be3648 100644 --- a/amps/ags/ci/scripts/getLogs.sh +++ b/amps/ags/ci/scripts/getLogs.sh @@ -4,9 +4,9 @@ set -x # Display running containers docker ps -alfrescoContainerId=$(docker ps -a | grep '_alfresco_' | awk '{print $1}') -shareContainerId=$(docker ps -a | grep '_share_' | awk '{print $1}') -solrContainerId=$(docker ps -a | grep '_search_' | awk '{print $1}') +alfrescoContainerId=$(docker ps -a | grep '\-alfresco\-' | awk '{print $1}') +shareContainerId=$(docker ps -a | grep '\-share\-' | awk '{print $1}') +solrContainerId=$(docker ps -a | grep '\-search\-' | awk '{print $1}') docker logs $alfrescoContainerId > alfresco.log if [ -n "$shareContainerId" ]; then diff --git a/packaging/tests/scripts/start-compose.sh b/packaging/tests/scripts/start-compose.sh index e4622058650..a7f41823642 100755 --- a/packaging/tests/scripts/start-compose.sh +++ b/packaging/tests/scripts/start-compose.sh @@ -27,8 +27,8 @@ fi # The second parameter can be used to avoid doing a clean up if we are doing a restart test. if [ "$CLEAN_UP" != "no-clean-up" ] then - docker-compose ${DOCKER_COMPOSES} --project-directory $(dirname "${DOCKER_COMPOSE_PATH}") kill - docker-compose ${DOCKER_COMPOSES} --project-directory $(dirname "${DOCKER_COMPOSE_PATH}") rm -f + docker compose ${DOCKER_COMPOSES} --project-directory $(dirname "${DOCKER_COMPOSE_PATH}") kill + docker compose ${DOCKER_COMPOSES} --project-directory $(dirname "${DOCKER_COMPOSE_PATH}") rm -f export GENERATED_IMAGES=$(docker images | grep '^environment_' | awk '{ print $3 }') if [ -n "$GENERATED_IMAGES" ] @@ -43,7 +43,7 @@ export TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-tra export TRANSFORM_ROUTER_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-service.version -q -DforceStdout) # .env files are picked up from project directory correctly on docker-compose 1.23.0+ -docker-compose ${DOCKER_COMPOSES} --project-directory $(dirname "${DOCKER_COMPOSE_PATH}") up -d +docker compose ${DOCKER_COMPOSES} --project-directory $(dirname "${DOCKER_COMPOSE_PATH}") up -d if [ $? -eq 0 ] then diff --git a/packaging/tests/scripts/stop-compose.sh b/packaging/tests/scripts/stop-compose.sh index 33dc6f54aad..bbf5d18b73d 100755 --- a/packaging/tests/scripts/stop-compose.sh +++ b/packaging/tests/scripts/stop-compose.sh @@ -10,8 +10,8 @@ fi echo "Killing ACS stack in ${DOCKER_COMPOSE_PATH}" -docker-compose --file ${DOCKER_COMPOSE_PATH} ps +docker compose --file ${DOCKER_COMPOSE_PATH} ps # logs for debug -docker-compose --file ${DOCKER_COMPOSE_PATH} logs --no-color -t alfresco -docker-compose --file ${DOCKER_COMPOSE_PATH} kill -docker-compose --file ${DOCKER_COMPOSE_PATH} rm -fv \ No newline at end of file +docker compose --file ${DOCKER_COMPOSE_PATH} logs --no-color -t alfresco +docker compose --file ${DOCKER_COMPOSE_PATH} kill +docker compose --file ${DOCKER_COMPOSE_PATH} rm -fv \ No newline at end of file diff --git a/packaging/tests/scripts/wait-for-alfresco-start.sh b/packaging/tests/scripts/wait-for-alfresco-start.sh index 54acab29637..98f33a8579e 100755 --- a/packaging/tests/scripts/wait-for-alfresco-start.sh +++ b/packaging/tests/scripts/wait-for-alfresco-start.sh @@ -51,7 +51,7 @@ else echo "Alfresco Could not start in time." echo "All started containers:" docker ps -a - ALFCONTAINER=`docker ps -a | grep _alfresco | awk '{ print $1 }'` + ALFCONTAINER=`docker ps -a | grep '\-alfresco' | awk '{ print $1 }'` echo "Last 200 lines from alfresco.log on container $ALFCONTAINER:" docker logs --tail=200 $ALFCONTAINER exit 1