From 7c3c8118184468186030efc78d2617ff464b541a Mon Sep 17 00:00:00 2001 From: Manuel Ruck Date: Sat, 4 May 2024 20:21:36 +0200 Subject: [PATCH] chore: enable cronjobs only on prod-(near) environments Signed-off-by: Manuel Ruck --- project.garden.yml | 7 ++++++- services/cron-jobs/cleanup-push-queue/garden.yml | 2 ++ services/cron-jobs/crawler/garden.yml | 6 ++++-- .../cron-jobs/import-conference-week-details/garden.yml | 2 ++ services/cron-jobs/import-deputy-profiles/garden.yml | 2 ++ services/cron-jobs/import-named-poll-deputies/garden.yml | 2 ++ services/cron-jobs/import-named-polls/garden.yml | 2 ++ services/cron-jobs/import-plenary-minutes/garden.yml | 2 ++ services/cron-jobs/index-sync-bundestagio/garden.yml | 2 ++ services/cron-jobs/index-sync-democracy/garden.yml | 2 ++ services/cron-jobs/push-send-queued/garden.yml | 2 ++ services/cron-jobs/queue-pushs-conference-week/garden.yml | 2 ++ .../cron-jobs/queue-pushs-vote-conference-week/garden.yml | 2 ++ services/cron-jobs/queue-pushs-vote-top-100/garden.yml | 2 ++ services/cron-jobs/shedule-bio-resync/garden.yml | 2 ++ services/cron-jobs/sync-deputy-profiles/garden.yml | 2 ++ services/cron-jobs/sync-named-polls/garden.yml | 2 ++ services/cron-jobs/sync-procedures/garden.yml | 2 ++ 18 files changed, 42 insertions(+), 3 deletions(-) diff --git a/project.garden.yml b/project.garden.yml index 80f28b26..aeb676bf 100644 --- a/project.garden.yml +++ b/project.garden.yml @@ -13,7 +13,12 @@ environments: variables: # hostname: local.democracy-app.de hostname: local.app.garden + - name: local-prod + defaultNamespace: ${var.userNamespace} + variables: + # hostname: local.democracy-app.de + hostname: local.app.garden providers: - name: local-kubernetes - environments: [local] + environments: [local, local-prod] diff --git a/services/cron-jobs/cleanup-push-queue/garden.yml b/services/cron-jobs/cleanup-push-queue/garden.yml index 62d1eb48..d03a7b95 100644 --- a/services/cron-jobs/cleanup-push-queue/garden.yml +++ b/services/cron-jobs/cleanup-push-queue/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.cleanup-push-queue, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy diff --git a/services/cron-jobs/crawler/garden.yml b/services/cron-jobs/crawler/garden.yml index 336a4e9c..0981c991 100644 --- a/services/cron-jobs/crawler/garden.yml +++ b/services/cron-jobs/crawler/garden.yml @@ -21,6 +21,8 @@ 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 @@ -29,9 +31,9 @@ variables: DB_URL: mongodb://democracy-mongo:27017/bundestagio spec: - files: [./manifests/*] # <--- Tell Garden what manifests to use + files: + - ./manifests/* - # Patch the K8s manifests for the api service so that we can set the correct image patchResources: - name: import-procedures kind: CronJob diff --git a/services/cron-jobs/import-conference-week-details/garden.yml b/services/cron-jobs/import-conference-week-details/garden.yml index 0d52e606..556cbf63 100644 --- a/services/cron-jobs/import-conference-week-details/garden.yml +++ b/services/cron-jobs/import-conference-week-details/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.import-conference-week-details, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/bundestagio diff --git a/services/cron-jobs/import-deputy-profiles/garden.yml b/services/cron-jobs/import-deputy-profiles/garden.yml index 4d184031..2f46aff3 100644 --- a/services/cron-jobs/import-deputy-profiles/garden.yml +++ b/services/cron-jobs/import-deputy-profiles/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.import-deputy-profiles, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/bundestagio diff --git a/services/cron-jobs/import-named-poll-deputies/garden.yml b/services/cron-jobs/import-named-poll-deputies/garden.yml index 7aca288b..b2d4b148 100644 --- a/services/cron-jobs/import-named-poll-deputies/garden.yml +++ b/services/cron-jobs/import-named-poll-deputies/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.import-named-poll-deputies, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/bundestagio diff --git a/services/cron-jobs/import-named-polls/garden.yml b/services/cron-jobs/import-named-polls/garden.yml index 404c8af9..af862b57 100644 --- a/services/cron-jobs/import-named-polls/garden.yml +++ b/services/cron-jobs/import-named-polls/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.import-named-polls, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/bundestagio diff --git a/services/cron-jobs/import-plenary-minutes/garden.yml b/services/cron-jobs/import-plenary-minutes/garden.yml index a243de0c..4684a6dd 100644 --- a/services/cron-jobs/import-plenary-minutes/garden.yml +++ b/services/cron-jobs/import-plenary-minutes/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.import-plenary-minutes, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/bundestagio diff --git a/services/cron-jobs/index-sync-bundestagio/garden.yml b/services/cron-jobs/index-sync-bundestagio/garden.yml index 3c351f60..dbe044b0 100644 --- a/services/cron-jobs/index-sync-bundestagio/garden.yml +++ b/services/cron-jobs/index-sync-bundestagio/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.index-sync-bundestagio, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/bundestagio diff --git a/services/cron-jobs/index-sync-democracy/garden.yml b/services/cron-jobs/index-sync-democracy/garden.yml index e0fc19ab..fc441651 100644 --- a/services/cron-jobs/index-sync-democracy/garden.yml +++ b/services/cron-jobs/index-sync-democracy/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.index-sync-democracy, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy diff --git a/services/cron-jobs/push-send-queued/garden.yml b/services/cron-jobs/push-send-queued/garden.yml index bbbea008..f59ea276 100644 --- a/services/cron-jobs/push-send-queued/garden.yml +++ b/services/cron-jobs/push-send-queued/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.push-send-queued, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + varfiles: - .env diff --git a/services/cron-jobs/queue-pushs-conference-week/garden.yml b/services/cron-jobs/queue-pushs-conference-week/garden.yml index 14a5971c..91880c1e 100644 --- a/services/cron-jobs/queue-pushs-conference-week/garden.yml +++ b/services/cron-jobs/queue-pushs-conference-week/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.queue-pushs-conference-week, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy diff --git a/services/cron-jobs/queue-pushs-vote-conference-week/garden.yml b/services/cron-jobs/queue-pushs-vote-conference-week/garden.yml index fd42fd69..ce12008d 100644 --- a/services/cron-jobs/queue-pushs-vote-conference-week/garden.yml +++ b/services/cron-jobs/queue-pushs-vote-conference-week/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.queue-pushs-vote-conference-week, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy diff --git a/services/cron-jobs/queue-pushs-vote-top-100/garden.yml b/services/cron-jobs/queue-pushs-vote-top-100/garden.yml index 9905b9f8..a48c35aa 100644 --- a/services/cron-jobs/queue-pushs-vote-top-100/garden.yml +++ b/services/cron-jobs/queue-pushs-vote-top-100/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.queue-pushs-vote-top-100, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy diff --git a/services/cron-jobs/shedule-bio-resync/garden.yml b/services/cron-jobs/shedule-bio-resync/garden.yml index 25993958..5385add1 100644 --- a/services/cron-jobs/shedule-bio-resync/garden.yml +++ b/services/cron-jobs/shedule-bio-resync/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.shedule-bio-resync, deploy.mongo] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy diff --git a/services/cron-jobs/sync-deputy-profiles/garden.yml b/services/cron-jobs/sync-deputy-profiles/garden.yml index c1a47d37..5320c959 100644 --- a/services/cron-jobs/sync-deputy-profiles/garden.yml +++ b/services/cron-jobs/sync-deputy-profiles/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.sync-deputy-profiles, deploy.mongo, deploy.bundestag-io-api] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy BUNDESTAGIO_SERVER_URL: http://bundestag-io-api diff --git a/services/cron-jobs/sync-named-polls/garden.yml b/services/cron-jobs/sync-named-polls/garden.yml index 1bf8d7fc..e721a468 100644 --- a/services/cron-jobs/sync-named-polls/garden.yml +++ b/services/cron-jobs/sync-named-polls/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.sync-named-polls, deploy.mongo, deploy.bundestag-io-api] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy BUNDESTAGIO_SERVER_URL: http://bundestag-io-api diff --git a/services/cron-jobs/sync-procedures/garden.yml b/services/cron-jobs/sync-procedures/garden.yml index 5f64b511..5a05f4b1 100644 --- a/services/cron-jobs/sync-procedures/garden.yml +++ b/services/cron-jobs/sync-procedures/garden.yml @@ -21,6 +21,8 @@ type: kubernetes description: Deploy the importer of procedures for the bundestag.io API dependencies: [build.sync-procedures, deploy.mongo, deploy.bundestag-io-api] +disabled: ${!(environment.name == "prod" || environment.name == "local-prod")} + variables: DB_URL: mongodb://democracy-mongo:27017/democracy BUNDESTAGIO_SERVER_URL: http://bundestag-io-api