forked from aws-samples/aws-lex-web-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload-bootstrap.sh
executable file
·41 lines (32 loc) · 1.35 KB
/
upload-bootstrap.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
#!/usr/bin/env bash
# utility to manually bootstrap a bucket with source files
# this is intended for testing - use the Makefile for prod
export version=v$(node -p "require('../package.json').version")
echo version is $version
BUCKET=${BUCKET:-""}
BOOTSTRAP_BUCKET_PATH="${BUCKET}/artifacts"
[ "$BUCKET" ] || {
echo "[ERROR] bucket variable is not set"
exit 1
}
if ! test -d out; then
mkdir out
fi
# assumes that it is running from build dir
rm -f out/src-$version.zip
# no longer removes custom-resources.zip - this is created in build using ./release.sh as a required step
pushd .
cd ..
git ls-files | xargs zip -u build/out/src-$version.zip
popd
aws s3 cp --acl public-read out/src-$version.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/src-$version.zip"
aws s3 cp --acl public-read out/custom-resources-$version.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/custom-resources-$version.zip"
aws s3 cp --acl public-read out/initiate-chat-lambda-$version.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/initiate-chat-lambda-$version.zip"
aws s3 cp --acl public-read out/streaming-lambda-$version.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/streaming-lambda-$version.zip"
aws s3 sync --acl public-read --exclude "*" --include "*.yaml" \
../templates "s3://${BOOTSTRAP_BUCKET_PATH}/templates/"
echo "[INFO] master template: https://s3.amazonaws.com/${BOOTSTRAP_BUCKET_PATH}/templates/master.yaml"