forked from fhopeman/aws-codelab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpipeline.sh
executable file
·43 lines (36 loc) · 1.29 KB
/
pipeline.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
#!/usr/bin/env bash
if [ -z "${PROFILE}" ]; then
echo "Please set environment variable PROFILE"
exit 1
fi
if [ -z "${TEAM_NAME}" ]; then
echo "Please set environment variable TEAM_NAME"
exit 1
fi
# 1. Deploy resources
bundle exec autostacker24 update --template lambda/cf-templates/chat-resources.yaml \
--stack "lambda-chat-${TEAM_NAME}-resources" \
--param TeamName="${TEAM_NAME}" \
--profile "${PROFILE}"
# 2. Deploy read lambda
bundle exec autostacker24 update --template lambda/cf-templates/chat-read.yaml \
--stack "lambda-chat-${TEAM_NAME}-read" \
--param TeamName="${TEAM_NAME}" \
--profile "${PROFILE}"
# 3. Deploy write lambda
bundle exec autostacker24 update --template lambda/cf-templates/chat-write.yaml \
--stack "lambda-chat-${TEAM_NAME}-write" \
--param TeamName="${TEAM_NAME}" \
--profile "${PROFILE}"
# 4. Deploy api
bundle exec autostacker24 update --template lambda/cf-templates/chat-api.yaml \
--stack "lambda-chat-${TEAM_NAME}-api" \
--param TeamName="${TEAM_NAME}" \
--profile "${PROFILE}"
# 5. Run integration tests if API_GATEWAY_ID present
if [ -n "${API_GATEWAY_ID}" ]; then
echo -e "\nStarting integration tests .."
./lambda/ci/integration-test.sh
else
echo -e "\nSet API_GATEWAY_ID to run integration tests"
fi