diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..1f3308e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,50 @@ +name: Release Charts + +on: + push: + branches: + - main + paths: + - "Chart.*" + - "templates/**" + - "values.yaml" + - "charts/**" + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + with: + detached: true + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Run chart-releaser + uses: samvera-labs/helm-oci-charts-releaser@main + with: + oci_registry: ghcr.io/samvera-labs + oci_username: samvera-labs + oci_password: ${{ secrets.GITHUB_TOKEN }} + oci_directory: charts + github_token: ${{ secrets.GITHUB_TOKEN }} + tag_name_pattern: "{chartName}-chart" diff --git a/.gitignore b/.gitignore index 95af41e..fdb113b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ charts/* -Chart.lock \ No newline at end of file +Chart.lock*~undo-tree~ diff --git a/Chart.yaml b/chart/Chart.yaml similarity index 94% rename from Chart.yaml rename to chart/Chart.yaml index ec040fe..a1e1567 100644 --- a/Chart.yaml +++ b/chart/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: fcrepo description: Fedora Commons Repository 4 type: application -version: 2.0.0 +version: 2.0.1 appVersion: 4.7.5 dependencies: - name: postgresql diff --git a/chart/build b/chart/build new file mode 100644 index 0000000..e69de29 diff --git a/chart/charts/postgresql-9.3.3.tgz b/chart/charts/postgresql-9.3.3.tgz new file mode 100644 index 0000000..443950c Binary files /dev/null and b/chart/charts/postgresql-9.3.3.tgz differ diff --git a/templates/NOTES.txt b/chart/templates/NOTES.txt similarity index 100% rename from templates/NOTES.txt rename to chart/templates/NOTES.txt diff --git a/templates/_helpers.tpl b/chart/templates/_helpers.tpl similarity index 100% rename from templates/_helpers.tpl rename to chart/templates/_helpers.tpl diff --git a/chart/templates/_helpers.tpl.orig b/chart/templates/_helpers.tpl.orig new file mode 100644 index 0000000..0ba649c --- /dev/null +++ b/chart/templates/_helpers.tpl.orig @@ -0,0 +1,136 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "fcrepo.name" }} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "fcrepo.fullname" }} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "fcrepo.chart" }} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "fcrepo.labels" }} +helm.sh/chart: {{ include "fcrepo.chart" . }} +{{ include "fcrepo.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "fcrepo.selectorLabels" }} +app.kubernetes.io/name: {{ include "fcrepo.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "fcrepo.serviceAccountName" }} +{{- if .Values.serviceAccount.create }} +{{- default (include "fcrepo.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "fcrepo.postgresql.fullname" }} +{{- $name := default "postgresql" .Values.postgresql.nameOverride }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Return PostgreSQL host +*/}} +{{- define "fcrepo.postgresql.host" }} +{{- if not .Values.postgresql.enabled and .Values.externalPostgresql.host }} + {{- .Values.externalPostgresql.host }} +{{- else if not .Values.postgresql.enabled and .Values.global.postgresql.postgresqlHost }} + {{- .Values.global.postgresql.postgresqlHost }} +{{- else }} + {{- include "fcrepo.postgresql.fullname" . }} +{{- end }} +{{- end }} + +{{/* +Return PostgreSQL host +*/}} +{{- define "fcrepo.postgresql.host" -}} +{{- include "fcrepo.postgresql.fullname" . }} +{{- end -}} + +{{/* +Return PostgreSQL username +*/}} +<<<<<<< HEAD +{{- define "fcrepo.postgresql.username" -}} +{{- if .Values.global.postgresql.postgresqlUsername }} + {{- .Values.global.postgresql.postgresqlUsername -}} +{{- else -}} + {{- .Values.postgresql.postgresqlUsername -}} +{{- end -}} +{{- end -}} +======= +{{- define "fcrepo.postgresql.username" }} +{{- if not .Values.postgresql.enabled and .Values.externalPostgresql.username }} + {{- .Values.externalPostgresql.username }} +{{- else if not .Values.postgresql.enabled and .Values.global.postgresql.postgresqlUsername }} + {{- .Values.global.postgresql.postgresqlUsername }} +{{- else }} + {{- .Values.postgresql.postgresqlUsername }} +{{- end }} +{{- end }} +>>>>>>> 914256fb7f94a311919db7cf8a93bbbb0cd65bfd + +{{/* +Return PostgreSQL password +*/}} +<<<<<<< HEAD +{{- define "fcrepo.postgresql.password" -}} +{{- if .Values.global.postgresql.postgresqlPassword }} + {{- .Values.global.postgresql.postgresqlPassword }} +{{- else if .Values.postgresql.postgresqlPassword -}} + {{- .Values.postgresql.postgresqlPassword }} +{{- else -}} + {{- randAlphaNum 10 -}} +{{- end -}} +{{- end -}} +======= +{{- define "fcrepo.postgresql.password" }} +{{- if not .Values.postgresql.enabled and .Values.externalPostgresql.password }} + {{- .Values.externalPostgresql.password }} +{{- else if not .Values.postgresql.enabled and .Values.global.postgresql.postgresqlPassword }} + {{- .Values.global.postgresql.postgresqlPassword }} +{{- else }} + {{- .Values.postgresql.postgresqlPassword }} +{{- end }} +{{- end }} +>>>>>>> 914256fb7f94a311919db7cf8a93bbbb0cd65bfd diff --git a/templates/configmap-env.yaml b/chart/templates/configmap-env.yaml similarity index 100% rename from templates/configmap-env.yaml rename to chart/templates/configmap-env.yaml diff --git a/templates/deployment.yaml b/chart/templates/deployment.yaml similarity index 100% rename from templates/deployment.yaml rename to chart/templates/deployment.yaml diff --git a/templates/ingress.yaml b/chart/templates/ingress.yaml similarity index 100% rename from templates/ingress.yaml rename to chart/templates/ingress.yaml diff --git a/templates/pvc.yaml b/chart/templates/pvc.yaml similarity index 100% rename from templates/pvc.yaml rename to chart/templates/pvc.yaml diff --git a/templates/secret.yaml b/chart/templates/secret.yaml similarity index 100% rename from templates/secret.yaml rename to chart/templates/secret.yaml diff --git a/templates/service.yaml b/chart/templates/service.yaml similarity index 100% rename from templates/service.yaml rename to chart/templates/service.yaml diff --git a/templates/serviceaccount.yaml b/chart/templates/serviceaccount.yaml similarity index 100% rename from templates/serviceaccount.yaml rename to chart/templates/serviceaccount.yaml diff --git a/templates/tests/test-connection.yaml b/chart/templates/tests/test-connection.yaml similarity index 100% rename from templates/tests/test-connection.yaml rename to chart/templates/tests/test-connection.yaml diff --git a/values.yaml b/chart/values.yaml similarity index 100% rename from values.yaml rename to chart/values.yaml