Skip to content

Commit 382f09c

Browse files
authored
24 add helm chart (#44)
1 parent 1d6ff6e commit 382f09c

25 files changed

Lines changed: 639 additions & 67 deletions

.devcontainer/Dockerfile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
FROM mcr.microsoft.com/devcontainers/python:3.12
22

3-
# update base
4-
RUN apt-get update -y -qq
5-
RUN apt-get dist-upgrade -y -qq
6-
RUN apt-get autoremove -y -qq
3+
USER root
4+
5+
RUN apt-get update -y -qq && \
6+
apt-get dist-upgrade -y -qq && \
7+
apt-get autoremove -y -qq
8+
9+
# git safe directories
10+
RUN git config --global --add safe.directory "*"
11+
12+
RUN apt-get -y -qq install \
13+
fzf \
14+
jq \
15+
yq \
16+
zsh
17+
18+
RUN mkdir /config
19+
RUN chown vscode:vscode -R /config
20+
RUN chmod 0755 /config
721

8-
# install pipx
922
RUN pip install pipx
10-
RUN pipx ensurepath
11-
RUN pipx install poetry ruff pre-commit pytest
23+
RUN pipx --global ensurepath
24+
RUN pipx --global install poetry ruff pre-commit pytest yamale yamllint
25+
26+
USER vscode

.devcontainer/devcontainer.json

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,59 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3-
"name": "series_scanner devContainer",
3+
"name": "renamarr devContainer",
44
"build": {
55
"dockerfile": "Dockerfile"
66
},
77
"features": {
88
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
99
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
10-
"plugins": "git zsh-syntax-highlighting zsh-autosuggestions poetry poetry-env gpg-agent",
10+
"plugins": "git gpg-agent helm kind kubectl poetry poetry-env zsh-autosuggestions zsh-syntax-highlighting",
1111
"omzPlugins": "https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-autosuggestions"
1212
},
1313
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
14-
"ghcr.io/devcontainers/features/github-cli:1": {}
14+
"ghcr.io/devcontainers/features/github-cli:1": {},
15+
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
16+
"minikube": "none" // use kind instead
17+
},
18+
"ghcr.io/devcontainers-contrib/features/kubectx-kubens:1": {},
19+
"ghcr.io/mpriscella/features/kind:1": {},
20+
"ghcr.io/mpriscella/features/helm-chart-testing:1": {}
1521
},
1622
"containerEnv": {
1723
"LOGURU_LEVEL": "DEBUG",
18-
"GH_TOKEN": "${localEnv:GH_TOKEN}"
24+
"GH_TOKEN": "${localEnv:GH_TOKEN}",
1925
},
20-
"mounts": [
21-
"source=${localWorkspaceFolder}/config.yml,target=/config/config.yml,type=bind,consistency=cached"
22-
],
26+
"mounts": [],
2327
"postCreateCommand": "zsh .devcontainer/postCreateCommand.sh",
2428
"customizations": {
2529
"vscode": {
2630
"settings": {
2731
"editor.formatOnSave": true,
32+
"editor.tabSize": 2,
2833
"terminal.integrated.defaultProfile.linux": "zsh",
2934
"terminal.integrated.profiles.linux": {
3035
"zsh": {
31-
"path": "/usr/bin/zsh"
36+
"path": "/bin/zsh"
3237
}
3338
},
3439
"files": {
3540
"eol": "\n",
3641
"trimFinalNewlines": true,
3742
"trimTrailingWhitespace": true,
3843
"trimTrailingWhitespaceInRegexAndStrings": true,
39-
"insertFinalNewline": true
44+
"insertFinalNewline": true,
45+
"associations": {
46+
"**/templates/*.yaml": "jinja-yaml",
47+
"*.tpl": "jinja-yaml"
48+
}
4049
},
41-
"vscode-yaml-sort.sortArrays": true,
4250
"git": {
4351
"enableCommitSigning": true,
4452
"autofetch": true
4553
},
46-
"source.organizeImports": true,
4754
"[python]": {
4855
"editor.formatOnSave": true,
56+
"editor.tabSize": 4,
4957
"editor.codeActionsOnSave": {
5058
"source.fixAll": "explicit",
5159
"source.organizeImports": "explicit"
@@ -71,9 +79,17 @@
7179
]
7280
}
7381
},
82+
"gitlens": {
83+
"plusFeatures.enabled": "false",
84+
"showWelcomeOnInstall": "false",
85+
"showWhatsNewAfterUpgrades": "false"
86+
},
7487
"ruff.codeAction.disableRuleComment": {
7588
"enable": false
7689
},
90+
"yaml.schemas": {
91+
"https://json.schemastore.org/yamllint.json": "*.y(a)?ml"
92+
},
7793
"[jsonc]": {
7894
"editor.defaultFormatter": "vscode.json-language-features"
7995
},
@@ -86,6 +102,8 @@
86102
},
87103
"extensions": [
88104
"charliermarsh.ruff",
105+
"eamodio.gitlens",
106+
"elagil.pre-commit-helper",
89107
"KevinRose.vsc-python-indent",
90108
"ms-python.debugpy",
91109
"ms-python.python",
@@ -94,6 +112,9 @@
94112
"njpwerner.autodocstring",
95113
"njqdev.vscode-python-typehint",
96114
"oderwat.indent-rainbow",
115+
"redhat.vscode-yaml",
116+
"samuelcolvin.jinjahtml",
117+
"Tim-Koehler.helm-intellisense",
97118
"VisualStudioExptTeam.vscodeintellicode",
98119
"yzhang.markdown-all-in-one"
99120
]

.devcontainer/postCreateCommand.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/zsh
22

3+
ln -s $PWD/config.yml /config/config.yml
4+
35
# create venv
46
poetry config virtualenvs.in-project true --local
57

.github/workflows/buildImage.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
- feat/**
1212
- bug/**
1313

14-
1514
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
1615
env:
1716
REGISTRY: ghcr.io

.github/workflows/helm-ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Lint and Test Charts
2+
3+
on: pull_request
4+
5+
jobs:
6+
helm-ci:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v4.2.0
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.x"
20+
check-latest: true
21+
22+
- name: Set up chart-testing
23+
uses: helm/chart-testing-action@v2.6.1
24+
25+
- name: Run chart-testing (list-changed)
26+
id: list-changed
27+
run: |
28+
changed=$(ct list-changed --config=ct.yaml)
29+
if [[ -n "$changed" ]]; then
30+
echo "changed=true" >> "$GITHUB_OUTPUT"
31+
fi
32+
33+
- name: Run chart-testing (lint)
34+
if: steps.list-changed.outputs.changed == 'true'
35+
run: ct lint --config=ct.yaml
36+
37+
- name: Create kind cluster
38+
if: steps.list-changed.outputs.changed == 'true'
39+
uses: helm/kind-action@v1.10.0
40+
41+
- name: Run chart-testing (install)
42+
if: steps.list-changed.outputs.changed == 'true'
43+
run: ct install --config=ct.yaml
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- helm/**
8+
jobs:
9+
build-and-push-helm:
10+
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
11+
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Configure Git
22+
run: |
23+
git config user.name "$GITHUB_ACTOR"
24+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
25+
26+
- name: Install Helm
27+
uses: azure/setup-helm@v4.2.0
28+
29+
- name: Run chart-releaser
30+
uses: helm/chart-releaser-action@v1.6.0
31+
with:
32+
charts_dir: helm/charts
33+
mark_as_latest: false
34+
skip_existing: true
35+
env:
36+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ on:
55
branches:
66
- main
77
pull_request:
8-
branches:
9-
- feat/**
10-
- main
118

129
jobs:
13-
build:
10+
python-ci:
1411
runs-on: ubuntu-latest
1512
steps:
1613
#----------------------------------------------
@@ -20,8 +17,8 @@ jobs:
2017
- name: Set up Python
2118
uses: actions/setup-python@v5
2219
with:
23-
python-version: '3.12'
24-
architecture: 'x64'
20+
python-version: "3.12"
21+
architecture: "x64"
2522

2623
#----------------------------------------------
2724
# install & configure poetry

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
rev: v0.4.2
55
hooks:
66
- id: ruff
7-
args: [ --fix ]
7+
args: [--fix]
88
- id: ruff-format
99
- repo: https://github.com/pre-commit/pre-commit-hooks
1010
rev: v4.6.0
@@ -14,10 +14,10 @@ repos:
1414
- id: end-of-file-fixer
1515
- repo: local
1616
hooks:
17-
- id: pytest
18-
name: pytest
19-
entry: poetry run pytest --cov=src --cov-branch tests
20-
language: system
21-
types: [python]
22-
pass_filenames: false
23-
always_run: true
17+
- id: pytest
18+
name: pytest
19+
entry: poetry run pytest --cov=src --cov-branch tests
20+
language: system
21+
types: [python]
22+
pass_filenames: false
23+
always_run: true

.yamllint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends: default

chart_schema.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# https://github.com/helm/chart-testing/blob/main/etc/chart_schema.yaml
2+
# default chart schema used by ct
3+
---
4+
name: str()
5+
home: str(required=False)
6+
version: str()
7+
apiVersion: str()
8+
appVersion: any(str(), num(), required=False)
9+
description: str(required=False)
10+
keywords: list(str(), required=False)
11+
sources: list(str(), required=False)
12+
maintainers: list(include('maintainer'), required=False)
13+
dependencies: list(include('dependency'), required=False)
14+
icon: str(required=False)
15+
engine: str(required=False)
16+
condition: str(required=False)
17+
tags: str(required=False)
18+
deprecated: bool(required=False)
19+
kubeVersion: str(required=False)
20+
annotations: map(str(), str(), required=False)
21+
type: str(required=False)
22+
---
23+
maintainer:
24+
name: str()
25+
email: str(required=False)
26+
url: str(required=False)
27+
---
28+
dependency:
29+
name: str()
30+
version: str()
31+
repository: str(required=False)
32+
condition: str(required=False)
33+
tags: list(str(), required=False)
34+
enabled: bool(required=False)
35+
import-values: any(list(str()), list(include('import-value')), required=False)
36+
alias: str(required=False)
37+
---
38+
import-value:
39+
child: str()
40+
parent: str()

0 commit comments

Comments
 (0)