From 2679374dc87a5d98d2ae5c6ca6997706ace01579 Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Tue, 10 Jun 2025 18:15:32 -0700 Subject: [PATCH] change .env.example name --- README.md | 10 +++++++++- .../doorman-api/{.env.example => .env.twiliotemplate} | 0 packages/doorman-api/package.json | 6 +++--- .../{.env.example => .env.twiliotemplate} | 0 packages/doorman-client/package.json | 4 ++-- 5 files changed, 14 insertions(+), 6 deletions(-) rename packages/doorman-api/{.env.example => .env.twiliotemplate} (100%) rename packages/doorman-client/{.env.example => .env.twiliotemplate} (100%) diff --git a/README.md b/README.md index cac9fbf..f8a205f 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,12 @@ switch: state_resource: https://doorman.chromart.cc/api/door/info?door=buzzer resource: https://doorman.chromart.cc/api/door/auth?door=buzzer&key=1991 is_on_template: "{{ value_json.status == 'OPEN' }}" -``` \ No newline at end of file +``` + +## .env.twiliotemplate + +This file is used for twilio Deployments in github actions. In short, it specifies all the env values that are supposed to be deployed with the Function. + +For any value that is specified, it uses that value. + +For any value that is in the file but not specified (= nothing), it would be loaded from the execution environment (as a Gitea secret). If the env var is not in the environment passed in, then the deployment would fail. diff --git a/packages/doorman-api/.env.example b/packages/doorman-api/.env.twiliotemplate similarity index 100% rename from packages/doorman-api/.env.example rename to packages/doorman-api/.env.twiliotemplate diff --git a/packages/doorman-api/package.json b/packages/doorman-api/package.json index ab42150..f9adecb 100644 --- a/packages/doorman-api/package.json +++ b/packages/doorman-api/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { - "integ-test:local": "bun run build && export $(grep -v '^#' .env.example | grep -v '=$' | xargs) && concurrently --success first --kill-others \"bun run start-twilio\" \"bun test --timeout 30000 ./tst/integ-local.test.ts\"", + "integ-test:local": "bun run build && export $(grep -v '^#' .env.twiliotemplate | grep -v '=$' | xargs) && concurrently --success first --kill-others \"bun run start-twilio\" \"bun test --timeout 30000 ./tst/integ-local.test.ts\"", "integ-test:staging": "STAGE=staging bun test --timeout 30000 ./tst/integ-staging.test.ts", "start-twilio": "twilio-run --load-local-env --live --port 8080", "watch-build": "bun run --watch src/index.ts", @@ -11,8 +11,8 @@ "local-db": "bun run --watch src/local/localDdb.ts", "start:local-db": "concurrently \"bun run local-db\" \"bun run start\"", "build": "bun run src/index.ts", - "deploy": "twilio-run promote --from=staging --to=prod --load-system-env --env .env.example", - "deploy:staging": "twilio-run deploy --load-system-env --env .env.example --service-name doorman --environment=staging --override-existing-project" + "deploy": "twilio-run promote --from=staging --to=prod --load-system-env --env .env.twiliotemplate", + "deploy:staging": "twilio-run deploy --load-system-env --env .env.twiliotemplate --service-name doorman --environment=staging --override-existing-project" }, "dependencies": { "@aws-sdk/client-dynamodb": "^3.821.0", diff --git a/packages/doorman-client/.env.example b/packages/doorman-client/.env.twiliotemplate similarity index 100% rename from packages/doorman-client/.env.example rename to packages/doorman-client/.env.twiliotemplate diff --git a/packages/doorman-client/package.json b/packages/doorman-client/package.json index 3b1d4ef..25d154c 100644 --- a/packages/doorman-client/package.json +++ b/packages/doorman-client/package.json @@ -8,8 +8,8 @@ "start-twilio": "twilio-run --live --port 4500", "start": "concurrently \"bun run watch-build\" \"bun run start-twilio\"", "build": "bun run src/index.ts", - "deploy": "twilio-run promote --from=staging --to=prod --load-system-env --env .env.example", - "deploy:staging": "twilio-run deploy --load-system-env --env .env.example --service-name buzzer --environment=staging --override-existing-project" + "deploy": "twilio-run promote --from=staging --to=prod --load-system-env --env .env.twiliotemplate", + "deploy:staging": "twilio-run deploy --load-system-env --env .env.twiliotemplate --service-name buzzer --environment=staging --override-existing-project" }, "dependencies": { "@twilio-labs/serverless-runtime-types": "^4.0.1",