Skip to content

Commit

Permalink
feat: first MVP (#1)
Browse files Browse the repository at this point in the history
* feat: first draft

* feat: implement the volumeClaims feature

* fix: correct indentation in values.yaml file

* fix: correct indentation in values.yaml file/2

* fix: failing unit tests

* feat: add tests related to volumeClaims

---------

Co-authored-by: Andrei Petrov <andrei.petrov@jetbrains.com>
  • Loading branch information
apetrovYa and apetrovYa committed Jan 25, 2024
1 parent 53fabf6 commit 50a17bf
Show file tree
Hide file tree
Showing 47 changed files with 5,212 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
groups:
actions:
update-types:
- "minor"
- "patch"
43 changes: 43 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Lint and Test Chart

on: pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: d3adb5/helm-unittest-action@v2
with:
helm-version: v3.8.0
github-token: ${{ secrets.GITHUB_TOKEN }}
flags: "--color -f './tests/*/*.yaml'"
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1

- uses: actions/setup-python@v5
with:
python-version: '3.10'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (lint)
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --chart-dirs . --charts .

- name: Create kind cluster
uses: helm/kind-action@v1.8.0

- name: Run chart-testing (install)
run: ct install --target-branch ${{ github.event.repository.default_branch }} --chart-dirs . --charts .
63 changes: 63 additions & 0 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Upload Chart

on:
workflow_dispatch:
push:
branches:
- main

jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1

- uses: actions/setup-python@v4
with:
python-version: '3.10'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.0

- name: Run chart release
run: |
touch .env
echo "HELM_CHARTS_REGISTRY_USERNAME=${{ secrets.HELM_CHARTS_REGISTRY_USERNAME }}" >> .env
echo "HELM_CHARTS_REGISTRY_PASSWORD=${{ secrets.HELM_CHARTS_REGISTRY_PASSWORD }}" >> .env
docker run \
-v "$PWD:/app/chart:rw" \
--env-file .env --entrypoint bash quay.io/andov_go/helm-packager:latest \
-c "make dependencies"
docker run \
-v "$PWD:/app/chart:rw" \
--env-file .env quay.io/andov_go/helm-packager:latest \
release
- name: Parse the Chart.yaml file
uses: jbutcher5/read-yaml@main
id: parse-chart-yaml
with:
file: ${{ github.workspace }}/Chart.yaml
key-path: '["version"]'

- name: Set the tag
id: set-tag-number
run: |
echo "Chart Version: ${{steps.parse-chart-yaml.outputs.data}}"
echo "version=${{steps.parse-chart-yaml.outputs.data}}" >> "$GITHUB_OUTPUT"
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.idea/
.vscode/
.env
**/.helm_output
**/*.tgz
*/*/charts
**/*.bkp
**/*.bak
**/*.dtmp
**/.DS_Store
**/100
**/Chart.lock
**/*/__snapshot__
**/.envrc
**/.direnv
**/local.nix
**/values
**/examples
61 changes: 61 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Remove release files
release.json
# Remove ignore files
.gitignore
.helmignore

# Remove all shell scripts
*.sh

# Remove all resulting packages
./*.tgz
./.
./..
.cache
# Just in case if someone forgets to remove their local.properties file
*.properties

# Internal cluster values
values/

# Rendered templates
rendered/

# Got it from the Internet
# 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/
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
.helm-docs
.helm_output
*.md
.env
Makefile
*.lock
examples/
unittests/
tests/
values.schema.json
schema.values.json
# Docs related
#README.md
LICENSE

ct.yaml
22 changes: 22 additions & 0 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v2
name: kubernetes-stateful-chart
description: A Generic Helm chart for a stateful Kubernetes application
type: application
version: 1.0.0
appVersion: 1.0.0
icon: https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png
annotations:
category: Infrastructure
keywords:
- golden-chart
- helper
- template
maintainers:
- name: andov
url: https://github.com/apetrovYa
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
- bitnami-common
version: 1.x.x
Loading

0 comments on commit 50a17bf

Please sign in to comment.