From 615759f148ae842c01b34172df35eb25ad3f40a8 Mon Sep 17 00:00:00 2001 From: "Damian.Ujma@hyland.com" Date: Mon, 21 Nov 2022 17:01:21 +0100 Subject: [PATCH] ACS-3841 Create docker-compose for dbs --- .github/workflows/ci.yml | 20 +++++----- .../docker-compose/docker-compose-db.yaml | 40 +++++++++++++++++++ 2 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 scripts/gh-actions/docker-compose/docker-compose-db.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a41ca59b88..7429c68254 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -242,10 +242,10 @@ jobs: with: java-version: ${{ env.JAVA_VERSION }} distribution: "temurin" - - name: "docker build 1" - run: docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.2.18 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci - - name: "docker build 2" - run: docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.17.1-jre11-rockylinux8 + - name: "Set up the environment" + run: docker-compose -f ./scripts/gh-actions/docker-compose/docker-compose-db.yaml --profile mariadb up -d + env: + - MARIADB_VERSION=10.2.18 - name: "Run tests" run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver @@ -280,7 +280,7 @@ jobs: with: java-version: ${{ env.JAVA_VERSION }} distribution: "temurin" - - name: "build" + - name: "Build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: | bash ./scripts/travis/init.sh @@ -411,12 +411,12 @@ jobs: with: java-version: ${{ env.JAVA_VERSION }} distribution: "temurin" - - name: "init" - run: bash ./scripts/travis/init.sh - - name: "build" + - name: "Build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: bash ./scripts/travis/build.sh - - name: "verify" + run: | + bash ./scripts/travis/init.sh + bash ./scripts/travis/build.sh + - name: "Verify" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-postgres -PagsAllTestSuitePt1 ${{ env.LOG_WARN }} diff --git a/scripts/gh-actions/docker-compose/docker-compose-db.yaml b/scripts/gh-actions/docker-compose/docker-compose-db.yaml new file mode 100644 index 0000000000..1e74d3f65d --- /dev/null +++ b/scripts/gh-actions/docker-compose/docker-compose-db.yaml @@ -0,0 +1,40 @@ +version: "3" + +services: + postgres: + profiles: ["postgres"] + image: postgres:${POSTGRES_VERSION} + environment: + - POSTGRES_PASSWORD=alfresco + - POSTGRES_USER=alfresco + - POSTGRES_DB=alfresco + command: postgres -c max_connections=300 + ports: + - "5433:5432" + mariadb: + profiles: ["mariadb"] + image: mariadb:${MARIADB_VERSION} + command: --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + environment: + - MYSQL_ROOT_PASSWORD=alfresco + - MYSQL_USER=alfresco + - MYSQL_DATABASE=alfresco + - MYSQL_PASSWORD=alfresco + ports: + - "3307:3306" + mysql: + profiles: ["mysql"] + image: mysql:${MYSQL_VERSION} + command: --transaction-isolation='READ-COMMITTED' + environment: + - MYSQL_ROOT_PASSWORD=alfresco + - MYSQL_USER=alfresco + - MYSQL_DATABASE=alfresco + - MYSQL_PASSWORD=alfresco + ports: + - "3307:3306" + activemq: + image: alfresco/alfresco-activemq:5.17.1-jre11-rockylinux8 + ports: + - "5672:5672" # AMQP + - "61616:61616" # OpenWire \ No newline at end of file