forked from nogibjj/IDS706_final_project_mady
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (43 loc) · 1.24 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
IMAGE_NAME = mady_final_project
DOCKER_ID_USER = ag826
install:
pip install --upgrade pip &&\
pip install -r requirements.txt &&\
pip install --upgrade awscli botocore
format:
black *.py #format all files
lint:
pylint --disable=R,C --ignore-patterns=test_.*?py *.py
test:
python -m pytest -cov test.py
generate_and_push:
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git pull
git add .
git commit -m "rerun push" --allow-empty
git push
# Build the Docker image
build:
docker build -t $(IMAGE_NAME) -f Dockerfile .
# Run the Docker container
run:
docker run -d -p 5001:5001 -e API_KEY=$(API_KEY) $(IMAGE_NAME)
# Remove the Docker image
clean:
docker rmi $(IMAGE_NAME)
image_show:
docker images
container_show:
docker ps
push:
docker login
docker tag $(IMAGE_NAME) $(DOCKER_ID_USER)/$(IMAGE_NAME)
docker push $(DOCKER_ID_USER)/$(IMAGE_NAME):latest
pushecr:
docker tag ${IMAGE_NAME}:latest 381492212823.dkr.ecr.us-west-2.amazonaws.com/mady_ids706_final_proj:latest
docker push 381492212823.dkr.ecr.us-west-2.amazonaws.com/mady_ids706_final_proj:latest
login:
docker login -u ${DOCKER_ID_USER}
docker: build push pushecr
all: install format lint test generate_and_push