Prevent overwriting, allow deletion.

This commit is contained in:
2023-03-10 22:01:09 -06:00
parent e77e999fcb
commit 500c584918
4 changed files with 80 additions and 13 deletions

34
Makefile Normal file
View File

@ -0,0 +1,34 @@
SOURCES=$(wildcard src/*.nim)
TARGET_ENV ?= local
ECR_ACCOUNT_URL ?= 063932952339.dkr.ecr.us-west-2.amazonaws.com
VERSION ?=`git describe`
PORT ?= 8080
default: serve-docker
build: $(SOURCES)
nimble build
serve: build
TOCLERBE_PORT=$(PORT) \
TOCLERBE_API_KEYS=qwertyasdfgh \
./toclerbe urls.txt
# Build the container image.
build-image: $(SOURCES)
docker image build -t $(ECR_ACCOUNT_URL)/toclerbe:$(VERSION) .
# Push the container image to the private AWS ECR
push-image: build-image
docker push $(ECR_ACCOUNT_URL)/toclerbe:$(VERSION)
serve-docker: build-image start-postgres
docker run \
-e TOCLERBE_PORT=80 \
-e TOCLERBE_API_KEYS=qwertyasdfgh
-e "ISSUER=$(ISSUER)" \
-p 127.0.0.1:$(PORT):80/tcp \
$(ECR_ACCOUNT_URL)/toclerbe:$(VERSION)
ecr-auth:
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin $(ECR_ACCOUNT_URL)