forked from jenkinsci/amazon-ecs-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (38 loc) · 1.64 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
.PHONY: help deploy-master docker deploy-ecr
stackName = jenkins
region = eu-west-1
accountid = $(shell aws sts get-caller-identity --query Account --output text)
servicename = $(shell cat parameters.properties|grep ServiceName)
.DEFAULT: help
help:
@echo "make deploy-master"
@echo " deploys Jenkins Master on Fargate"
debug-master:
aws --version
aws sts get-caller-identity
aws cloudformation describe-stack-events --stack-name $(stackName)-master
deploy-ecr:
aws cloudformation deploy \
--template-file cloudformation-ecr.yaml \
--stack-name $(stackName)-ecr \
--parameter-overrides $(shell cat parameters.properties|grep ServiceName) \
--no-fail-on-empty-changeset
@aws cloudformation describe-stacks \
--stack-name $(stackName)-ecr \
--output text \
--query Stacks[0].Outputs[*].OutputValue
docker:
docker build -t $(shell aws ssm get-parameters --region eu-west-1 --names /jenkins/docker-uri --query Parameters[].Value --output text):latest docker
aws ecr get-login-password --region $(region) | docker login --username AWS --password-stdin $(accountid).dkr.ecr.$(region).amazonaws.com
docker push $(shell aws ssm get-parameters --region eu-west-1 --names /jenkins/docker-uri --query Parameters[].Value --output text):latest
deploy-master:
aws cloudformation deploy \
--template-file cloudformation-master.yaml \
--stack-name $(stackName)-master \
--parameter-overrides $(shell cat parameters.properties) \
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_IAM \
--no-fail-on-empty-changeset
@aws cloudformation describe-stacks \
--stack-name $(stackName)-master \
--output text \
--query Stacks[0].Outputs[*].OutputValue