Skip to content

Commit

Permalink
OPSEXP-1447: split alfresco-common into a library chart of its own (#773
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alxgomz authored Sep 28, 2022
1 parent 35672fa commit 792f2b8
Show file tree
Hide file tree
Showing 29 changed files with 208 additions and 58 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: verify
on:
pull_request:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
25 changes: 25 additions & 0 deletions helm/alfresco-common/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
14 changes: 14 additions & 0 deletions helm/alfresco-common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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://github.com/bitnami/charts/archive-full-index/bitnami/
version: 1.x.x
icon: https://avatars0.githubusercontent.com/u/391127?s=200&v=4
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions helm/alfresco-content-services/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 16 additions & 9 deletions helm/alfresco-content-services/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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://github.com/bitnami/charts/archive-full-index/bitnami/
repository: >-
https://github.com/bitnami/charts/archive-full-index/bitnami/
condition: postgresql.enabled
- name: postgresql
version: 10.16.2
repository: https://github.com/bitnami/charts/archive-full-index/bitnami/
repository: >-
https://github.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
Expand Down
2 changes: 1 addition & 1 deletion helm/alfresco-content-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://github.com/bitnami/charts/archive-full-index/bitnami/ | postgresql | 10.16.2 |
| https://github.com/bitnami/charts/archive-full-index/bitnami/ | postgresql-syncservice(postgresql) | 10.16.2 |

Expand Down
7 changes: 4 additions & 3 deletions helm/alfresco-content-services/charts/activemq/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v2
appVersion: 5.16.4
description: A Helm chart Providing Apache ActiveMQ.
Expand All @@ -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
2 changes: 1 addition & 1 deletion helm/alfresco-content-services/charts/activemq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
10 changes: 4 additions & 6 deletions helm/alfresco-content-services/charts/alfresco-search/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v2
description: A Helm chart for deploying Alfresco Search
home: https://www.alfresco.com
Expand All @@ -16,9 +17,6 @@ version: 1.0.4
dependencies:
- name: alfresco-insight-zeppelin
version: 1.0.3
- name: common
repository: https://github.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
Original file line number Diff line number Diff line change
Expand Up @@ -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://github.com/bitnami/charts/archive-full-index/bitnami/ | common | 1.x.x |
| https://kubernetes-charts.alfresco.com/incubator | alfresco-common | 0.1.0-SNAPSHOT |

## Values

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ sources:
- https://github.com/Alfresco/acs-deployment
version: 1.0.3
dependencies:
- name: common
repository: https://github.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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v2
description: Alfresco Sync Service
keywords:
Expand All @@ -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://github.com/bitnami/charts/archive-full-index/bitnami/
repository: >-
https://github.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
Original file line number Diff line number Diff line change
Expand Up @@ -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://github.com/bitnami/charts/archive-full-index/bitnami/ | common | 1.x.x |

## Values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
73 changes: 73 additions & 0 deletions helm/alfresco-content-services/tests/alfresco-common_test.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions helm/alfresco-content-services/tests/externalBroker-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
global:
tracking:
sharedsecret: dummy
activemq:
enabled: false
messageBroker:
url: failover(nio://somebroker:61616)
user: alfresco
password: alfresco
Loading

0 comments on commit 792f2b8

Please sign in to comment.