This repository has been archived by the owner on May 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
67 lines (53 loc) · 1.7 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
62
63
64
65
66
67
#############################################################################
# Make file for hacker_one_importer infrastructure
#
# Description:
# ------------
# This is for testing, building, and packaging hacker_one_importer
#
#
# Usage:
# ------
# 1. build-image will need to be run before any other targets are called
#
#
# Make Target:
# ------------
# The Makefile provides the following targets to make:
# $ make build-docker
#
# Example:
# ------------
# make build
#############################################################################
.PHONY: build-docker, push, develop, develop-down, setup-terraform, docker-login
DOCKERTAG ?= $(shell git rev-parse --short HEAD)
AWS_ECR_REPO ?= $(shell aws ecr describe-repositories --query "repositories[?repositoryName=='jira_importer'].repositoryUri" --output text)
build-docker:
${INFO} "Building hacker_one_importer Image $(DOCKERTAG)"
@docker build --file=Dockerfile -t jira_importer:$(DOCKERTAG) .
push:
@docker tag jira_importer:$(DOCKERTAG) ${AWS_ECR_REPO}:$(DOCKERTAG)
@docker push ${AWS_ECR_REPO}:$(DOCKERTAG)
develop:
${INFO} "Running Development Docker"
cd development && docker-compose run --rm importer /bin/sh
develop-down:
${INFO} "Running Development Compose Down"
cd development && docker-compose down
setup-terraform:
${INFO} "Building Terraform Image"
cd infrastructure && docker-compose run jira-terraform ./setup_infrastructure.sh ${DOCKERTAG}
docker-login:
aws ecr get-login --no-include-email --region us-east-1 | bash 2> /dev/null
aws-ecr:
${INFO} $(AWS_ECR_REPO)
# Cosmetics
YELLOW := "\e[0;33m"
RED := "\e[0;31m"
NC := "\e[0m"
# Shell Functions
INFO := @bash -c '\
printf $(YELLOW); \
echo "=> $$@"; \
printf $(NC)' SOME_VALUE