-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (37 loc) · 1.57 KB
/
Makefile
File metadata and controls
46 lines (37 loc) · 1.57 KB
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
SHELL := /usr/bin/env bash
.PHONY: help build push deploy release print-image-tag print-image-uri
ENV ?= dev
CONTEXT ?= .
IMAGE_TAG ?=
help:
@printf '%s\n' \
'Targets:' \
' make build [CONTEXT=.] [PLATFORM=linux/amd64] Build the local image tagged with the short git SHA' \
' make push [CONTEXT=.] [PLATFORMS=linux/amd64] Build and push the image to Artifactory' \
' make deploy ENV=<env> [IMAGE_TAG=tag] Update the ECS task definition and deploy it' \
' make release ENV=<env> [CONTEXT=.] Push and then deploy the current image tag' \
' make print-image-tag Print the image tag that will be used' \
' make print-image-uri Print the fully-qualified image URI' \
'' \
'Valid ENV values: dev test demo uat sandbox prod'
build:
@IMAGE_TAG='$(IMAGE_TAG)' ./scripts/build-image "$(CONTEXT)"
push:
@IMAGE_TAG='$(IMAGE_TAG)' ./scripts/push-image "$(CONTEXT)"
deploy:
@if [[ -z "$(ENV)" ]]; then \
echo "error: ENV is required; valid values: dev test demo uat sandbox prod" >&2; \
exit 1; \
fi
@IMAGE_TAG='$(IMAGE_TAG)' ./scripts/deploy-ecs "$(ENV)"
release:
@if [[ -z "$(ENV)" ]]; then \
echo "error: ENV is required; valid values: dev test demo uat sandbox prod" >&2; \
exit 1; \
fi
@IMAGE_TAG='$(IMAGE_TAG)' ./scripts/push-image "$(CONTEXT)"
@IMAGE_TAG='$(IMAGE_TAG)' ./scripts/deploy-ecs "$(ENV)"
print-image-tag:
@IMAGE_TAG='$(IMAGE_TAG)' bash -lc 'source ./scripts/emmy-common.sh && emmy_image_tag'
print-image-uri:
@IMAGE_TAG='$(IMAGE_TAG)' bash -lc 'source ./scripts/emmy-common.sh && emmy_image_uri'