Skip to content

Commit

Permalink
auto build on merge
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Feb 16, 2024
1 parent 9bf854c commit 5f8ceaf
Show file tree
Hide file tree
Showing 17 changed files with 188 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
- 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"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
charts/*
Chart.lock
Chart.lock*~undo-tree~
2 changes: 1 addition & 1 deletion Chart.yaml → chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file added chart/build
Empty file.
Binary file added chart/charts/postgresql-9.3.3.tgz
Binary file not shown.
File renamed without changes.
File renamed without changes.
136 changes: 136 additions & 0 deletions chart/templates/_helpers.tpl.orig
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5f8ceaf

Please sign in to comment.