-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 779 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 779 Bytes
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
AWS_REGION ?= eu-west-1
setup:
@if [ ! -d ".terraform" ]; then \
echo "initializing terraform ..."; \
docker-compose run --rm terraform_go terraform init; \
fi
build: setup
@mkdir -p bin
docker-compose run --rm service sh -c "cd /opt/app && env GOOS=linux go build -tags aws_lambda -ldflags='-s -w' -o /opt/app/bin/service main.go"
cp bootstrap bin/
cd bin; zip -r service.zip service bootstrap
clean:
rm -rf bin/*
rm -rf .terraform/
rm -f .terraform*
rm -f terraform.*
tests:
docker-compose run --rm test
run:
docker-compose up service
deploy: build
docker-compose run --rm terraform_go terraform apply -var="region=$(AWS_REGION)" -auto-approve
destroy:
docker-compose run --rm terraform_go terraform destroy -var="region=$(AWS_REGION)" -auto-approve