Skip to content

Commit

Permalink
[ACS-8352] Migrate to docker compose v2 (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
aonych authored Jul 9, 2024
1 parent 2c28b04 commit 0c68125
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,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"
Expand Down Expand Up @@ -151,7 +151,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"
Expand All @@ -177,7 +177,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"
Expand All @@ -203,7 +203,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"
Expand All @@ -228,7 +228,7 @@ jobs:
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run PostgreSQL 13.7 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.7
- name: "Run tests"
Expand All @@ -253,7 +253,7 @@ jobs:
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run PostgreSQL 14.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: 14.4
- name: "Run tests"
Expand All @@ -276,7 +276,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"
Expand Down Expand Up @@ -341,7 +341,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"
Expand Down Expand Up @@ -437,7 +437,7 @@ jobs:
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run Postgres 14.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"
Expand Down
6 changes: 3 additions & 3 deletions amps/ags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ the _alfresco-internal_ repository:
</snapshots>
</repository>
```


For additional instructions you can check the official Maven documentation:
* [setting up repositories](https://maven.apache.org/guides/mini/guide-multiple-repositories.html)
Expand Down Expand Up @@ -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
Expand All @@ -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
```
6 changes: 3 additions & 3 deletions amps/ags/ci/scripts/getLogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions packaging/tests/scripts/start-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions packaging/tests/scripts/stop-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
2 changes: 1 addition & 1 deletion packaging/tests/scripts/wait-for-alfresco-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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
Expand Down

0 comments on commit 0c68125

Please sign in to comment.