diff --git a/.github/updatecli.tpl b/.github/updatecli.tpl new file mode 100644 index 00000000..995c76e0 --- /dev/null +++ b/.github/updatecli.tpl @@ -0,0 +1,34 @@ +name: Update Artifacts for {{ .updatecli_matrix_version }} version using reusable matrix + +sources: +{{- range $key, $artifact := .artifacts }} + {{- if $artifact.updatecli_matrix_component_key }} + src_{{ $key }}: + name: {{ $artifact.name }} + kind: maven + spec: + repository: {{ requiredEnv "NEXUS_USERNAME" }}:{{ requiredEnv "NEXUS_PASSWORD" }}@nexus.alfresco.com/nexus/repository/{{ $artifact.repository }} + groupid: {{ $artifact.group }} + artifactid: {{ $artifact.name}} + {{- $matrix_filter := index $ "matrix" $.updatecli_matrix_version $artifact.updatecli_matrix_component_key }} + {{- if $matrix_filter }} + versionFilter: + kind: regex + pattern: >- + ^{{ index $matrix_filter "version" }}{{ index $matrix_filter "pattern" }}$ + {{- end }} + {{- end }} +{{- end }} + +targets: +{{- range $key, $artifact := .artifacts }} + {{- if $artifact.updatecli_matrix_component_key }} + yml_{{ $key }}: + name: {{ $artifact.name }} yml + kind: yaml + sourceid: src_{{ $key }} + spec: + file: "{{ $.updatecli_self }}" + key: "$.artifacts.{{ $key }}.version" + {{- end }} +{{- end }} diff --git a/.github/updatecli_amps.tpl b/.github/updatecli_amps.tpl new file mode 100644 index 00000000..96da8b88 --- /dev/null +++ b/.github/updatecli_amps.tpl @@ -0,0 +1,53 @@ +name: Update AMPs artifacts for {{ .updatecli_matrix_version }} version using acs-packaging repository + +scms: + acsPackaging: + kind: github + spec: + owner: Alfresco + repository: acs-packaging + branch: {{ .updatecli_release_branch }} + token: {{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }} + username: {{ requiredEnv "UPDATECLI_GITHUB_USERNAME" }} + acsEntRepo: + kind: github + spec: + owner: Alfresco + repository: alfresco-enterprise-repo + branch: {{ .updatecli_release_branch }} + token: {{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }} + username: {{ requiredEnv "UPDATECLI_GITHUB_USERNAME" }} + acsComRepo: + kind: github + spec: + owner: Alfresco + repository: alfresco-community-repo + branch: {{ .updatecli_release_branch }} + token: {{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }} + username: {{ requiredEnv "UPDATECLI_GITHUB_USERNAME" }} + +sources: +{{- range $key, $artifact := .artifacts }} + {{- if $artifact.updatecli_xml_target }} + src_{{ $key }}: + name: {{ $artifact.name }} + scmid: {{ $artifact.updatecli_scm_id }} + kind: xml + spec: + file: pom.xml + path: "{{ $artifact.updatecli_xml_target }}" + {{- end }} +{{- end }} + +targets: +{{- range $key, $artifact := .artifacts }} + {{- if $artifact.updatecli_xml_target }} + yml_{{ $key }}: + name: {{ $artifact.name }} yml + kind: yaml + sourceid: src_{{ $key }} + spec: + file: "{{ $.updatecli_self }}" + key: "$.artifacts.{{ $key }}.version" + {{- end }} +{{- end }} diff --git a/.github/updatecli_amps_values.yaml b/.github/updatecli_amps_values.yaml new file mode 100644 index 00000000..cc8706e0 --- /dev/null +++ b/.github/updatecli_amps_values.yaml @@ -0,0 +1,14 @@ +--- +artifacts: + alfresco-share-services: + updatecli_scm_id: acsEntRepo + updatecli_xml_target: "/project/properties/dependency.alfresco-community-repo.version" + alfresco-aos-module: + updatecli_scm_id: acsComRepo + updatecli_xml_target: "/project/properties/alfresco.aos-module.version" + alfresco-device-sync-repo: + updatecli_scm_id: acsPackaging + updatecli_xml_target: "/project/properties/alfresco.desktop-sync.version" + alfresco-googledrive-repo-enterprise: + updatecli_scm_id: acsComRepo + updatecli_xml_target: "/project/properties/alfresco.googledrive.version" diff --git a/.github/workflows/bumpVersions.yml b/.github/workflows/bumpVersions.yml new file mode 100644 index 00000000..07d670c2 --- /dev/null +++ b/.github/workflows/bumpVersions.yml @@ -0,0 +1,68 @@ +--- +name: Bump versions +run-name: Bump using alfresco-updatecli/${{ inputs.alfresco-updatecli-ref || 'master' }} + +on: + push: + paths: + - .github/workflows/bumpVersions.yml + - .github/updatecli.tpl + - .github/updatecli_amps.tpl + - .github/updatecli_amps_values.yaml + workflow_dispatch: + inputs: + alfresco-updatecli-ref: + description: "The version to use for alfresco/alfresco-updatecli configs" + type: string + default: master + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }} + cancel-in-progress: true + +env: + DEFAULT_BRANCH_NAME: main + +jobs: + build: + runs-on: ubuntu-latest + name: Bump versions + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + token: ${{ secrets.BOT_GITHUB_TOKEN }} + + - name: Install Updatecli + uses: updatecli/updatecli-action@11d8c3e7c4dbb188d9534e599db759e418911828 # v2.73.0 + + - name: Checkout updatecli configs + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: alfresco/alfresco-updatecli + ref: ${{ inputs.alfresco-updatecli-ref || 'master' }} + path: alfresco-updatecli + + - name: Updatecli apply + shell: bash + run: | + for i in */artifacts-*.yaml; do + updatecli apply -c .github/updatecli.tpl -v ${i} -v alfresco-updatecli/deployments/values/supported-matrix.yaml + updatecli apply -c .github/updatecli_amps.tpl -v ${i} -v .github/updatecli_amps_values.yaml + done + env: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + UPDATECLI_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + UPDATECLI_GITHUB_USERNAME: ${{ vars.BOT_GITHUB_USERNAME}} + + - name: Git Auto Commit + uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 + with: + commit_message: | + 🛠 Updatecli pipeline artifacts bump + commit_user_name: ${{ vars.BOT_GITHUB_USERNAME }} + commit_user_email: ${{ vars.BOT_GITHUB_EMAIL }} + branch: ${{ github.ref_name == env.DEFAULT_BRANCH_NAME && 'updatecli-bump-versions' || github.ref_name }} + create_branch: ${{ github.ref_name == env.DEFAULT_BRANCH_NAME }} + push_options: ${{ github.ref_name == env.DEFAULT_BRANCH_NAME && '--force' || '' }} diff --git a/.gitignore b/.gitignore index f6c6333f..e7de57d4 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ test/7.4.N-compose.yaml test/helm/enterprise-integration-test-values.yaml test/helm/community-integration-test-values.yaml test/helm/community_values.yaml + +# CI/CD +alfresco-updatecli diff --git a/repository/artifacts-23.yaml b/repository/artifacts-23.yaml index 2875978c..bf463ab8 100644 --- a/repository/artifacts-23.yaml +++ b/repository/artifacts-23.yaml @@ -1,4 +1,7 @@ --- +updatecli_self: repository/artifacts-23.yaml +updatecli_matrix_version: current +updatecli_release_branch: release/23.3 artifacts: postgresql: name: postgresql @@ -9,7 +12,7 @@ artifacts: path: repository/libs alfresco-share-services: name: alfresco-share-services - version: 23.3.1.3 + version: 23.3.1.4 path: repository/amps classifier: ".amp" group: org.alfresco @@ -23,7 +26,7 @@ artifacts: repository: releases alfresco-device-sync-repo: name: alfresco-device-sync-repo - version: 4.0.1 + version: 4.0.0 path: repository/amps_enterprise classifier: ".amp" group: org.alfresco.services.sync @@ -42,6 +45,7 @@ artifacts: classifier: ".zip" group: org.alfresco repository: enterprise-releases + updatecli_matrix_component_key: acs alfresco-content-services-community-distribution: name: alfresco-content-services-community-distribution version: 23.3.0 @@ -49,3 +53,4 @@ artifacts: classifier: ".zip" group: org.alfresco repository: public + updatecli_matrix_component_key: acs diff --git a/repository/artifacts-73.yaml b/repository/artifacts-73.yaml index 75503434..c8dceeef 100644 --- a/repository/artifacts-73.yaml +++ b/repository/artifacts-73.yaml @@ -1,4 +1,7 @@ --- +updatecli_self: repository/artifacts-73.yaml +updatecli_matrix_version: 7.3.N +updatecli_release_branch: release/7.3.2 artifacts: postgresql: name: postgresql @@ -9,7 +12,7 @@ artifacts: path: repository/libs alfresco-share-services: name: alfresco-share-services - version: '19.15' + version: 19.29 path: repository/amps classifier: ".amp" group: org.alfresco @@ -30,18 +33,19 @@ artifacts: repository: enterprise-releases alfresco-googledrive-repo-enterprise: name: alfresco-googledrive-repo-enterprise - version: 3.3.1 + version: 3.4.2 path: repository/amps_enterprise classifier: ".amp" group: org.alfresco.integrations repository: enterprise-releases alfresco-content-services-distribution: name: alfresco-content-services-distribution - version: 7.3.2.1 + version: 7.3.2.3 path: repository/distribution classifier: ".zip" group: org.alfresco repository: enterprise-releases + updatecli_matrix_component_key: acs alfresco-content-services-community-distribution: name: alfresco-content-services-community-distribution version: 7.3.2 @@ -49,3 +53,4 @@ artifacts: classifier: ".zip" group: org.alfresco repository: public + updatecli_matrix_component_key: acs diff --git a/repository/artifacts-74.yaml b/repository/artifacts-74.yaml index 4458552f..75aefd1e 100644 --- a/repository/artifacts-74.yaml +++ b/repository/artifacts-74.yaml @@ -1,4 +1,7 @@ --- +updatecli_self: repository/artifacts-74.yaml +updatecli_matrix_version: 7.4.N +updatecli_release_branch: release/7.4.2 artifacts: postgresql: name: postgresql @@ -9,14 +12,14 @@ artifacts: path: repository/libs alfresco-share-services: name: alfresco-share-services - version: '22.23' + version: 22.32 path: repository/amps classifier: ".amp" group: org.alfresco repository: releases alfresco-aos-module: name: alfresco-aos-module - version: 1.6.3 + version: 1.6.2 path: repository/amps classifier: ".amp" group: org.alfresco.aos-module @@ -37,11 +40,12 @@ artifacts: repository: enterprise-releases alfresco-content-services-distribution: name: alfresco-content-services-distribution - version: 7.4.2.1 + version: 7.4.2.4 path: repository/distribution classifier: ".zip" group: org.alfresco repository: enterprise-releases + updatecli_matrix_component_key: acs alfresco-content-services-community-distribution: name: alfresco-content-services-community-distribution version: 7.4.2 @@ -49,3 +53,4 @@ artifacts: classifier: ".zip" group: org.alfresco repository: public + updatecli_matrix_component_key: acs diff --git a/test/helm/test-overrides-73.yaml b/test/helm/test-overrides-73.yaml index e9d2d83c..8982b5eb 100644 --- a/test/helm/test-overrides-73.yaml +++ b/test/helm/test-overrides-73.yaml @@ -17,7 +17,7 @@ dtas: version: 7.3.2 modules: - id: org.alfresco.integrations.google.docs - version: 3.3.1 + version: 3.4.2 installed: true - id: alfresco-aos-module version: 1.5.0 diff --git a/test/helm/test-overrides-74.yaml b/test/helm/test-overrides-74.yaml index 0f2475ca..2ea55065 100644 --- a/test/helm/test-overrides-74.yaml +++ b/test/helm/test-overrides-74.yaml @@ -20,5 +20,5 @@ dtas: version: 3.4.2 installed: true - id: alfresco-aos-module - version: 1.6.3 + version: 1.6.2 installed: true