mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2026-09-16 18:13:21 +00:00
* Revert "Revert "ACS-12380 Use env-load-from-yaml to read RELEASE_VERSION and DEVELOPMENT_VERSION (#1693)" (#1695)"
This reverts commit 0a20da79
* ACS-12380 Adjust RELEASE_VERSION
354 lines
16 KiB
YAML
354 lines
16 KiB
YAML
name: ACS Community Packaging CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- release/**
|
|
- feature/**
|
|
- fix/**
|
|
push:
|
|
branches:
|
|
- master
|
|
- release/**
|
|
- feature/**
|
|
- fix/**
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
JAVA_VERSION: "21"
|
|
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 }}
|
|
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60
|
|
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
|
|
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
|
|
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
|
|
TAS_ENVIRONMENT: ./tests/environment
|
|
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts
|
|
# Note: RELEASE_VERSION and DEVELOPMENT_VERSION are now loaded from .github/release-versions.yml
|
|
jobs:
|
|
precommit:
|
|
name: Pre-Commit checks
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
!contains(github.event.head_commit.message, '[skip tests]')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
|
|
tas_tests:
|
|
name: ${{ matrix.testSuite }} TAS tests
|
|
runs-on: ubuntu-latest
|
|
if: ${{ !contains(github.event.head_commit.message, '[skip tas]') && !contains(github.event.head_commit.message, '[skip tests]') }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- testSuite: REST API part1
|
|
pom: tests/tas-restapi/pom.xml
|
|
profiles: all-tas-tests,run-restapi-part1
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: REST API part2
|
|
pom: tests/tas-restapi/pom.xml
|
|
profiles: all-tas-tests,run-restapi-part2
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: REST API part3
|
|
pom: tests/tas-restapi/pom.xml
|
|
profiles: all-tas-tests,run-restapi-part3
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: CMIS (BROWSER binding)
|
|
pom: tests/tas-cmis/pom.xml
|
|
profiles: all-tas-tests,run-cmis-browser
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: CMIS (ATOM binding)
|
|
pom: tests/tas-cmis/pom.xml
|
|
profiles: all-tas-tests,run-cmis-atom
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: CMIS (WEBSERVICES binding)
|
|
pom: tests/tas-cmis/pom.xml
|
|
profiles: all-tas-tests,run-cmis-webservices
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: Email
|
|
pom: tests/tas-email/pom.xml
|
|
profiles: all-tas-tests
|
|
compose-file: docker-compose-minimal.yml
|
|
- testSuite: WebDAV
|
|
pom: tests/tas-webdav/pom.xml
|
|
profiles: all-tas-tests
|
|
compose-file: docker-compose-minimal.yml
|
|
- testSuite: Integration
|
|
pom: tests/tas-integration/pom.xml
|
|
profiles: all-tas-tests
|
|
compose-file: docker-compose-minimal.yml
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
- name: "Init"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh
|
|
- name: "Setup the environment"
|
|
run: |
|
|
${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/${{ matrix.compose-file }}
|
|
${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
|
- name: "Test"
|
|
run: mvn -B install -ntp -f ${{ matrix.pom }} -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh
|
|
|
|
tas_tests_search_api:
|
|
name: ${{ matrix.testSuite }} | TAS tests (Search API)
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
|
|
!contains(github.event.head_commit.message, '[skip search]') &&
|
|
!contains(github.event.head_commit.message, '[skip tests]')
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- testSuite: Elasticsearch postgreSQL
|
|
profiles: all-tas-tests,elastic
|
|
search-engine-type: elasticsearch
|
|
db-type: postgresql
|
|
- testSuite: Elasticsearch MySQL
|
|
profiles: all-tas-tests,elastic
|
|
search-engine-type: elasticsearch
|
|
db-type: mysql
|
|
- testSuite: Elasticsearch Maria DB 11.8
|
|
profiles: all-tas-tests,elastic
|
|
search-engine-type: elasticsearch
|
|
db-type: mariadb
|
|
- testSuite: Opensearch
|
|
profiles: all-tas-tests,elastic
|
|
search-engine-type: opensearch
|
|
db-type: postgresql
|
|
- testSuite: Elasticsearch Basic Auth postgreSQL
|
|
profiles: all-tas-tests,elastic-basic-auth
|
|
search-engine-type: elasticsearch
|
|
db-type: postgresql
|
|
- testSuite: Elasticsearch Basic Auth MySQL
|
|
profiles: all-tas-tests,elastic-basic-auth
|
|
search-engine-type: elasticsearch
|
|
db-type: mysql
|
|
- testSuite: Elasticsearch Basic Auth MariaDB 11.8
|
|
profiles: all-tas-tests,elastic-basic-auth
|
|
search-engine-type: elasticsearch
|
|
db-type: mariadb
|
|
- testSuite: Opensearch Basic Auth
|
|
profiles: all-tas-tests,elastic-basic-auth
|
|
search-engine-type: opensearch
|
|
db-type: postgresql
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
- name: "Build"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh
|
|
- name: "Run tests"
|
|
id: tests
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
set -a
|
|
source ${TAS_ENVIRONMENT}/.env
|
|
set +a
|
|
BATCH_INDEXING_TAG="${BATCH_INDEXING_TAG//[[:space:]]/}"
|
|
mvn -B -ntp -q install -N -f tests/pom.xml
|
|
mvn -B -ntp -q install -DskipTests -f tests/testcontainers-env/pom.xml
|
|
mvn -B install -ntp -f tests/tas-elasticsearch/pom.xml -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false "-Dsearch.engine.type=${{ matrix.search-engine-type }}" "-Ddatabase.type=${{ matrix.db-type }}" -Dindeximage="alfresco/alfresco-elasticsearch-batch-indexing:${BATCH_INDEXING_TAG}" -Drepoimage="alfresco-repository-databases:latest"
|
|
- name: "Dump all Docker containers logs"
|
|
uses: Alfresco/alfresco-build-tools/.github/actions/docker-dump-containers-logs@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
if: failure() && steps.tests.outcome == 'failure'
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh
|
|
|
|
|
|
community_zip_tests:
|
|
name: Community Distribution Zip content tests
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.head_commit.message, '[skip tests]')"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
- name: "Init"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh
|
|
- name: "Build"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: mvn -B -ntp -V clean install -Pags -DskipTests -Dmaven.javadoc.skip=true
|
|
- name: "Test"
|
|
run: mvn -B install -ntp -f tests/tas-distribution-zip/pom.xml -Prun-distribution-zip-contents-check -DrunBugs=false
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh
|
|
|
|
community_test_tomcat_deployment:
|
|
name: "Test Tomcat deployment"
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
!contains(github.event.head_commit.message, '[skip tests]')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
- 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: |
|
|
${TAS_SCRIPTS}/start-compose.sh ./dev/docker-compose.yml
|
|
${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8983/solr"
|
|
- name: "Run tomcat, verify it starts"
|
|
id: tests
|
|
run: |
|
|
(mvn clean install -Prun -rf dev &)
|
|
${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco/"
|
|
echo "Test Alfresco Repository availability"
|
|
curl -Ls -o /dev/null --fail "http://localhost:8080/alfresco"
|
|
echo "Test Share availability"
|
|
curl -Ls -o /dev/null --fail "http://localhost:8080/share"
|
|
|
|
docker_latest:
|
|
name: Update latest Docker images
|
|
runs-on: ubuntu-latest
|
|
needs: [tas_tests, community_zip_tests]
|
|
if: >
|
|
!(failure() || cancelled()) &&
|
|
!contains(github.event.head_commit.message, '[skip docker_latest]') &&
|
|
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) &&
|
|
github.event_name != 'pull_request'
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: "Init"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh -m
|
|
- name: "Push Docker images"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: mvn -B -ntp -V clean install -DskipTests -Dmaven.javadoc.skip=true -Pags -Ppush-docker-images
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh
|
|
|
|
release:
|
|
name: Release and Copy to S3 Staging Bucket
|
|
runs-on: ubuntu-latest
|
|
needs: [docker_latest]
|
|
if: >
|
|
!(failure() || cancelled()) &&
|
|
contains(github.event.head_commit.message, '[release]') &&
|
|
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) &&
|
|
github.event_name != 'pull_request'
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/env-load-from-yaml@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
yml_path: .github/release-versions.yml
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: "Init"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh -m
|
|
- name: "Release"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash scripts/ci/verify_release_tag.sh
|
|
bash scripts/ci/maven_release.sh
|
|
source scripts/ci/prepare_staging_deploy.sh
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh
|
|
- name: "Configure AWS credentials"
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_S3_STAGING_ACCESS_KEY }}
|
|
aws-secret-access-key: ${{ secrets.AWS_S3_STAGING_SECRET_KEY }}
|
|
aws-region: eu-west-1
|
|
- name: "Deploy to S3 Staging Bucket"
|
|
run: |
|
|
aws s3 cp --acl private --recursive ./deploy_dir s3://alfresco-artefacts-staging/alfresco-content-services-community/release/${BRANCH_NAME}/${BUILD_NUMBER}
|
|
aws s3 cp --acl private --recursive ./deploy_dir_ags s3://alfresco-artefacts-staging/community/RM/${RELEASE_VERSION}
|
|
echo "Finished release and deployed to https://s3.console.aws.amazon.com/s3/buckets/alfresco-artefacts-staging/alfresco-content-services-community/release/${BRANCH_NAME}/${BUILD_NUMBER}"
|
|
|
|
publish:
|
|
name: Copy to S3 Release Bucket
|
|
runs-on: ubuntu-latest
|
|
needs: [release]
|
|
if: >
|
|
!(failure() || cancelled()) &&
|
|
contains(github.event.head_commit.message, '[publish]') &&
|
|
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) &&
|
|
github.event_name != 'pull_request'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/env-load-from-yaml@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
with:
|
|
yml_path: .github/release-versions.yml
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@ac0009fd55b474dbf50864caa4f9da36a41e5ffe # v18.21.2
|
|
- name: "Configure AWS credentials"
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_S3_RELEASE_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_S3_RELEASE_SECRET_ACCESS_KEY }}
|
|
aws-region: eu-west-1
|
|
- name: "Deploy to S3 Release Bucket"
|
|
run: |
|
|
bash scripts/ci/copy_to_release_bucket.sh
|
|
bash scripts/ci/copy_ags_to_release_bucket.sh
|