From 4b51dd5d1775b556acb6477cc37e6ff407ca8e14 Mon Sep 17 00:00:00 2001 From: Sam Dudley Date: Wed, 20 Nov 2024 14:10:17 +0000 Subject: [PATCH] Add makefile targets to help with deployments (#549) --- makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/makefile b/makefile index 55c865e5c..0ef149537 100644 --- a/makefile +++ b/makefile @@ -146,3 +146,23 @@ db-dump: # Dump the current database, use `DUMP_NAME` to change the name of the db-from-dump: # Load a dumped database, use `DUMP_NAME` to change the name of the dump @PGPASSWORD='postgres' psql -h localhost -U postgres postgres -f ./.dumps/$(DUMP_NAME).dump + + +# platform-helper + +# target specific variables (not global) +codebase-build codebase-deploy copilot-ssh: profile = "fft" +codebase-build codebase-deploy copilot-ssh: app = "fft" +codebase-build codebase-deploy copilot-ssh: codebase = "fft" +codebase-build codebase-deploy: commit := $(shell git rev-parse --short HEAD) +codebase-deploy: env = "dev" +copilot-ssh: name = "web" + +codebase-build: + AWS_PROFILE=$(profile) platform-helper codebase build --app $(app) --codebase $(codebase) --commit $(commit) + +codebase-deploy: + AWS_PROFILE=$(profile) platform-helper codebase deploy --app $(app) --codebase $(codebase) --commit $(commit) --env $(env) + +copilot-ssh: + AWS_PROFILE=$(profile) copilot svc exec --app $(app) --env $(env) --name $(name) --command 'launcher bash'