forked from pulumi/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-pulumi.sh
executable file
·35 lines (29 loc) · 1.05 KB
/
run-pulumi.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
#!/bin/bash
#
# Run Pulumi to update the stack targeted by the given branch.
set -o errexit -o pipefail
cd "$(dirname "${BASH_SOURCE}")/.."
if [ -z ${1:-} ]; then
echo "Usage: $0 [ preview | update ]"
exit 1
fi
source ./scripts/common.sh
export PULUMI_ACTION=${1}
case ${PULUMI_ACTION} in
preview)
pulumi -C infrastructure preview
;;
update)
# Given how frequently we update the CloudFront distribution, and how easy it can
# be for our checkpointed CloudFront Etag to fall out of sync with what's current,
# we refresh the distribution on every update -- but we consider any other
# difference in stack state an error to be examined and corrected manually.
pulumi -C infrastructure refresh -t "urn:pulumi:production::www.pulumi.com::aws:cloudfront/distribution:Distribution::cdn" --yes
pulumi -C infrastructure refresh --expect-no-changes --yes
pulumi -C infrastructure up --yes
;;
*)
echo "Unknown action '${PULUMI_ACTION}'"
exit 1
;;
esac