Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit 0e300a8

Browse files
committed
feat: added helm chart
1 parent 3e116a7 commit 0e300a8

15 files changed

Lines changed: 756 additions & 18 deletions

.github/workflows/commitlint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33
pull_request:
44
branches:
55
- "**"
6+
push:
7+
branches:
8+
- main
9+
- beta
10+
611
jobs:
712
commitlint:
813
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,53 @@
11
name: Release
2+
23
on:
3-
push:
4+
workflow_run:
5+
workflows: ["Lint Commit Messages"]
46
branches:
57
- main
68
- beta
9+
types:
10+
- completed
11+
12+
env:
13+
REGISTRY: ghcr.io
714

815
jobs:
9-
release:
16+
on-success:
1017
name: Release
1118
runs-on: ubuntu-latest
1219
steps:
1320
- name: Checkout
1421
uses: actions/checkout@v3
1522
with:
1623
fetch-depth: 0
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: "lts/*"
29+
30+
- name: Setup helm
31+
uses: azure/setup-helm@v3
32+
with:
33+
version: "v3.11.1"
34+
35+
- name: Log in to the Container registry
36+
uses: docker/login-action@v2
37+
with:
38+
registry: ${{ env.REGISTRY }}
39+
username: ${{ github.actor }}
40+
password: ${{ secrets.PACKAGES_TOKEN }}
41+
1742
- name: Release
1843
env:
1944
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
run: npx semantic-release
45+
GITHUB_USER: ${{ github.actor }}
46+
REGISTRY_USERNAME: ${{ github.actor }}
47+
REGISTRY_PASSWORD: ${{ secrets.PACKAGES_TOKEN }}
48+
run: |-
49+
#!/bin/bash
50+
set -e
51+
# add more plugins: https://semantic-release.gitbook.io/semantic-release/extending/plugins-list
52+
npm install @semantic-release/exec @semantic-release/git semantic-release-helm3 -D
53+
npx -c semantic-release

.releaserc.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"branches": [
3+
{
4+
"name": "main"
5+
},
6+
{
7+
"name": "beta",
8+
"prerelease": true
9+
}
10+
],
11+
"plugins": [
12+
"@semantic-release/commit-analyzer",
13+
[
14+
"@semantic-release/exec",
15+
{
16+
"prepareCmd": "make install-helmify && make helm"
17+
}
18+
],
19+
[
20+
"semantic-release-helm3",
21+
{
22+
"chartPath": "./charts/edgefarm-applications",
23+
"registry": "ghcr.io/edgefarm/edgefarm.applications"
24+
}
25+
],
26+
[
27+
"@semantic-release/git",
28+
{
29+
"assets": [
30+
"charts/edgefarm-applications/Chart.yaml",
31+
"charts/edgefarm-applications/templates/edgefarm-applications.yaml",
32+
"charts/edgefarm-applications/templates/edgefarm-network-trait.yaml",
33+
"charts/edgefarm-applications/templates/edgefarm-storage-trait.yaml"
34+
],
35+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
36+
}
37+
],
38+
"@semantic-release/release-notes-generator",
39+
[
40+
"@semantic-release/github",
41+
{
42+
"successComment": false,
43+
"failTitle": false
44+
}
45+
]
46+
]
47+
}

.releaserc.yaml

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

Makefile

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
all: render deploy ## renders and deploys all templates into the current k8s cluster
1+
NAMESPACE=edgefarm-applications
2+
all: render deploy helm ## renders and deploys all templates into the current k8s cluster
23
render: traits-render components-render ## renders all templates
34
apply: traits-apply components-apply ## applies all templates
45
deploy: traits-deploy components-deploy ## deploys all templates
@@ -17,23 +18,43 @@ traits-apply: ## applies all traits using vela cli
1718
@vela def apply cue/traits/edgefarm-storage-trait.cue
1819

1920
traits-deploy: ## deploys all traits using kubectl
20-
kubectl apply -n vela-system -f manifests/vela-caps/traits/edgefarm-network-trait.yaml
21-
kubectl apply -n vela-system -f manifests/vela-caps/traits/edgefarm-storage-trait.yaml
21+
kubectl apply -n $(NAMESPACE) -f manifests/vela-caps/traits/edgefarm-network-trait.yaml
22+
kubectl apply -n $(NAMESPACE) -f manifests/vela-caps/traits/edgefarm-storage-trait.yaml
2223

