Skip to content

Commit

Permalink
fix(garden): 🐛 fix garden configurations
Browse files Browse the repository at this point in the history
for desktop app and bio-api

Signed-off-by: Manuel Ruck <[email protected]>
  • Loading branch information
Manuel Ruck committed Aug 18, 2024
1 parent 66aa79a commit cf2293a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 61 deletions.
61 changes: 31 additions & 30 deletions bundestag.io/api/garden.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
kind: Build
name: import-procedures
description: Import procedures for the bundestag.io API
name: bundestag-io-api
type: container
source:
path: ../../../
path: ../../
include:
- ./**/*
- ./infra/Dockerfile
spec:
dockerfile: ./infra/Dockerfile
targetStage:
$if: ${this.mode == "sync"}
$then: dev
$else: runner
buildArgs:
NODE_VERSION: 18.18.2
SERVICE: crawler
SERVICE_PATH: services/cron-jobs/crawler
SERVICE: bundestag.io
SERVICE_PATH: bundestag.io/api

---
kind: Deploy
name: import-procedures
name: bundestag-io-api
type: kubernetes
description: Deploy the importer of procedures for the bundestag.io API
dependencies: [build.import-procedures, deploy.mongo]

disabled: ${!(environment.name == "prod" || environment.name == "local-prod")}

varfiles:
- .env
- .env.local
dependencies:
- build.bundestag-io-api

variables:
DB_URL: mongodb://democracy-mongo:27017/bundestagio
BIO_EDIT_TOKEN: 'TOP_SECRET_LOCAL_TOKEN'

spec:
files:
- ./manifests/*
files: [./manifests/*] # <--- Tell Garden what manifests to use

defaultTarget: # <--- This tells Garden what "target" to use for logs, code syncing and more
kind: Deployment
name: bundestag-io-api

sync:
paths:
- containerPath: /app/bundestag.io/api/src
sourcePath: src
mode: one-way
overrides:
- command: [pnpm, dev]

patchResources:
- name: import-procedures
kind: CronJob
- name: bundestag-io-api
kind: Deployment
patch:
spec:
jobTemplate:
template:
spec:
template:
spec:
containers:
- name: import-procedures
image: ${actions.build.import-procedures.outputs.deploymentImageId} # <--- Reference the output from the Build action

- name: dip-api-token
kind: Secret
patch:
data:
DIP_API_KEY: ${base64Encode(var.DIP_API_KEY)}
containers:
- name: bundestag-io-api
image: ${actions.build.bundestag-io-api.outputs.deploymentImageId}
60 changes: 29 additions & 31 deletions democracy/desktop/garden.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
kind: Build
name: import-procedures
description: Import procedures for the bundestag.io API
name: democracy-desktop
type: container
source:
path: ../../../
path: ../../
include:
- ./**/*
- ./infra/Dockerfile
spec:
dockerfile: ./infra/Dockerfile
targetStage:
$if: ${this.mode == "sync"}
$then: dev
$else: runner
buildArgs:
NODE_VERSION: 18.18.2
SERVICE: crawler
SERVICE_PATH: services/cron-jobs/crawler
SERVICE: democracy-app.de
SERVICE_PATH: democracy/desktop

---
kind: Deploy
name: import-procedures
name: democracy-desktop
type: kubernetes
description: Deploy the importer of procedures for the bundestag.io API
dependencies: [build.import-procedures, deploy.mongo]

disabled: ${!(environment.name == "prod" || environment.name == "local-prod")}
dependencies:
- build.democracy-desktop

varfiles:
- .env
- .env.local
spec:
files: [./manifests/*] # <--- Tell Garden what manifests to use

variables:
DB_URL: mongodb://democracy-mongo:27017/bundestagio
defaultTarget: # <--- This tells Garden what "target" to use for logs, code syncing and more
kind: Deployment
name: democracy-desktop

spec:
files:
- ./manifests/*
sync:
paths:
- containerPath: /app/democracy/desktop/src
sourcePath: src
mode: one-way
overrides:
- command: [pnpm, dev]

patchResources:
- name: import-procedures
kind: CronJob
- name: democracy-desktop
kind: Deployment
patch:
spec:
jobTemplate:
template:
spec:
template:
spec:
containers:
- name: import-procedures
image: ${actions.build.import-procedures.outputs.deploymentImageId} # <--- Reference the output from the Build action

- name: dip-api-token
kind: Secret
patch:
data:
DIP_API_KEY: ${base64Encode(var.DIP_API_KEY)}
containers:
- name: democracy-desktop
image: ${actions.build.democracy-desktop.outputs.deploymentImageId}

0 comments on commit cf2293a

Please sign in to comment.