From f300bb9b889a6b2ede6f452c5fbd3758e314d4e2 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 12:13:44 +0200 Subject: [PATCH 01/10] test registry --- .github/workflows/build_and_test.yml | 68 +++++++++++++--------------- docker-bake.hcl | 32 ++++++++----- test/docker-compose.yml | 10 ++-- 3 files changed, 56 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f051998b..26ea2225 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -17,6 +17,8 @@ on: env: ACS_CHART_VERSION: 172410cfb4ad44d4839d9aefd31b4bcefc44f316 ARTIFACT_NAME: alfresco-docker-images + REGISTRY: ghcr.io + TAG: ${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }} @@ -67,6 +69,13 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} + - name: Log in to the Container registry + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Collect Workflow Telemetry uses: catchpoint/workflow-telemetry-action@v2 with: @@ -78,41 +87,21 @@ jobs: - name: Show all built images run: docker images - - name: Docker save all baked images whose name include `alfresco` - run: | - docker save -o /tmp/${{ env.ARTIFACT_NAME }}.tar $(docker images --format "{{.Repository}}:{{.Tag}}" | grep alfresco) - - - name: Check disk space - run: df -h - if: always() - - - name: Upload images as artifact - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: ${{ env.ARTIFACT_NAME }} - path: /tmp/${{ env.ARTIFACT_NAME }}.tar - retention-days: 1 - compression-level: 0 - compose-test: name: compose-test needs: build-test runs-on: ubuntu-latest steps: + - name: Log in to the Container registry + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 - - name: Download artifacts - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - path: /tmp - name: ${{ env.ARTIFACT_NAME }} - - - name: Load Docker images - run: | - docker load -i /tmp/${{ env.ARTIFACT_NAME }}.tar - docker image ls -a - - name: Verify docker-compose uses: Alfresco/alfresco-build-tools/.github/actions/dbp-charts/verify-compose@v6.0.1 timeout-minutes: 10 @@ -130,22 +119,12 @@ jobs: needs: build-test runs-on: alfrescoPub-ubuntu2204-16G-4CPU steps: - - name: Download artifacts - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - path: /tmp - name: ${{ env.ARTIFACT_NAME }} - - name: Setup cluster uses: Alfresco/alfresco-build-tools/.github/actions/setup-kind@v5.35.0 with: ingress-nginx-ref: controller-v1.8.2 metrics: "true" - - name: Load Docker images - run: | - kind load image-archive -n chart-testing /tmp/${{ env.ARTIFACT_NAME }}.tar - - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -160,6 +139,13 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} + - name: Log in to the Container registry + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create registries auth secret run: >- kubectl create secret generic regcred @@ -182,6 +168,14 @@ jobs: helm repo add elastic https://helm.elastic.co helm dependency build + - name: Preprocess test-overrides.yaml + env: + OVERRIDES_VALUES_FILE: test/helm/test-overrides.yaml + run: | + sed -i "s|localhost/|${REGISTRY}/|g" ${{ env.OVERRIDES_VALUES_FILE }} + sed -i "s|tag: latest|tag: ${TAG}|g" ${{ env.OVERRIDES_VALUES_FILE }} + cat ${{ env.OVERRIDES_VALUES_FILE }} + - name: Helm install id: helm_install run: | diff --git a/docker-bake.hcl b/docker-bake.hcl index 96a1e7de..71422790 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -22,6 +22,14 @@ group "connectors" { targets = ["connector_msteams", "connector_ms365"] } +variable "REGISTRY" { + default = "localhost" +} + +variable "TAG" { + default = "latest" +} + variable "LABEL_VENDOR" { default = "Hyland Software, Inc." } @@ -121,7 +129,7 @@ target "java_base" { "org.opencontainers.image.source" = "$LABEL_SOURCE" "org.opencontainers.image.authors" = "${LABEL_AUTHOR}" } - tags = ["localhost/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] + tags = ["${REGISTRY}/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] } @@ -164,7 +172,7 @@ target "tomcat_base" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Tomcat" "org.opencontainers.image.description" = "A base image shipping Tomcat for Alfresco Products" } - tags = ["localhost/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] + tags = ["${REGISTRY}/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] } @@ -185,7 +193,7 @@ target "repository" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Content Repository" "org.opencontainers.image.description" = "Alfresco Content Services Repository" } - tags = ["localhost/alfresco-content-repository:latest"] + tags = ["${REGISTRY}/alfresco-content-repository:${TAG}"] output = ["type=docker"] } @@ -224,7 +232,7 @@ target "search_liveindexing" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name}" "org.opencontainers.image.description" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name} live indexing" } - tags = ["localhost/${liveindexing.artifact}:latest"] + tags = ["${REGISTRY}/${liveindexing.artifact}:${TAG}"] output = ["type=docker"] } @@ -253,7 +261,7 @@ target "ats_trouter" { "org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Trouter" "org.opencontainers.image.description" = "Alfresco Transform Service Trouter" } - tags = ["localhost/alfresco-transform-router:latest"] + tags = ["${REGISTRY}/alfresco-transform-router:${TAG}"] output = ["type=docker"] } @@ -282,7 +290,7 @@ target "ats_sfs" { "org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Shared File Store" "org.opencontainers.image.description" = "Alfresco Transform Service ATS Shared File Store" } - tags = ["localhost/alfresco-shared-file-store:latest"] + tags = ["${REGISTRY}/alfresco-shared-file-store:${TAG}"] output = ["type=docker"] } @@ -311,7 +319,7 @@ target "tengine_imagemagick" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Imagemagick" "org.opencontainers.image.description" = "Alfresco Transform Engine Imagemagick" } - tags = ["localhost/alfresco-imagemagick:latest"] + tags = ["${REGISTRY}/alfresco-imagemagick:${TAG}"] output = ["type=docker"] } @@ -340,7 +348,7 @@ target "tengine_libreoffice" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine LibreOffice" "org.opencontainers.image.description" = "Alfresco Transform Engine LibreOffice" } - tags = ["localhost/alfresco-libreoffice:latest"] + tags = ["${REGISTRY}/alfresco-libreoffice:${TAG}"] output = ["type=docker"] } @@ -369,7 +377,7 @@ target "tengine_misc" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Misc" "org.opencontainers.image.description" = "Alfresco Transform Engine Misc" } - tags = ["localhost/alfresco-misc:latest"] + tags = ["${REGISTRY}/alfresco-misc:${TAG}"] output = ["type=docker"] } @@ -398,7 +406,7 @@ target "tengine_tika" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Tika" "org.opencontainers.image.description" = "Alfresco Transform Engine Tika" } - tags = ["localhost/alfresco-tika:latest"] + tags = ["${REGISTRY}/alfresco-tika:${TAG}"] output = ["type=docker"] } @@ -427,7 +435,7 @@ target "tengine_pdfrenderer" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine PDF Renderer" "org.opencontainers.image.description" = "Alfresco Transform Engine PDF Renderer" } - tags = ["localhost/alfresco-pdf-renderer:latest"] + tags = ["${REGISTRY}/alfresco-pdf-renderer:${TAG}"] output = ["type=docker"] } @@ -456,7 +464,7 @@ target "tengine_aio" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine All In One" "org.opencontainers.image.description" = "Alfresco Transform Engine All In One" } - tags = ["localhost/alfresco-transform-core-aio:latest"] + tags = ["${REGISTRY}/alfresco-transform-core-aio:${TAG}"] output = ["type=docker"] } diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 21c1b5dd..3ae4c23a 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -2,7 +2,7 @@ version: "2" services: alfresco: - image: localhost/alfresco-content-repository:latest + image: ${REGISTRY}/alfresco-content-repository:${TAG} mem_limit: 1900m environment: JAVA_TOOL_OPTIONS: >- @@ -50,7 +50,7 @@ services: start_period: 1m transform-router: mem_limit: 512m - image: localhost/alfresco-transform-router:latest + image: ${REGISTRY}/alfresco-transform-router:${TAG} environment: ACTIVEMQ_URL: nio://activemq:61616 CORE_AIO_URL: http://transform-core-aio:8090 @@ -61,7 +61,7 @@ services: depends_on: - activemq transform-core-aio: - image: localhost/alfresco-transform-core-aio:latest + image: ${REGISTRY}/alfresco-transform-core-aio:${TAG} mem_limit: 1536m environment: JAVA_OPTS: >- @@ -75,7 +75,7 @@ services: depends_on: - activemq shared-file-store: - image: localhost/alfresco-shared-file-store:latest + image: ${REGISTRY}/alfresco-shared-file-store:${TAG} mem_limit: 512m environment: scheduler.content.age.millis: 86400000 @@ -177,7 +177,7 @@ services: ports: - "9090:9090" live-indexing: - image: localhost/alfresco-elasticsearch-live-indexing:latest + image: ${REGISTRY}/alfresco-elasticsearch-live-indexing:${TAG} environment: SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200 SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616 From a7d44939343c4a242b8a91eecfa05e0928434063 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 16:36:02 +0200 Subject: [PATCH 02/10] with push --- .github/workflows/build_and_test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 26ea2225..ebbacfd1 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -26,7 +26,12 @@ concurrency: permissions: contents: read + # telemetry actions: read + # ghcr push + packages: write + attestations: write + id-token: write jobs: pre-commit: @@ -83,6 +88,8 @@ jobs: - name: Bake Docker images uses: docker/bake-action@a4d7f0b5b91c14a296d792d4ec53a9db17f02e67 # v5.5.0 + with: + push: true - name: Show all built images run: docker images From 8d646b91a4ad4bf2b284470ec047cbdde823a0e9 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 16:45:11 +0200 Subject: [PATCH 03/10] fixup tags --- docker-bake.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 71422790..98d1786b 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -493,7 +493,7 @@ target "connector_msteams" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Connector Microsoft Teams" "org.opencontainers.image.description" = "Alfresco Connector Microsoft Teams" } - tags = ["localhost/alfresco-ms-teams-service:latest"] + tags = ["${REGISTRY}/alfresco-ms-teams-service:${TAG}"] output = ["type=docker"] } @@ -522,6 +522,6 @@ target "connector_ms365" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Microsoft 365 Connector" "org.opencontainers.image.description" = "Alfresco Microsoft 365 Connector" } - tags = ["localhost/alfresco-ooi-service:latest"] + tags = ["${REGISTRY}/alfresco-ooi-service:${TAG}"] output = ["type=docker"] } From d8718209f3ba7caba5b8abf0de6e893a26e3529a Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 17:02:16 +0200 Subject: [PATCH 04/10] test cache --- .github/workflows/build_and_test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ebbacfd1..6048a49c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -58,9 +58,27 @@ jobs: echo "login ${{ secrets.NEXUS_USERNAME }}" >> ~/.netrc echo "password ${{ secrets.NEXUS_PASSWORD }}" >> ~/.netrc + - name: Restore packages artifacts + uses: actions/cache/restore@v4 + id: artifacts-cache + with: + key: ${{ runner.os }}-packages-${{ hashFiles('**/artifacts.json') }} + path: | + **/*.jar + **/*.zip + - name: Fetch artifacts from nexus run: ./scripts/fetch-artifacts.sh + - name: Save packages artifacts + id: cache-primes-save + uses: actions/cache/save@v4 + with: + path: | + **/*.jar + **/*.zip + key: ${{ steps.artifacts-cache.outputs.cache-primary-key }} + - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 From 992debf3ce49bf2edf54e15344c53ab7ad298405 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 17:02:36 +0200 Subject: [PATCH 05/10] add missing namespace --- .github/workflows/build_and_test.yml | 1 + docker-bake.hcl | 32 ++++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6048a49c..98e1b9b6 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -18,6 +18,7 @@ env: ACS_CHART_VERSION: 172410cfb4ad44d4839d9aefd31b4bcefc44f316 ARTIFACT_NAME: alfresco-docker-images REGISTRY: ghcr.io + REGISTRY_NAMESPACE: Alfresco TAG: ${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} concurrency: diff --git a/docker-bake.hcl b/docker-bake.hcl index 98d1786b..3c6887b6 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -26,6 +26,10 @@ variable "REGISTRY" { default = "localhost" } +variable "REGISTRY_NAMESPACE" { + default = "Alfresco" +} + variable "TAG" { default = "latest" } @@ -129,7 +133,7 @@ target "java_base" { "org.opencontainers.image.source" = "$LABEL_SOURCE" "org.opencontainers.image.authors" = "${LABEL_AUTHOR}" } - tags = ["${REGISTRY}/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] } @@ -172,7 +176,7 @@ target "tomcat_base" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Tomcat" "org.opencontainers.image.description" = "A base image shipping Tomcat for Alfresco Products" } - tags = ["${REGISTRY}/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] } @@ -193,7 +197,7 @@ target "repository" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Content Repository" "org.opencontainers.image.description" = "Alfresco Content Services Repository" } - tags = ["${REGISTRY}/alfresco-content-repository:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-content-repository:${TAG}"] output = ["type=docker"] } @@ -232,7 +236,7 @@ target "search_liveindexing" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name}" "org.opencontainers.image.description" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name} live indexing" } - tags = ["${REGISTRY}/${liveindexing.artifact}:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/${liveindexing.artifact}:${TAG}"] output = ["type=docker"] } @@ -261,7 +265,7 @@ target "ats_trouter" { "org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Trouter" "org.opencontainers.image.description" = "Alfresco Transform Service Trouter" } - tags = ["${REGISTRY}/alfresco-transform-router:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-transform-router:${TAG}"] output = ["type=docker"] } @@ -290,7 +294,7 @@ target "ats_sfs" { "org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Shared File Store" "org.opencontainers.image.description" = "Alfresco Transform Service ATS Shared File Store" } - tags = ["${REGISTRY}/alfresco-shared-file-store:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-shared-file-store:${TAG}"] output = ["type=docker"] } @@ -319,7 +323,7 @@ target "tengine_imagemagick" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Imagemagick" "org.opencontainers.image.description" = "Alfresco Transform Engine Imagemagick" } - tags = ["${REGISTRY}/alfresco-imagemagick:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-imagemagick:${TAG}"] output = ["type=docker"] } @@ -348,7 +352,7 @@ target "tengine_libreoffice" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine LibreOffice" "org.opencontainers.image.description" = "Alfresco Transform Engine LibreOffice" } - tags = ["${REGISTRY}/alfresco-libreoffice:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-libreoffice:${TAG}"] output = ["type=docker"] } @@ -377,7 +381,7 @@ target "tengine_misc" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Misc" "org.opencontainers.image.description" = "Alfresco Transform Engine Misc" } - tags = ["${REGISTRY}/alfresco-misc:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-misc:${TAG}"] output = ["type=docker"] } @@ -406,7 +410,7 @@ target "tengine_tika" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Tika" "org.opencontainers.image.description" = "Alfresco Transform Engine Tika" } - tags = ["${REGISTRY}/alfresco-tika:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-tika:${TAG}"] output = ["type=docker"] } @@ -435,7 +439,7 @@ target "tengine_pdfrenderer" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine PDF Renderer" "org.opencontainers.image.description" = "Alfresco Transform Engine PDF Renderer" } - tags = ["${REGISTRY}/alfresco-pdf-renderer:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-pdf-renderer:${TAG}"] output = ["type=docker"] } @@ -464,7 +468,7 @@ target "tengine_aio" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine All In One" "org.opencontainers.image.description" = "Alfresco Transform Engine All In One" } - tags = ["${REGISTRY}/alfresco-transform-core-aio:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-transform-core-aio:${TAG}"] output = ["type=docker"] } @@ -493,7 +497,7 @@ target "connector_msteams" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Connector Microsoft Teams" "org.opencontainers.image.description" = "Alfresco Connector Microsoft Teams" } - tags = ["${REGISTRY}/alfresco-ms-teams-service:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-ms-teams-service:${TAG}"] output = ["type=docker"] } @@ -522,6 +526,6 @@ target "connector_ms365" { "org.opencontainers.image.title" = "${PRODUCT_LINE} Microsoft 365 Connector" "org.opencontainers.image.description" = "Alfresco Microsoft 365 Connector" } - tags = ["${REGISTRY}/alfresco-ooi-service:${TAG}"] + tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-ooi-service:${TAG}"] output = ["type=docker"] } From c113110a65cc9e15c7aafa1d0eb3fed2dee62c78 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 17:12:53 +0200 Subject: [PATCH 06/10] add missing cache extensions --- .github/workflows/build_and_test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 98e1b9b6..52415b22 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -67,6 +67,10 @@ jobs: path: | **/*.jar **/*.zip + **/*.amp + **/*.tgz + **/*.gz + **/*.rpm - name: Fetch artifacts from nexus run: ./scripts/fetch-artifacts.sh @@ -75,10 +79,14 @@ jobs: id: cache-primes-save uses: actions/cache/save@v4 with: + key: ${{ steps.artifacts-cache.outputs.cache-primary-key }} path: | **/*.jar **/*.zip - key: ${{ steps.artifacts-cache.outputs.cache-primary-key }} + **/*.amp + **/*.tgz + **/*.gz + **/*.rpm - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 From fc603d93abd4b96ab0a5f7293f1a25032af3a9cb Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 17:13:44 +0200 Subject: [PATCH 07/10] lowercase namespace --- .github/workflows/build_and_test.yml | 2 +- docker-bake.hcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 52415b22..a3c0662e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -18,7 +18,7 @@ env: ACS_CHART_VERSION: 172410cfb4ad44d4839d9aefd31b4bcefc44f316 ARTIFACT_NAME: alfresco-docker-images REGISTRY: ghcr.io - REGISTRY_NAMESPACE: Alfresco + REGISTRY_NAMESPACE: alfresco TAG: ${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} concurrency: diff --git a/docker-bake.hcl b/docker-bake.hcl index 3c6887b6..b5995966 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -27,7 +27,7 @@ variable "REGISTRY" { } variable "REGISTRY_NAMESPACE" { - default = "Alfresco" + default = "alfresco" } variable "TAG" { From de69be9f5c196deedf255901c9a4096004c72a05 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 17:25:48 +0200 Subject: [PATCH 08/10] fixup compose? --- .github/workflows/build_and_test.yml | 1 - test/docker-compose.yml | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index a3c0662e..b5891446 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -140,7 +140,6 @@ jobs: uses: Alfresco/alfresco-build-tools/.github/actions/dbp-charts/verify-compose@v6.0.1 timeout-minutes: 10 with: - compose_pull: false compose_file_path: test/docker-compose.yml quay_username: ${{ secrets.QUAY_USERNAME }} quay_password: ${{ secrets.QUAY_PASSWORD }} diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 3ae4c23a..ab3dfc89 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -2,7 +2,7 @@ version: "2" services: alfresco: - image: ${REGISTRY}/alfresco-content-repository:${TAG} + image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-content-repository:${TAG} mem_limit: 1900m environment: JAVA_TOOL_OPTIONS: >- @@ -50,7 +50,7 @@ services: start_period: 1m transform-router: mem_limit: 512m - image: ${REGISTRY}/alfresco-transform-router:${TAG} + image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-transform-router:${TAG} environment: ACTIVEMQ_URL: nio://activemq:61616 CORE_AIO_URL: http://transform-core-aio:8090 @@ -61,7 +61,7 @@ services: depends_on: - activemq transform-core-aio: - image: ${REGISTRY}/alfresco-transform-core-aio:${TAG} + image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-transform-core-aio:${TAG} mem_limit: 1536m environment: JAVA_OPTS: >- @@ -75,7 +75,7 @@ services: depends_on: - activemq shared-file-store: - image: ${REGISTRY}/alfresco-shared-file-store:${TAG} + image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-shared-file-store:${TAG} mem_limit: 512m environment: scheduler.content.age.millis: 86400000 @@ -177,7 +177,7 @@ services: ports: - "9090:9090" live-indexing: - image: ${REGISTRY}/alfresco-elasticsearch-live-indexing:${TAG} + image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-elasticsearch-live-indexing:${TAG} environment: SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200 SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616 From 523b9ffdba29689b5dc8fb09e47964e962c6191f Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 13 Aug 2024 17:27:00 +0200 Subject: [PATCH 09/10] fixup helm? --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b5891446..7b4be877 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -205,7 +205,7 @@ jobs: env: OVERRIDES_VALUES_FILE: test/helm/test-overrides.yaml run: | - sed -i "s|localhost/|${REGISTRY}/|g" ${{ env.OVERRIDES_VALUES_FILE }} + sed -i "s|localhost/|${REGISTRY}/${REGISTRY_NAMESPACE}/|g" ${{ env.OVERRIDES_VALUES_FILE }} sed -i "s|tag: latest|tag: ${TAG}|g" ${{ env.OVERRIDES_VALUES_FILE }} cat ${{ env.OVERRIDES_VALUES_FILE }} From e8a61668b6240ee47977d70f4bf9147dcf473a68 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Mon, 19 Aug 2024 09:29:19 +0200 Subject: [PATCH 10/10] push a cleaner tag --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 7b4be877..d037cbcc 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -19,7 +19,7 @@ env: ARTIFACT_NAME: alfresco-docker-images REGISTRY: ghcr.io REGISTRY_NAMESPACE: alfresco - TAG: ${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + TAG: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.sha }} concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }}