Skip to content

Commit

Permalink
feat(#3): add classic deployment and sepa config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Dec 7, 2023
1 parent d82bad9 commit 4f6222d
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 1 deletion.
9 changes: 9 additions & 0 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ data:
# secu_token: '$REG_SECRET_SECU_TOKEN'
# secu_secret: '$REG_SECRET_SECU_SECRET'
testing: {}
sepa:
account_owner: 'Awesome Convention, Inc.'
bank_name: 'Greedy Bank'
bank_address: '1 Money Drive, 6AC 1EU Fairyland'
iban: 'UK00100020003000400050'
bic: 'AABBCCDDUK'
subject_prefix: 'AWECON'
success_redirect: '{{ $public_base_url }}/register'
failure_redirect: '{{ $public_base_url }}/register'
choices:
flags:
{{- .Values.choices.flags | toYaml | nindent 8 }}
Expand Down
8 changes: 8 additions & 0 deletions templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@
"command" "/main"
"args" (list "--config=/config/config.yaml" "--migrate-database") -}}
{{- template "helpers.deployment" $paySrvInput }}
---
{{ $classicInput := dict "name" "regsys-classic"
"all" .Values
"component" .Values.system.components.regsys_classic
"secrets" (list "REG_SECRET_API_TOKEN" "REG_SECRET_NOSECOUNTER_TOKEN" "REG_SECRET_DD_TOKEN" "REG_SECRET_ARTSHOW_TOKEN" "REG_SECRET_BOAT_TOKEN" "REG_SECRET_SECU_TOKEN" "REG_SECRET_SECU_SECRET")
"command" "/usr/bin/java"
"args" (list "-jar" "/app/regsys-classic.jar") -}}
{{- template "helpers.deployment" $classicInput }}
9 changes: 9 additions & 0 deletions tests/configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ tests:
# secu_token: '$REG_SECRET_SECU_TOKEN'
# secu_secret: '$REG_SECRET_SECU_SECRET'
testing: {}
sepa:
account_owner: 'Awesome Convention, Inc.'
bank_name: 'Greedy Bank'
bank_address: '1 Money Drive, 6AC 1EU Fairyland'
iban: 'UK00100020003000400050'
bic: 'AABBCCDDUK'
subject_prefix: 'AWECON'
success_redirect: 'https://my.domain.example.com/hello/you/register'
failure_redirect: 'https://my.domain.example.com/hello/you/register'
choices:
flags:
guest:
Expand Down
103 changes: 102 additions & 1 deletion tests/deployments_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tests:
- isKind:
of: Deployment
- hasDocuments:
count: 5
count: 6
- equal:
path: metadata
value:
Expand Down Expand Up @@ -396,6 +396,107 @@ tests:
path: config.yaml
mode: 0444
documentIndex: 4
- equal:
path: metadata
value:
name: regsys-classic
labels:
app: regsys
service: regsys-classic
regsysChart: https://github.com/eurofurence/reg-helm-chart
documentIndex: 5
- equal:
path: spec
value:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: regsys
service: regsys-classic
regsysChart: https://github.com/eurofurence/reg-helm-chart
template:
metadata:
labels:
app: regsys
service: regsys-classic
regsysChart: https://github.com/eurofurence/reg-helm-chart
spec:
containers:
- name: application
image: 'ghcr.io/eurofurence/reg-regsys-classic:latest'
ports:
- containerPort: 8080
name: primary
readinessProbe:
httpGet:
port: primary
path: /
initialDelaySeconds: 2
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
memory: 256Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
command: [/usr/bin/java]
args:
- -jar
- /app/regsys-classic.jar
env:
- name: REG_SECRET_API_TOKEN
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_API_TOKEN
- name: REG_SECRET_NOSECOUNTER_TOKEN
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_NOSECOUNTER_TOKEN
- name: REG_SECRET_DD_TOKEN
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_DD_TOKEN
- name: REG_SECRET_ARTSHOW_TOKEN
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_ARTSHOW_TOKEN
- name: REG_SECRET_BOAT_TOKEN
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_BOAT_TOKEN
- name: REG_SECRET_SECU_TOKEN
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_SECU_TOKEN
- name: REG_SECRET_SECU_SECRET
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_SECU_SECRET
volumeMounts:
- name: config-file
mountPath: /config
readOnly: true
volumes:
- name: config-file
configMap:
name: regsys-cm
items:
- key: regsys-classic-config
path: config.yaml
mode: 0444
documentIndex: 5

- it: should not set namespace if unset
asserts:
Expand Down
52 changes: 52 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,32 @@
"description": "the context path to use after public_base_context. Must not include slashes, or the system will not work. Cannot be empty.",
"pattern": "^[^/]+$",
"default": "regsys"
},
"docker": {
"type": "object",
"additionalProperties": false,
"description": "container source configuration",
"properties": {
"registry": {
"type": "string",
"description": "the container registry to pull from",
"default": "ghcr.io"
},
"repository": {
"type": "string",
"description": "the path within the registry",
"default": "eurofurence/reg-regsys-classic"
},
"tag": {
"type": "string",
"description": "the version tag, unless overridden in the individual component.",
"default": "latest"
}
}
},
"labels": {
"type": "object",
"additionalProperties": true
}
}
},
Expand All @@ -601,6 +627,32 @@
"type": "boolean",
"description": "deploy the frontend",
"default": "true"
},
"docker": {
"type": "object",
"additionalProperties": false,
"description": "container source configuration",
"properties": {
"registry": {
"type": "string",
"description": "the container registry to pull from",
"default": "ghcr.io"
},
"repository": {
"type": "string",
"description": "the path within the registry",
"default": "eurofurence/reg-frontend"
},
"tag": {
"type": "string",
"description": "the version tag, unless overridden in the individual component.",
"default": "latest"
}
}
},
"labels": {
"type": "object",
"additionalProperties": true
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,21 @@ system:
regsys_classic:
enable: true
context_path: regsys
docker:
registry: ghcr.io
repository: eurofurence/reg-regsys-classic
tag: latest
labels:
service: regsys-classic

frontend:
enable: true
docker:
registry: ghcr.io
repository: eurofurence/reg-frontend
tag: latest
labels:
service: frontend

database:
use: 'inmemory'
Expand Down

0 comments on commit 4f6222d

Please sign in to comment.