Migrate off of ECS onto sobeck. Migrate to OpenTofu.
This commit is contained in:
15
Makefile
15
Makefile
@ -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"
|
||||
|
Reference in New Issue
Block a user