Migrate off of ECS onto sobeck. Migrate to OpenTofu.

This commit is contained in:
2024-08-02 22:46:08 -05:00
parent e50d39fb8e
commit 9034cfe83b
8 changed files with 58 additions and 152 deletions

View File

@ -4,6 +4,8 @@ ECR_ACCOUNT_URL ?= 063932952339.dkr.ecr.us-west-2.amazonaws.com
VERSION ?=`git describe`
PORT ?= 8080
TARGET_SERVER ?= sobeck.jdb-software.com
default: serve-docker
build: $(SOURCES)
@ -33,3 +35,16 @@ serve-docker: build-image
ecr-auth:
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin $(ECR_ACCOUNT_URL)
publish:
-mkdir deploy
m4 -D "TOCLERBE_VERSION=$(VERSION)" \
toclerbe.service \
> deploy/toclerbe.service
-ssh deployer@$(TARGET_SERVER) "docker stop toclerbe.service && sudo systemctl stop toclerbe"
ssh deployer@$(TARGET_SERVER) "aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(ECR_ACCOUNT_URL) && docker pull $(ECR_ACCOUNT_URL)/toclerbe:$(VERSION)"
scp \
deploy/toclerbe.service \
deployer@$(TARGET_SERVER):/etc/systemd/system/toclerbe.service
ssh deployer@$(TARGET_SERVER) "sudo systemctl daemon-reload"
ssh deployer@$(TARGET_SERVER) "sudo systemctl start toclerbe"