|
@@ -30,10 +30,10 @@ echo "cfg file: $AWS_CONFIG_FILE ; profile: $AWS_DEFAULT_PROFILE"
|
|
setup_s3() {
|
|
setup_s3() {
|
|
echo "Create $BUCKET"
|
|
echo "Create $BUCKET"
|
|
# Try creating the bucket. Ignore errors (it might already exist).
|
|
# Try creating the bucket. Ignore errors (it might already exist).
|
|
- aws s3 mb s3://$BUCKET 2>/dev/null || true
|
|
|
|
|
|
+ aws s3 mb --profile $BUCKET s3://$BUCKET 2>/dev/null || true
|
|
# Check access to the bucket.
|
|
# Check access to the bucket.
|
|
echo "test $BUCKET exists"
|
|
echo "test $BUCKET exists"
|
|
- aws s3 ls s3://$BUCKET
|
|
|
|
|
|
+ aws s3 --profile $BUCKET ls s3://$BUCKET
|
|
# Make the bucket accessible through website endpoints.
|
|
# Make the bucket accessible through website endpoints.
|
|
echo "make $BUCKET accessible as a website"
|
|
echo "make $BUCKET accessible as a website"
|
|
#aws s3 website s3://$BUCKET --index-document index.html --error-document jsearch/index.html
|
|
#aws s3 website s3://$BUCKET --index-document index.html --error-document jsearch/index.html
|
|
@@ -41,7 +41,7 @@ setup_s3() {
|
|
echo
|
|
echo
|
|
echo $s3conf
|
|
echo $s3conf
|
|
echo
|
|
echo
|
|
- aws s3api put-bucket-website --bucket $BUCKET --website-configuration "$s3conf"
|
|
|
|
|
|
+ aws s3api --profile $BUCKET put-bucket-website --bucket $BUCKET --website-configuration "$s3conf"
|
|
}
|
|
}
|
|
|
|
|
|
build_current_documentation() {
|
|
build_current_documentation() {
|
|
@@ -57,7 +57,42 @@ upload_current_documentation() {
|
|
echo " to $dst"
|
|
echo " to $dst"
|
|
echo
|
|
echo
|
|
#s3cmd --recursive --follow-symlinks --preserve --acl-public sync "$src" "$dst"
|
|
#s3cmd --recursive --follow-symlinks --preserve --acl-public sync "$src" "$dst"
|
|
- aws s3 sync --cache-control "max-age=3600" --acl public-read --exclude "*.rej" --exclude "*.rst" --exclude "*.orig" --exclude "*.py" "$src" "$dst"
|
|
|
|
|
|
+ #aws s3 cp --profile $BUCKET --cache-control "max-age=3600" --acl public-read "site/search_content.json" "$dst"
|
|
|
|
+
|
|
|
|
+ # a really complicated way to send only the files we want
|
|
|
|
+ # if there are too many in any one set, aws s3 sync seems to fall over with 2 files to go
|
|
|
|
+ endings=( json html xml css js gif png JPG )
|
|
|
|
+ for i in ${endings[@]}; do
|
|
|
|
+ include=""
|
|
|
|
+ for j in ${endings[@]}; do
|
|
|
|
+ if [ "$i" != "$j" ];then
|
|
|
|
+ include="$include --exclude *.$j"
|
|
|
|
+ fi
|
|
|
|
+ done
|
|
|
|
+ echo "uploading *.$i"
|
|
|
|
+ run="aws s3 sync --profile $BUCKET --cache-control \"max-age=3600\" --acl public-read \
|
|
|
|
+ $include \
|
|
|
|
+ --exclude *.txt \
|
|
|
|
+ --exclude *.text* \
|
|
|
|
+ --exclude *Dockerfile \
|
|
|
|
+ --exclude *.DS_Store \
|
|
|
|
+ --exclude *.psd \
|
|
|
|
+ --exclude *.ai \
|
|
|
|
+ --exclude *.svg \
|
|
|
|
+ --exclude *.eot \
|
|
|
|
+ --exclude *.otf \
|
|
|
|
+ --exclude *.ttf \
|
|
|
|
+ --exclude *.woff \
|
|
|
|
+ --exclude *.rej \
|
|
|
|
+ --exclude *.rst \
|
|
|
|
+ --exclude *.orig \
|
|
|
|
+ --exclude *.py \
|
|
|
|
+ $src $dst"
|
|
|
|
+ echo "======================="
|
|
|
|
+ #echo "$run"
|
|
|
|
+ #echo "======================="
|
|
|
|
+ $run
|
|
|
|
+ done
|
|
}
|
|
}
|
|
|
|
|
|
setup_s3
|
|
setup_s3
|