-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (30 loc) · 1.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
GIT_HASH := $(shell git rev-parse HEAD)
ifndef GIT_HASH
$(error GIT_HASH is not set)
endif
# ----- Docker -----
NAMESPACE=$(DOCKER_REGISTRY_NAME)
DOCKER_REGISTRY=955244480243.dkr.ecr.us-east-1.amazonaws.com
DOCKER_CONTAINER_NAME=bsides-llm-ctf
DOCKER_REPOSITORY=$(DOCKER_REGISTRY)/$(DOCKER_CONTAINER_NAME)
docker-image:
docker build -f ctf/Dockerfile --rm -t $(DOCKER_REPOSITORY):local .
ci-docker-auth:
@echo "Logging in to $(DOCKER_REGISTRY) as $(DOCKER_REGISTRY_USERNAME)"
@aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 955244480243.dkr.ecr.us-east-1.amazonaws.com
ci-docker-build: ci-docker-auth
@docker build -f ctf/Dockerfile \
--no-cache \
-t $(DOCKER_REPOSITORY):$(GIT_HASH) .
ci-docker-push: ci-docker-auth
docker tag $(DOCKER_REPOSITORY):$(GIT_HASH) $(DOCKER_REPOSITORY):latest
docker push $(DOCKER_REPOSITORY)
ci-test:
@poetry run pytest ctf/
ci-format:
@poetry run black .
@poetry run djlint ctf/templates/ --reformat
ci-lint:
@poetry run black . --check
@poetry run flake8
@poetry run djlint ctf/templates/ --lint