-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
96 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,22 @@ on: | |
env: | ||
ACS_CHART_VERSION: 172410cfb4ad44d4839d9aefd31b4bcefc44f316 | ||
ARTIFACT_NAME: alfresco-docker-images | ||
REGISTRY: ghcr.io | ||
REGISTRY_NAMESPACE: alfresco | ||
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 }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
# telemetry | ||
actions: read | ||
# ghcr push | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
jobs: | ||
pre-commit: | ||
|
@@ -51,9 +59,35 @@ 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 | ||
**/*.amp | ||
**/*.tgz | ||
**/*.gz | ||
**/*.rpm | ||
- name: Fetch artifacts from nexus | ||
run: ./scripts/fetch-artifacts.sh | ||
|
||
- name: Save packages artifacts | ||
id: cache-primes-save | ||
uses: actions/cache/save@v4 | ||
with: | ||
key: ${{ steps.artifacts-cache.outputs.cache-primary-key }} | ||
path: | | ||
**/*.jar | ||
**/*.zip | ||
**/*.amp | ||
**/*.tgz | ||
**/*.gz | ||
**/*.rpm | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | ||
|
||
|
@@ -67,57 +101,45 @@ 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: | ||
comment_on_pr: false | ||
|
||
- name: Bake Docker images | ||
uses: docker/bake-action@a4d7f0b5b91c14a296d792d4ec53a9db17f02e67 # v5.5.0 | ||
with: | ||
push: true | ||
|
||
- 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/[email protected] | ||
timeout-minutes: 10 | ||
with: | ||
compose_pull: false | ||
compose_file_path: test/docker-compose.yml | ||
quay_username: ${{ secrets.QUAY_USERNAME }} | ||
quay_password: ${{ secrets.QUAY_PASSWORD }} | ||
|
@@ -130,22 +152,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/[email protected] | ||
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 +172,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 +201,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}/${REGISTRY_NAMESPACE}/|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: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters