-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate heml chart * refactor * Update helm-lint-test.yaml * Update package.json * Update Chart.yaml * Update Chart.yaml * rename * Update helm-chart-lint-test.yaml
- Loading branch information
1 parent
15a86b7
commit e7517ac
Showing
20 changed files
with
928 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ yarn.js | |
packages/ui-components/storybook-static | ||
dist.js | ||
bundle.js | ||
charts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Lint and Test Helm Chart | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'charts/**' | ||
|
||
jobs: | ||
lint-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v4 | ||
with: | ||
version: v3.4.1 | ||
|
||
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and | ||
# yamllint (https://github.com/adrienverge/yamllint) which require Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@v2.6.1 | ||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config ct.yaml) | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint --config ct.yaml | ||
|
||
- name: Create kind cluster | ||
uses: helm/kind-action@v1.9.0 | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
- name: Run chart-testing (install) | ||
run: ct install --config ct.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Release Helm Charts | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'charts/**' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
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: Install Helm | ||
uses: azure/setup-helm@v4 | ||
with: | ||
version: v3.4.0 | ||
|
||
- name: Run chart-releaser | ||
uses: helm/chart-releaser-action@v1.5.0 | ||
env: | ||
CR_TOKEN: "${{ secrets.CR_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,6 @@ jest.config.js | |
contrib/ | ||
storage_default_storage/ | ||
docker-bin/ | ||
|
||
# charts | ||
charts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Charts | ||
|
||
/charts @juanpicado |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: v2 | ||
description: A lightweight private node.js proxy registry | ||
name: verdaccio | ||
version: 4.17.0 | ||
appVersion: 5.31.1 | ||
home: https://verdaccio.org | ||
icon: https://cdn.verdaccio.dev/logos/default.png | ||
sources: | ||
- https://verdaccio.org | ||
- https://github.com/verdaccio/verdaccio | ||
keywords: | ||
- npm | ||
- registry | ||
- yarn | ||
- pnpm | ||
- javascript | ||
- nodejs | ||
maintainers: | ||
- name: juanpicado | ||
email: juanpicado19@gmail.com | ||
- name: jhonmike | ||
email: jhon.msdev@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
1. Get the application URL by running these commands: | ||
{{- $tls := .Values.ingress.tls }} | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- if $tls }} | ||
https://{{ tpl $host $ }} | ||
{{- else }} | ||
http://{{ tpl $host $ }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "verdaccio.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "verdaccio.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "verdaccio.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "verdaccio.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "verdaccio.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 "verdaccio.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 "verdaccio.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "verdaccio.labels" -}} | ||
helm.sh/chart: {{ include "verdaccio.chart" . }} | ||
{{ include "verdaccio.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app: {{ include "verdaccio.fullname" . }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "verdaccio.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "verdaccio.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "verdaccio.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "verdaccio.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Renders a value that contains template. | ||
Usage: | ||
{{ include "tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }} | ||
*/}} | ||
{{- define "tplvalues.render" -}} | ||
{{- if typeIs "string" .value }} | ||
{{- tpl .value .context }} | ||
{{- else }} | ||
{{- tpl (.value | toYaml) .context }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Pod Labels | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "verdaccio.podLabels" . | nindent 8 }} | ||
*/}} | ||
{{- define "verdaccio.podLabels" -}} | ||
{{- include "verdaccio.labels" . }} | ||
{{- $global := .Values.global }} | ||
{{- $local := .Values.podLabels }} | ||
{{- $labels := dict }} | ||
{{- if $global }} | ||
{{- range $k,$v := $global.podLabels }} | ||
{{- $labels = merge $labels (dict $k (tpl $v $)) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if $local }} | ||
{{- range $k,$v := $local }} | ||
{{- $labels = merge $labels (dict $k (tpl $v $)) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if (not (empty $labels)) }} | ||
{{- toYaml $labels | nindent 0 }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Pod Annotations | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
{{- include "verdaccio.podAnnotations" . | nindent 8 }} | ||
*/}} | ||
{{- define "verdaccio.podAnnotations" -}} | ||
{{- $global := .Values.global }} | ||
{{- $local := .Values.podAnnotations }} | ||
{{- $annotations := dict }} | ||
{{- if $global }} | ||
{{- range $k,$v := $global.podAnnotations }} | ||
{{- $annotations = merge $annotations (dict $k (tpl $v $)) }} | ||
{{- end }} | ||
{{- end -}} | ||
{{- if $local }} | ||
{{- range $k,$v := $local }} | ||
{{- $annotations = merge $annotations (dict $k (tpl $v $)) }} | ||
{{- end }} | ||
{{- end -}} | ||
{{- if (not (empty $annotations)) }} | ||
{{- toYaml $annotations }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
# templates/deployment.yaml | ||
spec: | ||
template: | ||
spec: | ||
{{- include "verdaccio.imagePullSecrets" . | nindent 6 }} | ||
|
||
# values.yaml | ||
image: | ||
pullSecrets: | ||
- mypullsecret | ||
*/}} | ||
{{- define "verdaccio.imagePullSecrets" -}} | ||
{{- $images := .Values.image }} | ||
{{- $global := .Values.global }} | ||
{{- $pullSecrets := list }} | ||
|
||
{{- if $global }} | ||
{{- if $global.image }} | ||
{{- range $global.image.pullSecrets -}} | ||
{{- $pullSecrets = append $pullSecrets . -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- range $images.pullSecrets -}} | ||
{{- $pullSecrets = append $pullSecrets . -}} | ||
{{- end -}} | ||
|
||
{{- if (not (empty $pullSecrets)) }} | ||
imagePullSecrets: | ||
{{- range $pullSecrets }} | ||
- name: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "verdaccio.fullname" . }} | ||
labels: | ||
{{- include "verdaccio.labels" . | nindent 4 }} | ||
data: | ||
config.yaml: |- | ||
{{- include "tplvalues.render" (dict "value" .Values.configMap "context" $) | nindent 4 }} |
Oops, something went wrong.