diff --git a/.travis.settings.xml b/.ci.settings.xml similarity index 100% rename from .travis.settings.xml rename to .ci.settings.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..969a1d983c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,558 @@ +name: Alfresco Community Repo CI + +on: + pull_request: + branches: + - feature/** + - fix/** + - master + - release/** + push: + branches: + - feature/** + - fix/** + workflow_call: + workflow_dispatch: + +env: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} + GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60 + LOG_WARN: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" + MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + TAS_ENVIRONMENT: ./packaging/tests/environment + TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts + +jobs: + prepare: + name: "Prepare" + runs-on: ubuntu-latest + if: > + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - name: "Prepare maven cache and check compilation" + run: bash ./scripts/ci/prepare.sh + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_postgresql_tests: + name: "Repository - PostgreSQL ${{ matrix.version }} tests" + runs-on: ubuntu-latest + needs: [prepare] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' && + !contains(github.event.head_commit.message, '[skip db]')) || + contains(github.event.head_commit.message, '[db]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + version: [ '10.9', '11.7', '11.12', '12.4', '12.7', '13.1' ] + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - name: "Run PostgreSQL ${{ matrix.version }} database" + run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d + env: + POSTGRES_VERSION: ${{ matrix.version }} + - name: "Run tests" + run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -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" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_postgresql_latest_tests: + name: "Repository - PostgreSQL 13.3 tests" + runs-on: ubuntu-latest + needs: [prepare] + if: > + (!contains(github.event.head_commit.message, '[skip db]') || + contains(github.event.head_commit.message, '[latest db]') || + contains(github.event.head_commit.message, '[db]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - name: "Run PostgreSQL 13.3 database" + run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d + env: + POSTGRES_VERSION: 13.3 + - name: "Run tests" + run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -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" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_mariadb_tests: + name: Repository - MariaDB ${{ matrix.version }} tests + runs-on: ubuntu-latest + needs: [ prepare ] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' && + !contains(github.event.head_commit.message, '[skip db]')) || + contains(github.event.head_commit.message, '[db]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + version: [ '10.2.18', '10.4', '10.5', '10.6' ] + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - 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 + env: + MARIADB_VERSION: ${{ matrix.version }} + - 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 + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_mariadb_latest_tests: + name: Repository - MariaDB 10.6 tests + runs-on: ubuntu-latest + needs: [ prepare ] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' && + !contains(github.event.head_commit.message, '[skip db]')) || + contains(github.event.head_commit.message, '[latest db]') || + contains(github.event.head_commit.message, '[db]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - 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 + env: + MARIADB_VERSION: 10.6 + - 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 + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_mysql_5_7_28_tests: + name: Repository - MySQL 5.7.28 tests + runs-on: ubuntu-latest + needs: [ prepare ] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' && + !contains(github.event.head_commit.message, '[skip db]')) || + contains(github.event.head_commit.message, '[db]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - name: "Run MySQL 5.7.28 database" + run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d + env: + MYSQL_VERSION: 5.7.28 + - name: "Run tests" + run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_mysql_8_tests: + name: Repository - MySQL 8 tests + runs-on: ubuntu-latest + needs: [prepare] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' && + !contains(github.event.head_commit.message, '[skip db]')) || + contains(github.event.head_commit.message, '[latest db]') || + contains(github.event.head_commit.message, '[db]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - 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 + env: + MYSQL_VERSION: 8 + - name: "Run tests" + run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + remote_api_app_context_test_suites: + name: Remote-api - ${{ matrix.testSuite }} + runs-on: ubuntu-latest + needs: [prepare] + if: > + !contains(github.event.head_commit.message, '[skip repo]') && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + include: + - testSuite: AppContext01TestSuite + compose-profile: default + - testSuite: AppContext02TestSuite + compose-profile: with-transform-core-aio + - testSuite: AppContext03TestSuite + compose-profile: with-transform-core-aio + - testSuite: AppContext04TestSuite + compose-profile: with-transform-core-aio + - testSuite: AppContextExtraTestSuite + compose-profile: default + env: + REQUIRES_INSTALLED_ARTIFACTS: true + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Build" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: | + bash ./scripts/ci/init.sh + bash ./scripts/ci/build.sh + - name: "Set up the environment" + 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" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_app_context_test_suites: + name: Repository - ${{ matrix.testSuite }} + runs-on: ubuntu-latest + needs: [prepare] + if: > + !contains(github.event.head_commit.message, '[skip repo]') && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + include: + - testSuite: AppContext01TestSuite + compose-profile: with-transform-core-aio + - testSuite: AppContext02TestSuite + compose-profile: default + - testSuite: AppContext03TestSuite + compose-profile: with-transform-core-aio + - testSuite: AppContext04TestSuite + compose-profile: with-transform-core-aio + - testSuite: AppContext05TestSuite + compose-profile: default + mvn-options: '"-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"' + - testSuite: AppContext06TestSuite + compose-profile: with-transform-core-aio + - testSuite: AppContextExtraTestSuite + compose-profile: with-transform-core-aio + - testSuite: MiscContextTestSuite + compose-profile: with-transform-core-aio + - testSuite: SearchTestSuite + compose-profile: default + mvn-options: '-Dindex.subsystem.name=solr6' + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - name: "Set up the environment" + run: | + if [ -e ./scripts/ci/tests/${{ matrix.testSuite }}-setup.sh ]; then + bash ./scripts/ci/tests/${{ matrix.testSuite }}-setup.sh + fi + 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" + run: bash ./scripts/ci/cleanup_cache.sh + + all_unit_tests_suite: + name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" + runs-on: ubuntu-latest + needs: [prepare] + if: > + !contains(github.event.head_commit.message, '[skip repo]') && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - name: "Run tests" + run: | + mvn -B test -pl core,data-model -am -DfailIfNoTests=false + mvn -B test -pl repository -am -Dtest=AllUnitTestsSuite -DfailIfNoTests=false + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + repository_messaging_tests: + name: Repository - Messaging tests + runs-on: ubuntu-latest + needs: [prepare] + if: > + !contains(github.event.head_commit.message, '[skip repo]') && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - 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 + - name: "Run tests" + run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + tas_tests: + name: ${{ matrix.test-name }} + runs-on: ubuntu-latest + needs: [prepare] + # TAS tests are generally skipped on feature branches as they will be repeated on the enterprise repo or community packaging builds + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) && + !contains(github.event.head_commit.message, '[skip tas]')) || + contains(github.event.head_commit.message, '[tas]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + include: + - test-name: "REST API TAS tests part1" + pom-dir: tas-restapi + test-profile: run-restapi-part1 + docker-compose: docker-compose-minimal+transforms.yml + - test-name: "REST API TAS tests part2" + pom-dir: tas-restapi + test-profile: run-restapi-part2 + docker-compose: docker-compose-minimal+transforms.yml + - test-name: "REST API TAS tests part3" + pom-dir: tas-restapi + test-profile: run-restapi-part3 + docker-compose: docker-compose-minimal+transforms.yml + - test-name: "CMIS TAS tests - BROWSER binding" + pom-dir: tas-cmis + test-profile: run-cmis-browser + docker-compose: docker-compose-minimal+transforms.yml + - test-name: "CMIS TAS tests - ATOM binding" + pom-dir: tas-cmis + test-profile: run-cmis-atom + docker-compose: docker-compose-minimal+transforms.yml + - test-name: "CMIS TAS tests - WEBSERVICES binding" + pom-dir: tas-cmis + test-profile: run-cmis-webservices + docker-compose: docker-compose-minimal+transforms.yml + - test-name: "Email TAS tests" + pom-dir: tas-email + docker-compose: docker-compose-minimal.yml + - test-name: "WebDAV TAS tests" + pom-dir: tas-webdav + docker-compose: docker-compose-minimal.yml + - test-name: "Integration TAS tests" + pom-dir: tas-integration + docker-compose: docker-compose-minimal.yml + env: + REQUIRES_LOCAL_IMAGES: true + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Build" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: | + bash ./scripts/ci/init.sh + bash ./scripts/ci/build.sh + - name: "Set up the environment" + run: | + ${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/${{ matrix.docker-compose }} + ${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" + - name: "Run tests" + id: tests + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: mvn -B install -f packaging/tests/${{ matrix.pom-dir }}/pom.xml -Pall-tas-tests,${{ matrix.test-profile }} -Denvironment=default -DrunBugs=false + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + share_services_test_suite: + name: Share Services - ShareServicesTestSuite + runs-on: ubuntu-latest + needs: [prepare] + if: > + !contains(github.event.head_commit.message, '[skip repo]') && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - name: "Run Postgres 13.3 database" + 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" + run: bash ./scripts/ci/cleanup_cache.sh + + ags_postgresql_tests: + name: AGS Integration Tests 0${{ matrix.part }} (PostgreSQL) ${{ matrix.test-name }} + runs-on: ubuntu-latest + needs: [ prepare ] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) && + !contains(github.event.head_commit.message, '[skip ags]')) || + contains(github.event.head_commit.message, '[ags]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + part: [ 1, 2, 3 ] + env: + REQUIRES_INSTALLED_ARTIFACTS: true + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Build" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: | + bash ./scripts/ci/init.sh + bash ./scripts/ci/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 -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + ags_mysql_tests: + name: AGS Integration Tests 0${{ matrix.part }} (MySQL) ${{ matrix.test-name }} + runs-on: ubuntu-latest + needs: [ prepare ] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) && + !contains(github.event.head_commit.message, '[skip ags]')) || + contains(github.event.head_commit.message, '[ags on MySQL]')) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + strategy: + fail-fast: false + matrix: + part: [ 1, 2, 3 ] + env: + REQUIRES_INSTALLED_ARTIFACTS: true + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Build" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: | + bash ./scripts/ci/init.sh + bash ./scripts/ci/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-mysql -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + ags_community_rest_api_tests: + name: "AGS Community Rest API Tests" + runs-on: ubuntu-latest + needs: [prepare] + if: > + (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) && + !contains(github.event.head_commit.message, '[skip ags]') && !contains(github.event.head_commit.message, '[skip tas]')) || + (contains(github.event.head_commit.message, '[ags]') && contains(github.event.head_commit.message, '[tas]'))) && + !contains(github.event.head_commit.message, '[skip tests]') && + !contains(github.event.head_commit.message, '[force]') + env: + REQUIRES_LOCAL_IMAGES: true + steps: + - uses: actions/checkout@v3 + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Build" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: | + bash ./scripts/ci/init.sh + bash ./scripts/ci/build.sh + - name: "Set up the environment" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: | + ${{ env.TAS_SCRIPTS }}/start-compose.sh ./amps/ags/rm-community/rm-community-repo/docker-compose.yml + ${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco" + mvn -B install -pl :alfresco-governance-services-automation-community-rest-api -am -Pags -Pall-tas-tests -DskipTests + - name: "Test" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -Dskip.automationtests=false -Pags -Pall-tas-tests + - name: "Get logs" + if: ${{ always() }} + run: | + bash amps/ags/ci/scripts/getLogs.sh + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh diff --git a/.github/workflows/master_release.yml b/.github/workflows/master_release.yml new file mode 100644 index 0000000000..a74b154478 --- /dev/null +++ b/.github/workflows/master_release.yml @@ -0,0 +1,83 @@ +name: Master/Release branch workflow + +on: + push: + branches: + - master + - release/** + +env: + GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} + GIT_EMAIL: ${{ secrets.BOT_GITHUB_EMAIL }} + GIT_PASSWORD: ${{ secrets.BOT_GITHUB_TOKEN }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60 + +jobs: + run_ci: + uses: ./.github/workflows/ci.yml + secrets: inherit + push_to_nexus: + name: "Push to Nexus" + runs-on: ubuntu-latest + needs: [run_ci] + if: > + !(failure() || cancelled()) && + !contains(github.event.head_commit.message, '[no release]') && + github.event_name != 'pull_request' + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.33.0 + with: + username: ${{ env.GIT_USERNAME }} + email: ${{ env.GIT_EMAIL }} + global: true + - name: "Release" + timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} + run: | + bash scripts/ci/verify_release_tag.sh + bash scripts/ci/maven_release.sh + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + update_downstream: + name: "Update alfresco-enterprise-repo" + runs-on: ubuntu-latest + needs: [push_to_nexus] + if: > + !(failure() || cancelled()) && + !contains(github.event.head_commit.message, '[no downstream]') && + github.event_name != 'pull_request' + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 + with: + java-version: "11" + - name: "Init" + run: bash ./scripts/ci/init.sh + - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.33.0 + with: + username: ${{ env.GIT_USERNAME }} + email: ${{ env.GIT_EMAIL }} + global: true + - name: "Update downstream" + run: bash ./scripts/ci/update_downstream.sh + env: + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0c2290ebbe..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,381 +0,0 @@ ---- -dist: focal -language: java -jdk: openjdk11 - -services: - - docker - -git: - depth: false - quiet: true - -cache: - directories: - - ${HOME}/.m2/repository - -# the cache can grow constantly -before_cache: bash scripts/travis/cleanup_cache.sh - -branches: - only: - - master - - /release\/.*/ - - /feature\/.*/ - - /fix\/.*/ - -env: - global: - - TAS_SCRIPTS=../alfresco-community-repo/packaging/tests/scripts - - TAS_ENVIRONMENT=./packaging/tests/environment - - LOG_WARN="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" - -stages: - - name: test - if: commit_message !~ /\[skip tests\]/ - - name: release - if: commit_message !~ /\[no release\]/ AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND fork = false - - name: update_downstream - if: commit_message !~ /\[no downstream\]/ AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND fork = false - -before_install: travis_retry bash scripts/travis/init.sh -install: travis_retry travis_wait 40 bash scripts/travis/build.sh - -jobs: - include: - - - name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" - if: commit_message !~ /\[skip repo\]/ - script: - - travis_retry mvn -B test -pl core,data-model - - travis_retry mvn -B test -pl repository -Dtest=AllUnitTestsSuite - - - name: "Repository - AppContext01TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - AppContext02TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - AppContext03TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - AppContext04TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - AppContext05TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - mkdir -p "${HOME}/tmp" - - cp repository/src/test/resources/realms/alfresco-realm.json "${HOME}/tmp" - - export HOST_IP=$(hostname -I | cut -f1 -d' ') - - docker run -d -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=h2 -p 8999:8080 -e KEYCLOAK_IMPORT=/tmp/alfresco-realm.json -v $HOME/tmp/alfresco-realm.json:/tmp/alfresco-realm.json alfresco/alfresco-identity-service:1.2 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext05TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth" - - - name: "Repository - AppContext06TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - AppContextExtraTestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - MiscContextTestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - SearchTestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=SearchTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dindex.subsystem.name=solr6 - - - name: "Repository - MariaDB 10.2.18 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - 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 - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -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 - - - name: "Repository - MariaDB 10.4 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - 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.4 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -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 - - - name: "Repository - MariaDB 10.5 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - 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.5 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -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 - - - name: "Repository - MariaDB 10.6 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/ - before_script: - - 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.6 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -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 - - - name: "Repository - MySQL 5.7.28 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:5.7.28 --transaction-isolation='READ-COMMITTED' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - MySQL 8 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/ - before_script: - - docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:8 --transaction-isolation='READ-COMMITTED' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - PostgreSQL 10.9 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.9 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - PostgreSQL 11.7 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - PostgreSQL 11.12 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.12 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - PostgreSQL 12.4 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:12.4 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - PostgreSQL 12.7 tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:12.7 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - PostgreSQL 13.1 tests" - # We only run DB tests on the latest version of PostgreSQL on feature branches - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - PostgreSQL 13.3 tests" - # We only run DB tests on the latest version of PostgreSQL on feature branches - if: commit_message !~ /\[skip db\]/ OR commit_message =~ /\[latest db\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Repository - Messaging tests" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl repository -Dtest=CamelRoutesTest,CamelComponentsTest - - - name: "Remote-api - AppContext01TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Remote-api - AppContext02TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Remote-api - AppContext03TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Remote-api - AppContext04TestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - - docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6 - script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "Remote-api - AppContextExtraTestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - - docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1 - script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "REST API TAS tests part1" - # TAS tests are generally skipped on feature branches as they will be repeated on the enterprise repo or community packaging builds - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false - - - name: "REST API TAS tests part2" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part2 -Denvironment=default -DrunBugs=false - - - name: "REST API TAS tests part3" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part3 -Denvironment=default -DrunBugs=false - - - name: "CMIS TAS tests - BROWSER binding" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-browser -Denvironment=default -DrunBugs=false - - - name: "CMIS TAS tests - ATOM binding" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-atom -Denvironment=default -DrunBugs=false - - - name: "CMIS TAS tests - WEBSERVICES binding" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-webservices -Denvironment=default -DrunBugs=false - - - name: "Email TAS tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 30 mvn -B install -f packaging/tests/tas-email/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false - - - name: "WebDAV TAS tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 30 mvn -B install -f packaging/tests/tas-webdav/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false - - - name: "Integration TAS tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/ - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - script: travis_wait 30 mvn -B install -f packaging/tests/tas-integration/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false - - - name: "Share Services - ShareServicesTestSuite" - if: commit_message !~ /\[skip repo\]/ - before_script: - - docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300' - script: travis_wait 20 mvn -B test -pl :alfresco-share-services -Dtest=ShareServicesTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - - name: "AGS Unit & Integration Tests 01 (PostgreSQL)" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags\]/ - script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-postgres -PagsAllTestSuitePt1 -f amps/ags/pom.xml ${LOG_WARN} - - - name: "AGS Integration Tests 02 (PostgreSQL)" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags\]/ - script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-postgres -PagsAllTestSuitePt2 -f amps/ags/pom.xml ${LOG_WARN} - - - name: "AGS Integration Tests 03 (PostgreSQL)" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags\]/ - script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-postgres -PagsAllTestSuitePt3 -f amps/ags/pom.xml ${LOG_WARN} - - - name: "AGS Unit & Integration Tests 01 (MySQL) " - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags on MySQL\]/ - script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt1 -f amps/ags/pom.xml ${LOG_WARN} - - - name: "AGS Integration Tests 02 (MySQL) " - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags on MySQL\]/ - script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt2 -f amps/ags/pom.xml ${LOG_WARN} - - - name: "AGS Integration Tests 03 (MySQL) " - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags on MySQL\]/ - script: travis_retry travis_wait 80 mvn -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt3 -f amps/ags/pom.xml ${LOG_WARN} - - - name: "AGS Community Rest API Tests" - if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags\]/ - addons: - artifacts: - paths: - - ./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log - - alfresco.log - - solr.log - target_paths: community/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NAME} - before_script: - - ${TAS_SCRIPTS}/start-compose.sh ./amps/ags/rm-community/rm-community-repo/docker-compose.yml - - ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco" - script: travis_wait 40 mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -Dskip.automationtests=false -Pags - after_script: bash amps/ags/travis/scripts/getLogs.sh - - - name: "Push to Nexus" - stage: release - before_script: bash scripts/travis/verify_release_tag.sh - script: travis_wait 40 bash scripts/travis/maven_release.sh - - - name: "Update alfresco-enterprise-repo" - stage: update_downstream - install: skip - script: bash scripts/travis/update_downstream.sh - diff --git a/README.md b/README.md index 03d9a2c4bb..1549fe88ea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # alfresco-community-repo -[![Build Status](https://travis-ci.com/Alfresco/alfresco-community-repo.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-community-repo) +[![Build Status](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml/badge.svg?branch=release/7.1.1)](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml) + This project contains the bulk of the [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository) code. diff --git a/amps/ags/travis/scripts/getLogs.sh b/amps/ags/ci/scripts/getLogs.sh similarity index 100% rename from amps/ags/travis/scripts/getLogs.sh rename to amps/ags/ci/scripts/getLogs.sh diff --git a/scripts/travis/build.sh b/scripts/ci/build.sh similarity index 100% rename from scripts/travis/build.sh rename to scripts/ci/build.sh diff --git a/scripts/travis/build_functions.sh b/scripts/ci/build_functions.sh similarity index 89% rename from scripts/travis/build_functions.sh rename to scripts/ci/build_functions.sh index be8247265f..103ed2e0ee 100644 --- a/scripts/travis/build_functions.sh +++ b/scripts/ci/build_functions.sh @@ -2,18 +2,18 @@ set +vx function isPullRequestBuild() { - test "${TRAVIS_PULL_REQUEST}" != "false" + test "${PULL_REQUEST}" != "false" } function isBranchBuild() { - test "${TRAVIS_PULL_REQUEST}" = "false" + test "${PULL_REQUEST}" = "false" } function cloneRepo() { local REPO="${1}" local TAG_OR_BRANCH="${2}" - printf "Clonning \"%s\" on %s\n" "${TAG_OR_BRANCH}" "${REPO}" + printf "Cloning \"%s\" on %s\n" "${TAG_OR_BRANCH}" "${REPO}" # clone the repository branch/tag pushd "$(dirname "${BASH_SOURCE[0]}")/../../../" >/dev/null @@ -82,15 +82,9 @@ function remoteBranchExists() { function identifyUpstreamSourceBranch() { local UPSTREAM_REPO="${1}" - # if it's a pull request, use the source branch name (if it exists) - if isPullRequestBuild && remoteBranchExists "${UPSTREAM_REPO}" "${TRAVIS_PULL_REQUEST_BRANCH}" ; then - echo "${TRAVIS_PULL_REQUEST_BRANCH}" - exit 0 - fi - # otherwise use the current branch name (or in case of PRs, the target branch name) - if remoteBranchExists "${UPSTREAM_REPO}" "${TRAVIS_BRANCH}" ; then - echo "${TRAVIS_BRANCH}" + if remoteBranchExists "${UPSTREAM_REPO}" "${BRANCH_NAME}" ; then + echo "${BRANCH_NAME}" exit 0 fi diff --git a/scripts/travis/cleanup_cache.sh b/scripts/ci/cleanup_cache.sh similarity index 100% rename from scripts/travis/cleanup_cache.sh rename to scripts/ci/cleanup_cache.sh diff --git a/scripts/ci/docker-compose/docker-compose-db.yaml b/scripts/ci/docker-compose/docker-compose-db.yaml new file mode 100644 index 0000000000..8412f2d7b3 --- /dev/null +++ b/scripts/ci/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.16.1 + ports: + - "5672:5672" # AMQP + - "61616:61616" # OpenWire diff --git a/scripts/ci/docker-compose/docker-compose.yaml b/scripts/ci/docker-compose/docker-compose.yaml new file mode 100644 index 0000000000..8efe69e113 --- /dev/null +++ b/scripts/ci/docker-compose/docker-compose.yaml @@ -0,0 +1,26 @@ +version: "3" + +services: + transform-core-aio: + profiles: ["with-transform-core-aio"] + image: alfresco/alfresco-transform-core-aio:2.5.6 + environment: + JAVA_OPTS: " -Xms256m -Xmx256m" + ports: + - "8090:8090" + postgres: + image: postgres:13.3 + profiles: ["default", "with-transform-core-aio", "postgres"] + environment: + - POSTGRES_PASSWORD=alfresco + - POSTGRES_USER=alfresco + - POSTGRES_DB=alfresco + command: postgres -c max_connections=300 + ports: + - "5433:5432" + activemq: + profiles: ["default", "with-transform-core-aio", "activemq"] + image: alfresco/alfresco-activemq:5.16.1 + ports: + - "5672:5672" # AMQP + - "61616:61616" # OpenWire diff --git a/scripts/travis/init.sh b/scripts/ci/init.sh similarity index 88% rename from scripts/travis/init.sh rename to scripts/ci/init.sh index 8692d8d1eb..47b1fc1bb7 100644 --- a/scripts/travis/init.sh +++ b/scripts/ci/init.sh @@ -5,7 +5,7 @@ set -vex pushd "$(dirname "${BASH_SOURCE[0]}")/../../" # Maven Setup -mkdir -p "${HOME}/.m2" && cp -f .travis.settings.xml "${HOME}/.m2/settings.xml" +mkdir -p "${HOME}/.m2" && cp -f .ci.settings.xml "${HOME}/.m2/settings.xml" find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf # Docker Logins diff --git a/scripts/travis/maven_release.sh b/scripts/ci/maven_release.sh similarity index 100% rename from scripts/travis/maven_release.sh rename to scripts/ci/maven_release.sh diff --git a/scripts/ci/prepare.sh b/scripts/ci/prepare.sh new file mode 100644 index 0000000000..454151de31 --- /dev/null +++ b/scripts/ci/prepare.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -e + +M2_REPO_DIR="$HOME/.m2/repository" +M2_REPO_TTL_MINUTES=10080 +M2_REPO_EXPIRED="$(find $M2_REPO_DIR -type f -mmin +$M2_REPO_TTL_MINUTES 2>/dev/null | head -n 1 | wc -l)" +M2_REPO_FILE_COUNT="$(find $M2_REPO_DIR -type f 2>/dev/null | wc -l)" + +ORG_ALFRESCO_M2_REPO_DIR="$M2_REPO_DIR/org/alfresco" +ORG_ALFRESCO_M2_REPO_TTL_MINUTES=1440 +ORG_ALFRESCO_M2_REPO_EXPIRED="$(find $ORG_ALFRESCO_M2_REPO_DIR -type f -mmin +$ORG_ALFRESCO_M2_REPO_TTL_MINUTES 2>/dev/null | head -n 1 | wc -l)" + +echo "Files in the maven repo: $M2_REPO_FILE_COUNT" + +if [ $ORG_ALFRESCO_M2_REPO_EXPIRED -eq 1 ];then + echo "Invalidating org/alfresco maven local cache." + rm -rf "$ORG_ALFRESCO_M2_REPO_DIR" +fi + +if [ $M2_REPO_EXPIRED -eq 1 ];then + echo "Invalidating maven local cache." + rm -rf "$M2_REPO_DIR" +fi + +if [ $M2_REPO_FILE_COUNT -lt 1000 ] || [ $ORG_ALFRESCO_M2_REPO_EXPIRED -eq 1 ] || [ $M2_REPO_EXPIRED -eq 1 ];then + echo "Populating maven cache." + export BUILD_PROFILES="-Pall-tas-tests,ags" + export BUILD_OPTIONS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dmaven.artifact.threads=8" + source "$(dirname "${BASH_SOURCE[0]}")/build.sh" +fi diff --git a/scripts/ci/tests/AppContext05TestSuite-setup.sh b/scripts/ci/tests/AppContext05TestSuite-setup.sh new file mode 100644 index 0000000000..718bfcfc30 --- /dev/null +++ b/scripts/ci/tests/AppContext05TestSuite-setup.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +echo "=========================== Starting AppContext05TestSuite setup ===========================" +PS4="\[\e[35m\]+ \[\e[m\]" +set -vex +pushd "$(dirname "${BASH_SOURCE[0]}")/../../../" + +mkdir -p "${HOME}/tmp" +cp repository/src/test/resources/realms/alfresco-realm.json "${HOME}/tmp" +echo "HOST_IP=$(hostname -I | cut -f1 -d' ')" >> $GITHUB_ENV +docker run -d -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=h2 -p 8999:8080 -e KEYCLOAK_IMPORT=/tmp/alfresco-realm.json -v $HOME/tmp/alfresco-realm.json:/tmp/alfresco-realm.json alfresco/alfresco-identity-service:1.2 + +popd +set +vex +echo "=========================== Finishing AppContext05TestSuite setup ==========================" diff --git a/scripts/travis/update_downstream.sh b/scripts/ci/update_downstream.sh similarity index 100% rename from scripts/travis/update_downstream.sh rename to scripts/ci/update_downstream.sh diff --git a/scripts/travis/verify_release_tag.sh b/scripts/ci/verify_release_tag.sh similarity index 100% rename from scripts/travis/verify_release_tag.sh rename to scripts/ci/verify_release_tag.sh