From 43b4dd8737acb6596bb56baf91cdd67394c5d2bd Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 13 Apr 2022 10:23:40 +0100 Subject: [PATCH] add environment variable --- charts/budibase/templates/app-service-deployment.yaml | 3 +++ charts/budibase/values.yaml | 1 + packages/server/src/environment.js | 2 +- packages/server/src/threads/automation.js | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 86e255d331..18115bf275 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -114,6 +114,9 @@ spec: value: {{ .Values.globals.google.clientId | quote }} - name: GOOGLE_CLIENT_SECRET value: {{ .Values.globals.google.secret | quote }} + - name: AUTOMATION_MAX_ITERATIONS + value: {{ .Values.globals.automationMaxIterations | quote }} + image: budibase/apps:{{ .Values.globals.appVersion }} imagePullPolicy: Always name: bbapps diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 648b1d2dee..32c241807c 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -103,6 +103,7 @@ globals: google: clientId: "" secret: "" + automationMaxIterations: "0" createSecrets: true # creates an internal API key, JWT secrets and redis password for you diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index 6c49bda6e6..c3ebde3705 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -59,10 +59,10 @@ module.exports = { LOG_LEVEL: process.env.LOG_LEVEL, AUTOMATION_DIRECTORY: process.env.AUTOMATION_DIRECTORY, AUTOMATION_BUCKET: process.env.AUTOMATION_BUCKET, + AUTOMATION_MAX_ITERATIONS: process.env.AUTOMATION_MAX_ITERATIONS, SENDGRID_API_KEY: process.env.SENDGRID_API_KEY, DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT, POSTHOG_TOKEN: process.env.POSTHOG_TOKEN, - AUTOMATION_MAX_ITERATIONS: process.env.AUTOMATION_MAX_ITERATIONS, // old - to remove CLIENT_ID: process.env.CLIENT_ID, BUDIBASE_DIR: process.env.BUDIBASE_DIR, diff --git a/packages/server/src/threads/automation.js b/packages/server/src/threads/automation.js index 0a594d2d5e..aef8263274 100644 --- a/packages/server/src/threads/automation.js +++ b/packages/server/src/threads/automation.js @@ -172,7 +172,7 @@ class Orchestrator { } if ( - index === env.AUTOMATION_MAX_ITERATIONS || + index === parseInt(env.AUTOMATION_MAX_ITERATIONS) || index === loopStep.inputs.iterations ) { this.updateContextAndOutput(loopStepNumber, step, tempOutput, {