Skip to content

Commit 61efb47

Browse files
committed
Added helm chart.
1 parent 56d4eee commit 61efb47

20 files changed

+937
-129
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
- name: Set up Python
2222
run: uv python install 3.12
2323

24+
- name: Set up Helm
25+
uses: azure/setup-helm@v4
26+
2427
- name: Cache pre-commit
2528
uses: actions/cache@v4
2629
with:

.github/workflows/docker-release.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/docker-test.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
CHART_NAME: eoapi-notifier
11+
12+
jobs:
13+
release:
14+
name: Release Docker and Helm
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v5
23+
24+
- name: Extract version
25+
id: version
26+
run: |
27+
VERSION=${GITHUB_REF#refs/tags/v}
28+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Set up Helm
34+
uses: azure/setup-helm@v4
35+
36+
- name: Log in to registry
37+
uses: docker/login-action@v3
38+
with:
39+
registry: ${{ env.REGISTRY }}
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Extract Docker metadata
44+
id: meta
45+
uses: docker/metadata-action@v5
46+
with:
47+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
48+
tags: |
49+
type=ref,event=tag
50+
type=raw,value=latest,enable={{is_default_branch}}
51+
52+
- name: Build and push Docker image
53+
uses: docker/build-push-action@v6
54+
with:
55+
context: .
56+
platforms: linux/amd64,linux/arm64
57+
push: true
58+
tags: ${{ steps.meta.outputs.tags }}
59+
labels: ${{ steps.meta.outputs.labels }}
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max
62+
63+
- name: Update Chart.yaml
64+
run: |
65+
sed -i "s/^version:.*/version: ${{ steps.version.outputs.version }}/" helm-chart/${{ env.CHART_NAME }}/Chart.yaml
66+
sed -i "s/^appVersion:.*/appVersion: \"${{ steps.version.outputs.version }}\"/" helm-chart/${{ env.CHART_NAME }}/Chart.yaml
67+
68+
- name: Lint and package Helm chart
69+
run: |
70+
helm lint helm-chart/${{ env.CHART_NAME }}
71+
helm package helm-chart/${{ env.CHART_NAME }} --destination .
72+
73+
- name: Push Helm chart
74+
run: |
75+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ env.REGISTRY }} --username ${{ github.actor }} --password-stdin
76+
helm push ${{ env.CHART_NAME }}-${{ steps.version.outputs.version }}.tgz oci://${{ env.REGISTRY }}/${{ github.repository_owner }}/charts

.github/workflows/test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
paths:
8+
- 'Dockerfile'
9+
- '.dockerignore'
10+
- 'pyproject.toml'
11+
- 'uv.lock'
12+
- 'eoapi_notifier/**'
13+
- 'helm-chart/**'
14+
- 'tests/**'
15+
- '.github/workflows/test.yml'
16+
17+
env:
18+
IMAGE_NAME: eoapi-notifier
19+
20+
jobs:
21+
test:
22+
name: Test Docker and Helm
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v5
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.12'
33+
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v4
36+
37+
- name: Install dependencies
38+
run: uv sync
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
43+
- name: Set up Helm
44+
uses: azure/setup-helm@v4
45+
46+
- name: Build Docker image
47+
uses: docker/build-push-action@v6
48+
with:
49+
context: .
50+
push: false
51+
load: true
52+
tags: ${{ env.IMAGE_NAME }}:test
53+
cache-from: type=gha
54+
cache-to: type=gha,mode=max
55+
56+
- name: Test Docker image
57+
run: |
58+
docker run --rm ${{ env.IMAGE_NAME }}:test --help
59+
docker run --rm ${{ env.IMAGE_NAME }}:test --version
60+
docker run --rm ${{ env.IMAGE_NAME }}:test /nonexistent/config.yaml || echo "Expected error handled"
61+
62+
- name: Test Helm chart
63+
run: |
64+
helm lint helm-chart/eoapi-notifier
65+
helm template test helm-chart/eoapi-notifier --debug > /dev/null
66+
echo "✅ Helm chart linting and templating passed"

.pre-commit-config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ repos:
2323
hooks:
2424
- id: pytest-coverage
2525
name: Tests with coverage
26-
entry: uv run python -m pytest
26+
entry: uv run python -m pytest --ignore=tests/test_helm.py
2727
language: system
2828
types: [python]
2929
pass_filenames: false
3030
always_run: true
31+
- id: helm-lint
32+
name: Helm lint
33+
entry: helm lint helm-chart/eoapi-notifier
34+
language: system
35+
files: ^helm-chart/
36+
pass_filenames: false
37+

.yamllint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ ignore: |
5959
*.min.yaml
6060
# Ignore GitHub Actions workflows (handled by actionlint)
6161
.github/workflows/
62+
# Ignore Helm chart templates (contain Go templating syntax)
63+
helm-chart/

CONTRIBUTING.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Contributing
2+
3+
## Setup
4+
5+
```bash
6+
git clone https://github.com/developmentseed/eoapi-notifier.git
7+
cd eoapi-notifier
8+
uv sync
9+
uv run pre-commit install
10+
```
11+
12+
## Testing
13+
14+
```bash
15+
# Run tests
16+
uv run pytest
17+
18+
# Test Docker
19+
docker build -t eoapi-notifier:test .
20+
docker run --rm eoapi-notifier:test --help
21+
22+
# Test Helm chart
23+
helm lint helm-chart/eoapi-notifier
24+
helm template test helm-chart/eoapi-notifier
25+
26+
# Run Helm chart tests (requires running Kubernetes cluster)
27+
helm install test-release helm-chart/eoapi-notifier
28+
helm test test-release
29+
helm uninstall test-release
30+
```
31+
32+
## Releases
33+
34+
Create and push a tag to trigger automated release:
35+
36+
```bash
37+
git tag v1.0.0
38+
git push origin v1.0.0
39+
```
40+
41+
This automatically:
42+
- Builds and pushes Docker image to `ghcr.io/developmentseed/eoapi-notifier`
43+
- Publishes Helm chart to `oci://ghcr.io/developmentseed/charts/eoapi-notifier`
44+
45+
## Code Style
46+
47+
- Use `uv run ruff format` and `uv run ruff check --fix`
48+
- Add type hints for new code
49+
- Pre-commit hooks enforce style
50+
51+
## Pull Requests
52+
53+
1. Create feature branch
54+
2. Make changes with tests
55+
3. Ensure `uv run pytest` and pre-commit hooks pass
56+
4. Submit PR with clear description

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ outputs:
6969
7070
See [examples/config.yaml](./examples/config.yaml) for a complete configuration example with all available options.
7171
72+
## Kubernetes Deployment
73+
74+
```bash
75+
# Install with Helm
76+
helm install eoapi-notifier oci://ghcr.io/developmentseed/charts/eoapi-notifier
77+
78+
# With custom values
79+
helm install eoapi-notifier oci://ghcr.io/developmentseed/charts/eoapi-notifier -f values.yaml
80+
```
81+
82+
See [Helm Chart README](helm-chart/eoapi-notifier/README.md) for configuration options.
83+
7284
### Available Plugins
7385

7486
#### Sources

0 commit comments

Comments
 (0)