2324
components-render: ## renders all components
2425
@vela def vet cue/components/edgefarm-applications.cue
2526
@vela def render cue/components/edgefarm-applications.cue -o manifests/vela-caps/components/edgefarm-applications.yaml
2627
components-apply: ## applies all components using vela cli
2728
@vela def apply cue/components/edgefarm-applications.cue
2829
components-deploy: ## deploys all components using kubectl
29-
kubectl apply -n vela-system -f manifests/vela-caps/components/edgefarm-applications.yaml
30-
30+
kubectl apply -n $(NAMESPACE) -f manifests/vela-caps/components/edgefarm-applications.yaml
31+
32+
helm: ## generate helm chart. Version is incremented using semantic-release and github actions
33+
$(eval TEMPD := $(shell mktemp -d))
34+
$(eval ROOTPWD := $(shell pwd))
35+
@cd $(TEMPD)
36+
@helmify -f $(ROOTPWD)/manifests/vela-caps/components/edgefarm-applications.yaml -f $(ROOTPWD)/manifests/vela-caps/traits/edgefarm-storage-trait.yaml -f $(ROOTPWD)/manifests/vela-caps/traits/edgefarm-network-trait.yaml $(TEMPD)/edgefarm-applications
37+
@sed -i 's/name: {{ include "edgefarm-applications.fullname" . }}-applications/name: edgefarm-applications/g' $(TEMPD)/edgefarm-applications/templates/edgefarm-applications.yaml
38+
@sed -i 's/name: {{ include "edgefarm-applications.fullname" . }}-network/name: edgefarm-network/g' $(TEMPD)/edgefarm-applications/templates/edgefarm-network-trait.yaml
39+
@sed -i 's/name: {{ include "edgefarm-applications.fullname" . }}-storage/name: edgefarm-storage/g' $(TEMPD)/edgefarm-applications/templates/edgefarm-storage-trait.yaml
40+
@cp -r $(TEMPD)/edgefarm-applications/templates/* $(ROOTPWD)/charts/edgefarm-applications/templates
41+
@rm -r $(TEMPD)
42+
@cd $(ROOTPWD)
43+
@helm dependency update charts/edgefarm-applications
3144

3245
install-vela: ## install kubevela
33-
@VELA_VERSION=v1.8.0
34-
@curl -fsSl https://kubevela.io/script/install.sh | bash -s ${VELA_VERSION}
46+
# Make sure to also modify the version of vela-core in charts/edgefarm-applications/Chart.yaml
47+
@curl -fsSl https://kubevela.io/script/install.sh | bash -s v1.8.0
3548
@vela install
3649

50+
install-helmify: ## install helmify
51+
$(eval TEMPD := $(shell mktemp -d))
52+
@curl -L https://github.com/arttor/helmify/releases/download/v0.4.5/helmify_Linux_x86_64.tar.gz -o $(TEMPD)/helmify.tar.gz && \
53+
tar -xzf $(TEMPD)/helmify.tar.gz -C /$(TEMPD) && \
54+
mv $(TEMPD)/helmify /usr/local/bin/helmify && \
55+
chmod +x /usr/local/bin/helmify
56+
@rm -r $(TEMPD)
57+
3758
help: ## show help message
3859
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make [target]\033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m\t %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
3960

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: vela-core
3+
repository: https://charts.kubevela.net/core
4+
version: 1.8.0
5+
digest: sha256:2e16553d56d88c8f3f484eddb29667b95aa5f34dbfd084da8fe418262cc0dfd7
6+
generated: "2023-07-17T13:17:31.317729297+02:00"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v2
2+
name: edgefarm-applications
3+
description: A Helm chart for edgefarm.applications.
4+
5+
type: application
6+
version: 0.1.0
7+
appVersion: "0.1.0"
8+
9+
keywords:
10+
- edgefarm.applications
11+
- kubevela
12+
13+
sources:
14+
- https://github.com/edgefarm/edgefarm.applications
15+
16+
maintainers:
17+
- name: Armin Schlegel
18+
email: armin.schlegel@gmx.de
19+
20+
dependencies:
21+
- name: vela-core
22+
version: 1.8.0
23+
repository: https://charts.kubevela.net/core
113 KB
Binary file not shown.

0 commit comments

Comments
 (0)