From 38652c5e2a7559fea24157c70e021f83df176ed3 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Tue, 4 Jul 2023 09:39:28 +0200 Subject: [PATCH] OPSEXP-2173 Add updatecli pipeline to bump acs components (#60) --- .github/workflows/updatecli.yaml | 53 ++++++++++++++++++++++++++++++-- .gitignore | 4 +++ .pre-commit-config.yaml | 1 + matrix-targets.yaml | 49 +++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 matrix-targets.yaml diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index 2f15e4f5..578f8ae4 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -12,7 +12,7 @@ permissions: contents: write jobs: - bump: + bump-helm-dependencies: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -38,6 +38,55 @@ jobs: with: commit_message: | 🛠 Updatecli pipeline bump - branch: ${{ github.event_name == 'workflow_dispatch' && 'updatecli-bump' || '' }} + branch: ${{ github.event_name == 'workflow_dispatch' && 'updatecli-bump-helm' || '' }} + create_branch: ${{ github.event_name == 'workflow_dispatch' }} + push_options: ${{ github.event_name == 'workflow_dispatch' && '--force' || '' }} + + bump-acs-dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + + - uses: >- + Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v1.41.0 + + - name: Login to quay.io + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Install Updatecli + uses: updatecli/updatecli-action@v2 + with: + version: v0.54.0 + + - name: Checkout updatecli configs + uses: actions/checkout@v3 + with: + repository: alfresco/alfresco-updatecli + ref: master + path: alfresco-updatecli + + - name: Preprocess values file appending existing keys only + run: yq '. *? load("alfresco-updatecli/deployments/values/supported-matrix.yaml") | explode(.)' matrix-targets.yaml | tee ./merged.yaml + + - name: updatecli apply + # path to values file must be relative https://github.com/updatecli/updatecli/issues/1253 + run: updatecli apply -c alfresco-updatecli/deployments/uber-manifest.tpl -v ./merged.yaml + env: + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + UPDATECLI_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + + - name: Git Auto Commit + uses: stefanzweifel/git-auto-commit-action@v4.16.0 + with: + commit_message: | + 🛠 Updatecli pipeline acs bump + branch: ${{ github.event_name == 'workflow_dispatch' && 'updatecli-bump-acs' || '' }} create_branch: ${{ github.event_name == 'workflow_dispatch' }} push_options: ${{ github.event_name == 'workflow_dispatch' && '--force' || '' }} diff --git a/.gitignore b/.gitignore index b1359bd8..6100e8fe 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ *.tgz .idea .DS_Store + +# Github workflows related +merged.yaml +alfresco/alfresco-updatecli diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6568d5e..b8906177 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,7 @@ repos: args: ["--fix=lf"] - id: end-of-file-fixer exclude: README.md + - id: trailing-whitespace - repo: https://github.com/norwoodj/helm-docs rev: v1.11.0 hooks: diff --git a/matrix-targets.yaml b/matrix-targets.yaml new file mode 100644 index 00000000..7e530524 --- /dev/null +++ b/matrix-targets.yaml @@ -0,0 +1,49 @@ +--- +# yaml-language-server: $schema=./matrix-targets.yaml +# This file is meant to be used with updatecli uber-manifest pipeline +# https://github.com/Alfresco/alfresco-updatecli/tree/master/deployments +matrix: + latest: + id: latest + search: + version: + pattern: + image: + helm_target: >- + charts/alfresco-search-services/values.yaml + helm_keys: + search: searchServicesImage.tag + insight: insightEngineImage.tag + search-enterprise: + version: + pattern: + helm_target: >- + charts/alfresco-search-enterprise/values.yaml + helm_keys: + Reindexing: reindexing.image.tag + Liveindexing: + Mediation: liveIndexing.mediation.image.tag + Content: liveIndexing.content.image.tag + Metadata: liveIndexing.metadata.image.tag + Path: liveIndexing.path.image.tag + sync: + version: + pattern: + helm_target: >- + charts/alfresco-sync-service/values.yaml + helm_key: image.tag + onedrive: + version: + pattern: + helm_target: charts/alfresco-connector-ms365/values.yaml + helm_key: image.tag + msteams: + version: + pattern: + helm_target: charts/alfresco-connector-msteams/values.yaml + helm_key: image.tag + intelligence: + version: + pattern: + helm_target: charts/alfresco-ai-transformer/values.yaml + helm_key: image.tag