forked from ONSdigital/paas-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (52 loc) · 2.38 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
68
69
70
71
72
73
74
.EXPORT_ALL_VARIABLES:
# Environment variables that you have to set yourself:
#
# ENVIRONMENT
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# You could override these, but you really shouldn't
VAR_FILE = ${ENVIRONMENT}_vpc.tfvars
VPC_STATE_FILE = ${ENVIRONMENT}_vpc.tfstate.json
CONCOURSE_TERRAFORM_STATE_FILE = ${ENVIRONMENT}_concourse.tfstate.json
CONCOURSE_STATE_FILE = ${ENVIRONMENT}_concourse.state.json
CONCOURSE_CREDS_FILE = ${ENVIRONMENT}_concourse.creds.yml
PRIVATE_KEY_FILE = ${ENVIRONMENT}_concourse.pem
PUBLIC_KEY_FILE = ${PRIVATE_KEY_FILE}.pub
## FIXME: delete
JUMPBOX_TERRAFORM_STATE_FILE = ${ENVIRONMENT}_jumpbox.tfstate.json
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
require_vars:
@bin/require_vars.sh
vpc: require_vars ## Setup a VPC to deploy concourse to
@bin/create_vpc.sh
keypair: ## Create the SSH key pair used to log into the VMs
@bin/create_ssh_keypair.sh
concourse_network: vpc keypair ## Setup networks for concourse to consume
@bin/create_concourse_network.sh
concourse: concourse_network ## Deploy concourse with all prereqs
@bin/deploy_concourse.sh
concourse_password: ## Retrieves the concourse password for a given environment
@bin/concourse_creds.sh
concourse_login: require_vars ## Logs fly into concourse
@bin/login_fly.sh
prometheus_credentials: ## Get credentials for prometheus stack
@bin/prometheus_credentials.sh
test_pipeline: require_vars ## Deploy a test pipeline to concourse
@test/deploy_test_pipeline.sh
test_s3_pipeline: require_vars ## Deploy a pipeline that tests S3 access to concourse
@test/deploy_s3_test_pipeline.sh
deploy_pipeline: require_vars ## Deploy the CF deployment pipeline
@ci/deploy_pipeline.sh
destruction_pipeline: require_vars ## Deploy the CF destruction pipeline
@ci/destruction_pipeline.sh
docker_image: ## Build the general-purpose tooled docker image for Concourse tasks
@bin/create_docker_image.sh
destroy: destroy_concourse_network ## Destroy an entire environment
@bin/delete_vpc.sh
destroy_concourse_network: destroy_concourse ## Destroy concourse and its network
@bin/delete_concourse_network.sh
destroy_concourse: require_vars ## Destroy concourse only
@bin/delete_concourse.sh
decode_aws_error: ## Decode AWS message
@aws sts decode-authorization-message --encoded-message ${DECODE_MESSAGE} | jq -r .DecodedMessage | jq .