-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·43 lines (31 loc) · 1.52 KB
/
deploy
File metadata and controls
executable file
·43 lines (31 loc) · 1.52 KB
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
#!/bin/bash
set -o errexit -o xtrace
bucket=raptor-devops-deployment
regions=(
us-east-2
)
BUILD_DIR=build
[ -d "$BUILD_DIR" ] && rm -rf "$BUILD_DIR"
mkdir "$BUILD_DIR"
zip -j "$BUILD_DIR"/templates.zip cloudformation/raptor-devops-template.yaml cloudformation/substacks/*
for region in "${regions[@]}"
do
aws s3api head-bucket --bucket "${bucket}-${region}" --region "$region" ||
aws s3 mb "s3://${bucket}-${region}" --region "$region"
aws s3api put-bucket-policy \
--bucket "${bucket}-${region}" \
--policy "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"s3:GetObject\",\"s3:GetObjectVersion\"],\"Resource\":\"arn:aws:s3:::raptor-devops-deployment-${region}/*\"},{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"s3:ListBucket\",\"s3:GetBucketVersioning\"],\"Resource\":\"arn:aws:s3:::raptor-devops-deployment-${region}\"}]}" \
--region "$region"
aws s3api put-bucket-versioning \
--bucket "${bucket}-${region}" \
--versioning-configuration Status=Enabled \
--region "$region"
aws s3 cp "$BUILD_DIR"/templates.zip "s3://${bucket}-${region}" --region "$region"
aws s3 cp cloudformation/raptor-devops-template.yaml "s3://${bucket}-${region}" \
--region "$region"
aws s3 cp --recursive cloudformation/substacks/ "s3://${bucket}-${region}/templates" \
--region "$region"
done
rm -rf "$BUILD_DIR"
./mvnw -P docs -pl docs package
aws s3 sync docs/target/generated-docs/ s3://raptor-devops-deployment-us-east-2/docs/ --only-show-errors --delete