feat: add vars and extend template funcs

This commit is contained in:
Kevin Franklin Kim
2024-09-24 13:41:16 +02:00
parent e811d29af8
commit e215c0dc32
23 changed files with 384 additions and 65 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ squadron:
- baz=baz
file: Dockerfile
tag: nightly
image: docker.mycompany.com/mycomapny/frontend
image: storefinder/frontend
values:
image:
repository: <% .Squadron.storefinder.frontend.builds.default.image %>
+2 -2
View File
@@ -15,8 +15,8 @@ squadron:
- baz=baz
file: Dockerfile
tag: nightly
image: docker.mycompany.com/mycomapny/frontend
image: storefinder/frontend
values:
image:
repository: docker.mycompany.com/mycomapny/frontend
repository: storefinder/frontend
tag: nightly
+1 -1
View File
@@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: storefinder-frontend
image: 'docker.mycompany.com/mycomapny/frontend:nightly'
image: 'storefinder/frontend:nightly'
ports:
- name: http
protocol: TCP
+2 -2
View File
@@ -8,7 +8,7 @@ squadron:
default:
tag: latest
file: Dockerfile
image: docker.mycompany.com/mycomapny/frontend
image: storefinder/frontend
build_arg:
- "foo=foo"
- "bar=bar"
@@ -22,7 +22,7 @@ squadron:
default:
tag: latest
file: Dockerfile
image: docker.mycompany.com/mycomapny/backend
image: storefinder/backend
build_arg:
- "foo=foo"
- "bar=bar"
+4 -3
View File
@@ -1,5 +1,6 @@
version: "2.0"
global:
enabled: true
host: mycompany.com
squadron:
storefinder:
@@ -11,7 +12,7 @@ squadron:
builds:
default:
tag: latest
image: docker.mycompany.com/mycomapny/frontend-admin
image: storefinder/backend
values:
image:
repository: <% .Squadron.storefinder.backend.builds.default.image %>
@@ -24,10 +25,10 @@ squadron:
builds:
default:
tag: latest
image: docker.mycompany.com/mycomapny/frontend
image: storefinder/frontend
values:
env:
BASE64: <% base64 "1234567890" %>
BASE64: <% "1234567890" | b64enc %>
DEFAULT_INDEX_VALUE: <% defaultIndex .Global "notexists" "fallback" %>
DEFAULT_VALUE: <% "" | default "fallback" %>
ENV: <% env "SHELL" %>
+5 -4
View File
@@ -1,5 +1,6 @@
version: "2.0"
global:
enabled: true
host: mycompany.com
squadron:
storefinder:
@@ -11,10 +12,10 @@ squadron:
builds:
default:
tag: latest
image: docker.mycompany.com/mycomapny/frontend-admin
image: storefinder/backend
values:
image:
repository: docker.mycompany.com/mycomapny/frontend-admin
repository: storefinder/backend
tag: latest
frontend:
chart:
@@ -24,7 +25,7 @@ squadron:
builds:
default:
tag: latest
image: docker.mycompany.com/mycomapny/frontend
image: storefinder/frontend
values:
env:
BASE64: MTIzNDU2Nzg5MA==
@@ -33,7 +34,7 @@ squadron:
ENV: /bin/zsh
GLOBAL: mycompany.com
image:
repository: docker.mycompany.com/mycomapny/frontend
repository: storefinder/frontend
tag: latest
values: |
foo: bar
+2 -2
View File
@@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: storefinder-backend
image: 'docker.mycompany.com/mycomapny/frontend-admin:latest'
image: 'storefinder/backend:latest'
ports:
- name: http
protocol: TCP
@@ -93,7 +93,7 @@ spec:
spec:
containers:
- name: storefinder-frontend
image: 'docker.mycompany.com/mycomapny/frontend:latest'
image: 'storefinder/frontend:latest'
ports:
- name: http
protocol: TCP
+4 -3
View File
@@ -2,6 +2,7 @@ version: "2.0"
global:
host: mycompany.com
enabled: true
squadron:
storefinder:
@@ -10,7 +11,7 @@ squadron:
builds:
default:
tag: latest
image: docker.mycompany.com/mycomapny/frontend
image: storefinder/frontend
values:
image:
tag: <% .Squadron.storefinder.frontend.builds.default.tag %>
@@ -18,7 +19,7 @@ squadron:
env:
ENV: <% env "SHELL" %>
GLOBAL: <% .Global.host %>
BASE64: <% base64 "1234567890" %>
BASE64: <% "1234567890" | b64enc %>
DEFAULT_VALUE: <% "" | default "fallback" %>
DEFAULT_INDEX_VALUE: <% defaultIndex .Global "notexists" "fallback" %>
# ONE_PASSWORD: <% op "ACCOUNT_NAME" "UUID" "FIELD" %>
@@ -31,7 +32,7 @@ squadron:
builds:
default:
tag: latest
image: docker.mycompany.com/mycomapny/frontend-admin
image: storefinder/backend
values:
image:
tag: <% .Squadron.storefinder.backend.builds.default.tag %>
+26
View File
@@ -0,0 +1,26 @@
version: "2.0"
vars:
bar:
- one
- two
baz: null
foo: two
squadron:
storefinder:
backend:
chart:
name: backend
repository: file://<% env "PROJECT_ROOT" %>/_examples/common/charts/backend
version: 0.0.1
builds:
default:
tag: latest
image: storefinder/backend
values:
env:
bar: <% .Vars.bar %>
baz: <% .Vars.baz %>
foo: <% .Vars.foo %>
image:
repository: <% .Squadron.storefinder.backend.builds.default.image %>
tag: <% .Squadron.storefinder.backend.builds.default.tag %>
+26
View File
@@ -0,0 +1,26 @@
version: "2.0"
vars:
bar:
- one
- two
baz: null
foo: two
squadron:
storefinder:
backend:
chart:
name: backend
repository: file://./_examples/common/charts/backend
version: 0.0.1
builds:
default:
tag: latest
image: storefinder/backend
values:
env:
bar: [one two]
baz: <no value>
foo: two
image:
repository: storefinder/backend
tag: latest
+50
View File
@@ -0,0 +1,50 @@
---
# Source: backend/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: storefinder-backend
labels:
app.kubernetes.io/name: storefinder-backend
app.kubernetes.io/component: backend
app.kubernetes.io/managed-by: Helm
helm.sh/chart: 'backend-0.0.1'
namespace: default
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: storefinder-backend
app.kubernetes.io/component: backend
ports:
- name: http
port: 80
---
# Source: backend/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: storefinder-backend
labels:
app.kubernetes.io/name: storefinder-backend
app.kubernetes.io/component: backend
app.kubernetes.io/managed-by: Helm
helm.sh/chart: 'backend-0.0.1'
namespace: default
spec:
selector:
matchLabels:
app.kubernetes.io/name: storefinder-backend
app.kubernetes.io/component: backend
template:
metadata:
labels:
app.kubernetes.io/name: storefinder-backend
app.kubernetes.io/component: backend
spec:
containers:
- name: storefinder-backend
image: 'storefinder/backend:latest'
ports:
- name: http
protocol: TCP
containerPort: 80
+6
View File
@@ -0,0 +1,6 @@
version: "2.0"
vars:
foo: "two"
bar: ["two"]
baz: ~
+23
View File
@@ -0,0 +1,23 @@
version: "2.0"
vars:
foo: "one"
bar: ["one"]
baz: "one"
squadron:
storefinder:
backend:
chart: <% env "PROJECT_ROOT" %>/_examples/common/charts/backend
builds:
default:
tag: latest
image: storefinder/backend
values:
image:
tag: <% .Squadron.storefinder.backend.builds.default.tag %>
repository: <% .Squadron.storefinder.backend.builds.default.image %>
env:
foo: <% .Vars.foo %>
bar: <% .Vars.bar %>
baz: <% .Vars.baz %>