diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 0cae9768f..8e39c29a9 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,3 +1,4 @@ +--- name: verify on: pull_request: @@ -14,10 +15,11 @@ jobs: - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v1.14.0 - uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.14.0 helm: - needs: [pre-commit] + needs: + - pre-commit if: '! github.event.pull_request.head.repo.fork' strategy: - max-parallel: 1 # otherwise flaky problems with aws ELB + max-parallel: 1 # otherwise flaky problems with aws ELB fail-fast: false matrix: acs_version: @@ -72,9 +74,17 @@ jobs: quay_username: ${{ secrets.QUAY_USERNAME }} quay_password: ${{ secrets.QUAY_PASSWORD }} publish: - needs: [ compose, helm ] - if: github.event.head_commit.message == '[publish]' + if: contains(github.event.head_commit.message, '[publish]') + needs: + - helm runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 1 + matrix: + chart: + - alfresco-common + - alfresco-content-services steps: - name: Evalute type of release id: release @@ -90,6 +100,6 @@ jobs: github_token: ${{ secrets.BOT_GITHUB_TOKEN }} github_username: ${{ secrets.BOT_GITHUB_USERNAME }} github_email: ${{ secrets.BOT_GITHUB_EMAIL }} - chart_name: 'alfresco-content-services' + chart_name: ${{ matrix.chart }} chart_repo: 'Alfresco/acs-deployment' release_type: ${{ steps.release.outputs.type }} diff --git a/helm/alfresco-common/.helmignore b/helm/alfresco-common/.helmignore new file mode 100644 index 000000000..721fe6abd --- /dev/null +++ b/helm/alfresco-common/.helmignore @@ -0,0 +1,25 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Helm unit tests +tests +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/alfresco-common/Chart.yaml b/helm/alfresco-common/Chart.yaml new file mode 100644 index 000000000..b6ff24e63 --- /dev/null +++ b/helm/alfresco-common/Chart.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: v2 +name: alfresco-common +description: | + A helper subchart to avoid duplication in alfresco charts and set common + external dependencies +type: library +version: 0.1.0 +dependencies: + - name: common + repository: >- + https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ + version: 1.x.x +icon: https://avatars0.githubusercontent.com/u/391127?s=200&v=4 diff --git a/helm/alfresco-content-services/charts/alfresco-content-common/README.md.gotmpl b/helm/alfresco-common/README.md.gotmpl similarity index 100% rename from helm/alfresco-content-services/charts/alfresco-content-common/README.md.gotmpl rename to helm/alfresco-common/README.md.gotmpl diff --git a/helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers-activemq.tpl b/helm/alfresco-common/templates/_helpers-activemq.tpl similarity index 100% rename from helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers-activemq.tpl rename to helm/alfresco-common/templates/_helpers-activemq.tpl diff --git a/helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers-image-pull-secrets.tpl b/helm/alfresco-common/templates/_helpers-image-pull-secrets.tpl similarity index 100% rename from helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers-image-pull-secrets.tpl rename to helm/alfresco-common/templates/_helpers-image-pull-secrets.tpl diff --git a/helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers-search.tpl b/helm/alfresco-common/templates/_helpers-search.tpl similarity index 100% rename from helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers-search.tpl rename to helm/alfresco-common/templates/_helpers-search.tpl diff --git a/helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers.tpl b/helm/alfresco-common/templates/_helpers.tpl similarity index 100% rename from helm/alfresco-content-services/charts/alfresco-content-common/templates/_helpers.tpl rename to helm/alfresco-common/templates/_helpers.tpl diff --git a/helm/alfresco-content-services/.helmignore b/helm/alfresco-content-services/.helmignore index 0e8a0eb36..721fe6abd 100644 --- a/helm/alfresco-content-services/.helmignore +++ b/helm/alfresco-content-services/.helmignore @@ -2,6 +2,8 @@ # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. .DS_Store +# Helm unit tests +tests # Common VCS dirs .git/ .gitignore diff --git a/helm/alfresco-content-services/Chart.yaml b/helm/alfresco-content-services/Chart.yaml index 5ee385bd9..13d8bc7e7 100644 --- a/helm/alfresco-content-services/Chart.yaml +++ b/helm/alfresco-content-services/Chart.yaml @@ -1,6 +1,8 @@ -# Note: The Helm chart from github.com is a limited trial of the Enterprise version of Alfresco Content Services -# that goes into read-only mode after 2-days. -# Request an extended 30-day trial at https://www.alfresco.com/platform/content-services-ecm/trial/download +# Note: The Helm chart from github.com is a limited trial of the Enterprise +# version of Alfresco Content Services which goes read-only after 2-days. +# Request an extended 30-day trial at +# https://www.alfresco.com/platform/content-services-ecm/trial/download +--- apiVersion: v2 name: alfresco-content-services version: 5.3.0-M3 @@ -14,22 +16,27 @@ home: https://www.alfresco.com sources: - https://github.com/Alfresco/acs-deployment dependencies: - - name: alfresco-content-common - version: 0.1.0 + - name: alfresco-common + version: 0.1.0-SNAPSHOT + repository: https://kubernetes-charts.alfresco.com/incubator - name: postgresql version: 10.16.2 - repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ + repository: >- + https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ condition: postgresql.enabled - name: postgresql version: 10.16.2 - repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ + repository: >- + https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ alias: postgresql-syncservice - condition: alfresco-sync-service.syncservice.enabled,postgresql-syncservice.enabled + condition: >- + alfresco-sync-service.syncservice.enabled,postgresql-syncservice.enabled - name: common alias: alfresco-digital-workspace repository: https://activiti.github.io/activiti-cloud-helm-charts version: 7.3.0 - condition: alfresco-content-services.alfresco-digital-workspace.enabled,alfresco-digital-workspace.enabled + condition: >- + alfresco-content-services.alfresco-digital-workspace.enabled,alfresco-digital-workspace.enabled - name: activemq version: 2.1.0 condition: activemq.enabled diff --git a/helm/alfresco-content-services/README.md b/helm/alfresco-content-services/README.md index 0ad47a0ac..5e9fc5778 100644 --- a/helm/alfresco-content-services/README.md +++ b/helm/alfresco-content-services/README.md @@ -17,12 +17,12 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | Repository | Name | Version | |------------|------|---------| | | activemq | 2.1.0 | -| | alfresco-content-common | 0.1.0 | | | alfresco-elasticsearch-connector | 0.1.0 | | | alfresco-search | 1.0.4 | | | alfresco-sync-service | 3.0.9 | | https://activiti.github.io/activiti-cloud-helm-charts | alfresco-digital-workspace(common) | 7.3.0 | | https://helm.elastic.co | elasticsearch(elasticsearch) | 7.10.1 | +| https://kubernetes-charts.alfresco.com/incubator | alfresco-common | 0.1.0-SNAPSHOT | | https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ | postgresql | 10.16.2 | | https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ | postgresql-syncservice(postgresql) | 10.16.2 | diff --git a/helm/alfresco-content-services/charts/activemq/Chart.yaml b/helm/alfresco-content-services/charts/activemq/Chart.yaml index f8fda8890..f73ec5ddf 100755 --- a/helm/alfresco-content-services/charts/activemq/Chart.yaml +++ b/helm/alfresco-content-services/charts/activemq/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 appVersion: 5.16.4 description: A Helm chart Providing Apache ActiveMQ. @@ -9,7 +10,7 @@ sources: - https://github.com/Alfresco/acs-deployment version: 2.1.0 dependencies: - - name: alfresco-content-common - version: 0.1.0 - repository: "file://../alfresco-content-common" + - name: alfresco-common + version: 0.1.0-SNAPSHOT + repository: https://kubernetes-charts.alfresco.com/incubator icon: https://avatars0.githubusercontent.com/u/391127?s=200&v=4 diff --git a/helm/alfresco-content-services/charts/activemq/README.md b/helm/alfresco-content-services/charts/activemq/README.md index 5ebefe8f9..09fd5764c 100644 --- a/helm/alfresco-content-services/charts/activemq/README.md +++ b/helm/alfresco-content-services/charts/activemq/README.md @@ -14,7 +14,7 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | Repository | Name | Version | |------------|------|---------| -| file://../alfresco-content-common | alfresco-content-common | 0.1.0 | +| https://kubernetes-charts.alfresco.com/incubator | alfresco-common | 0.1.0-SNAPSHOT | ## Values diff --git a/helm/alfresco-content-services/charts/alfresco-content-common/Chart.yaml b/helm/alfresco-content-services/charts/alfresco-content-common/Chart.yaml deleted file mode 100644 index ffb950362..000000000 --- a/helm/alfresco-content-services/charts/alfresco-content-common/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v2 -name: alfresco-content-common -description: A helper subchart to avoid duplication in alfresco-content-services chart and subcharts -type: library -version: 0.1.0 diff --git a/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/Chart.yaml b/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/Chart.yaml index f6f15a858..ac196fd02 100644 --- a/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/Chart.yaml +++ b/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/Chart.yaml @@ -1,10 +1,11 @@ +--- apiVersion: v2 name: alfresco-elasticsearch-connector description: A Helm chart for deploying Alfresco Elasticsearch connector type: application version: 0.1.0 -appVersion: "3.0.0" +appVersion: 3.0.0 dependencies: - - name: alfresco-content-common - version: 0.1.0 - repository: "file://../alfresco-content-common" + - name: alfresco-common + version: 0.1.0-SNAPSHOT + repository: https://kubernetes-charts.alfresco.com/incubator diff --git a/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/README.md b/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/README.md index e7e21a6b7..3437c91f4 100644 --- a/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/README.md +++ b/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/README.md @@ -10,7 +10,7 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | Repository | Name | Version | |------------|------|---------| -| file://../alfresco-content-common | alfresco-content-common | 0.1.0 | +| https://kubernetes-charts.alfresco.com/incubator | alfresco-common | 0.1.0-SNAPSHOT | ## Values diff --git a/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/templates/_helpers.tpl b/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/templates/_helpers.tpl index ba6049561..af11d3f00 100644 --- a/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/templates/_helpers.tpl +++ b/helm/alfresco-content-services/charts/alfresco-elasticsearch-connector/templates/_helpers.tpl @@ -49,14 +49,3 @@ Selector labels app.kubernetes.io/name: {{ include "alfresco-elasticsearch-connector.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "alfresco-elasticsearch-connector.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "alfresco-elasticsearch-connector.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/helm/alfresco-content-services/charts/alfresco-search/Chart.yaml b/helm/alfresco-content-services/charts/alfresco-search/Chart.yaml index bef7f7bd0..a0a1ccadf 100644 --- a/helm/alfresco-content-services/charts/alfresco-search/Chart.yaml +++ b/helm/alfresco-content-services/charts/alfresco-search/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 description: A Helm chart for deploying Alfresco Search home: https://www.alfresco.com @@ -16,9 +17,6 @@ version: 1.0.4 dependencies: - name: alfresco-insight-zeppelin version: 1.0.3 - - name: common - repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ - version: 1.x.x - - name: alfresco-content-common - version: 0.1.0 - repository: "file://../alfresco-content-common" + - name: alfresco-common + version: 0.1.0-SNAPSHOT + repository: https://kubernetes-charts.alfresco.com/incubator diff --git a/helm/alfresco-content-services/charts/alfresco-search/README.md b/helm/alfresco-content-services/charts/alfresco-search/README.md index 971bc5bd2..54f06942c 100644 --- a/helm/alfresco-content-services/charts/alfresco-search/README.md +++ b/helm/alfresco-content-services/charts/alfresco-search/README.md @@ -17,8 +17,7 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | Repository | Name | Version | |------------|------|---------| | | alfresco-insight-zeppelin | 1.0.3 | -| file://../alfresco-content-common | alfresco-content-common | 0.1.0 | -| https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ | common | 1.x.x | +| https://kubernetes-charts.alfresco.com/incubator | alfresco-common | 0.1.0-SNAPSHOT | ## Values diff --git a/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/Chart.yaml b/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/Chart.yaml index bb80f677e..58b0153bc 100755 --- a/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/Chart.yaml +++ b/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/Chart.yaml @@ -12,6 +12,6 @@ sources: - https://github.com/Alfresco/acs-deployment version: 1.0.3 dependencies: - - name: common - repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ - version: 1.x.x + - name: alfresco-common + version: 0.1.0-SNAPSHOT + repository: https://kubernetes-charts.alfresco.com/incubator diff --git a/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/README.md b/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/README.md index 4a72a66a0..87ce88fc4 100644 --- a/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/README.md +++ b/helm/alfresco-content-services/charts/alfresco-search/charts/alfresco-insight-zeppelin/README.md @@ -16,7 +16,7 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | Repository | Name | Version | |------------|------|---------| -| https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ | common | 1.x.x | +| https://kubernetes-charts.alfresco.com/incubator | alfresco-common | 0.1.0-SNAPSHOT | ## Values diff --git a/helm/alfresco-content-services/charts/alfresco-sync-service/Chart.yaml b/helm/alfresco-content-services/charts/alfresco-sync-service/Chart.yaml index 43214e61c..bdc8b9a77 100644 --- a/helm/alfresco-content-services/charts/alfresco-sync-service/Chart.yaml +++ b/helm/alfresco-content-services/charts/alfresco-sync-service/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 description: Alfresco Sync Service keywords: @@ -10,9 +11,10 @@ sources: version: 3.0.9 icon: https://avatars0.githubusercontent.com/u/391127?s=200&v=4 dependencies: - - name: alfresco-content-common - version: 0.1.0 - repository: "file://../alfresco-content-common" - name: common - repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ + repository: >- + https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ version: 1.x.x + - name: alfresco-common + version: 0.1.0-SNAPSHOT + repository: https://kubernetes-charts.alfresco.com/incubator diff --git a/helm/alfresco-content-services/charts/alfresco-sync-service/README.md b/helm/alfresco-content-services/charts/alfresco-sync-service/README.md index 0e13cf2f0..17f9036fe 100644 --- a/helm/alfresco-content-services/charts/alfresco-sync-service/README.md +++ b/helm/alfresco-content-services/charts/alfresco-sync-service/README.md @@ -12,7 +12,7 @@ Alfresco Sync Service | Repository | Name | Version | |------------|------|---------| -| file://../alfresco-content-common | alfresco-content-common | 0.1.0 | +| https://kubernetes-charts.alfresco.com/incubator | alfresco-common | 0.1.0-SNAPSHOT | | https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/ | common | 1.x.x | ## Values diff --git a/helm/alfresco-content-services/templates/_helpers-ingress.tpl b/helm/alfresco-content-services/templates/_helpers-ingress.tpl index 5bfb1ee5d..dafe61bd8 100644 --- a/helm/alfresco-content-services/templates/_helpers-ingress.tpl +++ b/helm/alfresco-content-services/templates/_helpers-ingress.tpl @@ -4,7 +4,7 @@ Define annotations as provided in values {{- define "ingress_annotations" }} {{- range $annotation, $value := .ingress.annotations }} {{- if ne $annotation "nginx.ingress.kubernetes.io/server-snippet" }} - {{- $annotation | nindent 4 }}: | + {{- $annotation | nindent 4 }}: |- {{- $value | nindent 6 }} {{- end }} {{- end }} diff --git a/helm/alfresco-content-services/templates/secret-repo-jtoolopt.yml b/helm/alfresco-content-services/templates/secret-repo-jtoolopt.yaml similarity index 100% rename from helm/alfresco-content-services/templates/secret-repo-jtoolopt.yml rename to helm/alfresco-content-services/templates/secret-repo-jtoolopt.yaml diff --git a/helm/alfresco-content-services/tests/alfresco-common_test.yaml b/helm/alfresco-content-services/tests/alfresco-common_test.yaml new file mode 100644 index 000000000..2e0211a8e --- /dev/null +++ b/helm/alfresco-content-services/tests/alfresco-common_test.yaml @@ -0,0 +1,73 @@ +# alfresco-common is a library so can only be tested from +# another chart +--- +suite: test alfresco-common library +templates: + - ingress-repository.yaml + - secret-repo-jtoolopt.yaml + - config-transform-router.yaml + - deployment-repository.yaml + - config-repository.yaml + - secret-database.yaml + - secret-s3.yaml + - config-dev-log4j-properties.yaml +tests: + - it: should render with default value alfresco-cs + values: &testvalues + - test-values.yml + asserts: + - equal: + path: data.JAVA_TOOL_OPTIONS + # harcoded value. Can't encode on the fly + value: | + LURzb2xyLnNoYXJlZFNlY3JldD1kdW1teSA= + template: secret-repo-jtoolopt.yaml + - matchRegex: + path: metadata.name + pattern: ^RELEASE-NAME-alfresco-cs- + - it: should render with value set + values: *testvalues + set: + NameOverride: myacstest + asserts: + - matchRegex: + path: metadata.name + pattern: ^RELEASE-NAME-myacstest- + - it: should render default activeMQ vars + values: + - test-values.yml + asserts: + - equal: + path: data.ACTIVEMQ_URL + value: nio://RELEASE-NAME-activemq-broker:61616 + template: config-transform-router.yaml + - equal: + path: data.ACTIVEMQ_USER + value: admin + template: config-transform-router.yaml + - equal: + path: data.ACTIVEMQ_PASSWORD + value: admin + template: config-transform-router.yaml + - it: should render custom activeMQ vars + values: + - test-values.yml + - externalBroker-values.yml + asserts: + - contains: + path: spec.template.spec.imagePullSecrets + content: + name: secretsecret + template: deployment-repository.yaml + - equal: + path: data.ACTIVEMQ_URL + value: failover(nio://somebroker:61616) + template: config-transform-router.yaml + - equal: + path: data.ACTIVEMQ_USER + value: alfresco + template: config-transform-router.yaml + - equal: + path: data.ACTIVEMQ_PASSWORD + value: alfresco + template: config-transform-router.yaml diff --git a/helm/alfresco-content-services/tests/externalBroker-values.yml b/helm/alfresco-content-services/tests/externalBroker-values.yml new file mode 100644 index 000000000..2d932d5b0 --- /dev/null +++ b/helm/alfresco-content-services/tests/externalBroker-values.yml @@ -0,0 +1,10 @@ +--- +global: + tracking: + sharedsecret: dummy +activemq: + enabled: false +messageBroker: + url: failover(nio://somebroker:61616) + user: alfresco + password: alfresco diff --git a/helm/alfresco-content-services/tests/externalBroker_test.yaml b/helm/alfresco-content-services/tests/externalBroker_test.yaml new file mode 100644 index 000000000..bdad259a5 --- /dev/null +++ b/helm/alfresco-content-services/tests/externalBroker_test.yaml @@ -0,0 +1,19 @@ +--- +suite: test rendering with external message Broker for ACS +templates: + - config-repository.yaml +tests: + - it: should work + values: + - test-values.yml + - externalBroker-values.yml + set: + messageBroker: + url: failover(nio://broker.domain.local:61616) + asserts: + - isKind: + of: ConfigMap + - matchRegex: + path: data.ALFRESCO_OPTS + pattern: >- + \ -Dmessaging.broker.url=failover\(nio://broker.domain.local:61616\)\ diff --git a/helm/alfresco-content-services/tests/test-values.yml b/helm/alfresco-content-services/tests/test-values.yml new file mode 100644 index 000000000..6968a5a17 --- /dev/null +++ b/helm/alfresco-content-services/tests/test-values.yml @@ -0,0 +1,5 @@ +--- +global: + tracking: + sharedsecret: dummy + alfrescoRegistryPullSecrets: secretsecret