Migrate off of ECS onto sobeck.jdb-software.com.

This commit is contained in:
2024-08-12 12:14:01 -05:00
parent dfaede9fd8
commit 9cbc1e708a
15 changed files with 87 additions and 142 deletions

View File

@ -82,3 +82,20 @@ echo-vars:
"VERSION=$(VERSION)\n" \
"PORT=$(PORT)\n" \
"INTEGRATION_TOKEN=$(INTEGRATION_TOKEN)\n"
publis:
-rm -r deploy
-mkdir deploy
m4 \
-D "HFF_ENTRY_FORMS_API_VERSION=$(VERSION)" \
-D "TARGET_ENV=$(TARGET_ENV)" \
-D "TARGET_PORT=$(TARGET_PORT)" \
hff_entry_forms_api.service \
> deploy/hff_entry_forms_api.$(TARGET_ENV).service
-ssh deployer@$(TARGET_SERVER) "docker stop hff_entry_forms.$(TARGET_ENV).service && sudo systemctl stop hff_entry_forms.$(TARGET_ENV)"
ssh deployer@$(TARGET_SERVER) "aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin $(ECR_ACCOUNT_URL) && docker pull $(ECR_ACCOUNT_URL)/hff_entry_forms:$(VERSION)"
scp \
deploy/hff_entry_forms.$(TARGET_ENV).service \
deployer@$(TARGET_SERVER):/etc/systemd/system/hff_entry_forms.$(TARGET_ENV).service
ssh deployer@$(TARGET_SERVER) "sudo systemctl daemon-reload"
ssh deployer@$(TARGET_SERVER) "sudo systemctl start hff_entry_forms.$(TARGET_ENV)"

View File

@ -0,0 +1,16 @@
[Unit]
Description=HFF Entry Forms (TARGET_ENV)
After=network-online.target
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker rm %n
ExecStart=/usr/bin/docker run --rm -p TARGET_PORT:80 --name %n \
--env-file /etc/hff_entry_forms/TARGET_ENV.env \
063932952339.dkr.ecr.us-west-2.amazonaws.com/hff_entry_forms:HFF_ENTRY_FORMS_VERSION
ExecStop=/usr/bin/docker stop --name %n
[Install]
WantedBy=default.target