From 0b6aa7cb569dbb31823c8ccc0a549c805793315c Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Fri, 14 Apr 2023 23:37:52 -0400 Subject: [PATCH] Add basic chart --- .air.toml | 2 +- .gitignore | 11 ++++++---- .trunk/trunk.yaml | 5 +++++ Taskfile.yml | 3 ++- charts/ytdl-web/.helmignore | 23 ++++++++++++++++++++ charts/ytdl-web/Chart.yaml | 14 ++++++++++++ charts/ytdl-web/README_CONFIG.md.gotmpl | 9 ++++++++ charts/ytdl-web/templates/common.yaml | 14 ++++++++++++ charts/ytdl-web/values.yaml | 29 +++++++++++++++++++++++++ 9 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 charts/ytdl-web/.helmignore create mode 100644 charts/ytdl-web/Chart.yaml create mode 100644 charts/ytdl-web/README_CONFIG.md.gotmpl create mode 100644 charts/ytdl-web/templates/common.yaml create mode 100644 charts/ytdl-web/values.yaml diff --git a/.air.toml b/.air.toml index 095bf00..c1bffa2 100644 --- a/.air.toml +++ b/.air.toml @@ -4,7 +4,7 @@ tmp_dir = "tmp" [build] args_bin = ["-l", "0.0.0.0"] -bin = "./ytdl-web" +bin = "./out/ytdl-web" cmd = "task build" delay = 1000 exclude_dir = ["assets", "tmp", "vendor", "testdata"] diff --git a/.gitignore b/.gitignore index 517be05..438d007 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ -# Ignore binary -ytdl-web +# Output directory +/out/ -# Ignore tmp dir -/tmp/ \ No newline at end of file +# Air temp directory +/tmp/ + +# Deployment directory +.deploy \ No newline at end of file diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index b547829..43421bc 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -16,6 +16,11 @@ lint: - prettier@2.8.7 - taplo@0.7.0 - yamllint@1.30.0 + ignore: + - linters: + - yamllint + paths: + - charts runtimes: enabled: - go@1.19.5 diff --git a/Taskfile.yml b/Taskfile.yml index 33e3086..38f05fa 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,6 +1,7 @@ version: "3" vars: + OUT: ./out/ytdl-web VERSION: 1.0.0 VERSION_PKG: go.fifitido.net/ytdl-web/version BUILD: @@ -9,5 +10,5 @@ vars: tasks: deps: go mod download tidy: go mod tidy - build: go build -ldflags="-X {{.VERSION_PKG}}.Version={{.VERSION}} -X {{.VERSION_PKG}}.Build={{.BUILD}}" -o ytdl-web . + build: go build -ldflags="-X {{.VERSION_PKG}}.Version={{.VERSION}} -X {{.VERSION_PKG}}.Build={{.BUILD}}" -o {{.OUT}} . dev: air diff --git a/charts/ytdl-web/.helmignore b/charts/ytdl-web/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/ytdl-web/.helmignore @@ -0,0 +1,23 @@ +# 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 +# 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/charts/ytdl-web/Chart.yaml b/charts/ytdl-web/Chart.yaml new file mode 100644 index 0000000..849cd9a --- /dev/null +++ b/charts/ytdl-web/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +description: A web-based frontend for yt-dlp +name: ytdl-web +version: 1.0.0 +kubeVersion: ">=1.22.0-0" +type: application +appVersion: 1.0.0 +maintainers: + - name: fifitido + email: me@fifitido.net +dependencies: + - name: common + repository: https://bjw-s.github.io/helm-charts + version: 1.4.0 diff --git a/charts/ytdl-web/README_CONFIG.md.gotmpl b/charts/ytdl-web/README_CONFIG.md.gotmpl new file mode 100644 index 0000000..0360bf6 --- /dev/null +++ b/charts/ytdl-web/README_CONFIG.md.gotmpl @@ -0,0 +1,9 @@ +{{- define "custom.custom.configuration.header" -}} +## Custom configuration +{{- end -}} + +{{- define "custom.custom.configuration" -}} +{{ template "custom.custom.configuration.header" . }} + +N/A +{{- end -}} \ No newline at end of file diff --git a/charts/ytdl-web/templates/common.yaml b/charts/ytdl-web/templates/common.yaml new file mode 100644 index 0000000..cde9d9e --- /dev/null +++ b/charts/ytdl-web/templates/common.yaml @@ -0,0 +1,14 @@ +--- +{{- include "bjw-s.common.loader.init" . }} + +{{- define "ytdlp-web.hardcodedValues" -}} +# Set the nameOverride based on the release name if no override has been set +{{ if not .Values.global.nameOverride }} +global: + nameOverride: "{{ .Release.Name }}" +{{ end }} +{{- end -}} +{{- $_ := mergeOverwrite .Values (include "ytdlp-web.hardcodedValues" . | fromYaml) -}} + +{{/* Render the templates */}} +{{ include "bjw-s.common.loader.generate" . }} \ No newline at end of file diff --git a/charts/ytdl-web/values.yaml b/charts/ytdl-web/values.yaml new file mode 100644 index 0000000..15b2d71 --- /dev/null +++ b/charts/ytdl-web/values.yaml @@ -0,0 +1,29 @@ +image: + repository: git.fifitido.net/apps/ytdl-web + pullPolicy: IfNotPresent + tag: 1.0.0 + +strategy: + type: Recreate + +env: + YTDL_LISTEN: 0.0.0.0 + YTDL_PORT: 80 + # YTDL_BASEPATH: /example + +service: + main: + ports: + http: + port: 80 + +ingress: + main: + enabled: false + hosts: + - host: ytdl-web.local + paths: + - path: / + pathType: Prefix + service: + port: http