-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
42 lines (28 loc) · 1.18 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
# Make the deployment of updated docker containers quick and easy!
# If you're not using AWS then replace aws commands with GCP commands for exmaple - or other cloud providers.
# Make pushing to github repo quick and easy
include .env
# Docker and AWS section
.PHONY: docker-login docker-build docker-tag docker-push docker-verify docker-all
docker-all: docker-login docker-build docker-tag docker-push docker-verify
docker-login:
aws ecr get-login-password --region $(REGION) | docker login --username AWS --password-stdin $(ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com
docker-build:
docker build -t $(REPO_NAME) .
docker-tag:
docker tag $(REPO_NAME):latest $(ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPO_NAME):latest
docker-push:
docker push $(ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPO_NAME):latest
docker-verify:
aws ecr describe-images --repository-name $(REPO_NAME) --region $(REGION)
# Git section
.PHONY: git-all git-add git-commit git-push
DATE := $(shell date +%Y-%m-%d)
git-all: git-add git-commit git-push
git-add:
git add .
git-commit:
@read -p "Please enter an additional commit message: " msg; \
git commit -m "updates $(DATE) - $$msg"
git-push:
git push