-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·54 lines (47 loc) · 1.6 KB
/
deploy.sh
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
#!/usr/bin/env bash
set -e
RED="\033[1;31m"
GREEN="\033[1;32m"
NOCOLOR="\033[0m"
stack_name="$1"
audit_event_name_prefix="$2"
cri_identifier="$3"
if [ -z "$stack_name" ]; then
echo -e "😱 ${RED}stack name expected as first argument, e.g. ${GREEN}./deploy.sh my-ukpassport-api${NOCOLOR}"
exit 1
fi
if [ -z "$audit_event_name_prefix" ]; then
audit_event_name_prefix="/common-cri-parameters/PassportAuditEventNamePrefix"
fi
if [ -z "$cri_identifier" ]; then
cri_identifier="/common-cri-parameters/PassportCriIdentifier"
fi
echo -e "👉 deploying di-ipv-cri-uk-passport-api with:"
echo -e "\tstack name: ${GREEN}$stack_name${NOCOLOR}"
echo -e "\tAuditEventNamePrefix SSM key ${GREEN}$audit_event_name_prefix${NOCOLOR}"
echo -e "\tCriIdentifier SSM key ${GREEN}$cri_identifier${NOCOLOR}"
./gradlew clean
sam validate -t infrastructure/lambda/template.yaml --config-env dev --lint
sam build -t infrastructure/lambda/template.yaml --config-env dev
sam deploy --stack-name "$stack_name" \
--no-fail-on-empty-changeset \
--no-confirm-changeset \
--resolve-s3 \
--region eu-west-2 \
--capabilities CAPABILITY_IAM \
--tags \
cri:component=ipv-cri-passport-api \
cri:stack-type=dev \
cri:application=Lime \
cri:deployment-source=manual \
--parameter-overrides \
CodeSigningEnabled=false \
DevEnvironment="not-cri-dev" \
Environment=dev \
AuditEventNamePrefix=$audit_event_name_prefix \
CommonStackName=passport-common-cri-api-local \
CreateMockTxmaResourcesOverride=true \
CriIdentifier=$cri_identifier \
ParameterPrefix="ipv-cri-passport-api" \
UseApiKey="' '" \
DeploymentType="not-pipeline"