2022-08-11 22:43:39 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-08-01 15:38:27 +00:00
|
|
|
|
2022-08-11 22:43:39 +00:00
|
|
|
# Builds the final versions of the book and then upload the results to various
|
|
|
|
# locations.
|
|
|
|
|
|
|
|
# Move into the root folder.
|
|
|
|
cd $(dirname $(dirname $0))
|
|
|
|
|
|
|
|
# Perform the basic environment checks and setup.
|
|
|
|
./scripts/setup.sh || exit 1
|
|
|
|
./scripts/check-env-bucket.sh || exit 1
|
|
|
|
|
|
|
|
# Clean up old versions of the file.
|
2022-08-01 15:38:27 +00:00
|
|
|
rm -f dmoonfire*
|
|
|
|
|
2022-08-11 22:43:39 +00:00
|
|
|
# Perform the release process.
|
2022-08-01 15:38:27 +00:00
|
|
|
npx semantic-release
|
|
|
|
|
2022-08-11 22:43:39 +00:00
|
|
|
# Create a tarball of the output files and upload them to S3.
|
2022-08-12 16:24:50 +00:00
|
|
|
if ls dmoonfire* &> /dev/null
|
|
|
|
then
|
|
|
|
export npm_package_name=$(cat package.json | jq -r .name)
|
|
|
|
tar -cjf $npm_package_name.tar.bz2 dmoonfire*
|
|
|
|
s3cmd --access_key=$AWS_ACCESS_KEY_ID --access_token=$AWS_SECRET_ACCESS_KEY --host=$AWS_ENDPOINT --host-bucket=$AWS_ENDPOINT -P put allegro.tar.bz2 s3://$AWS_BUCKET
|
|
|
|
fi
|
2022-08-11 22:43:39 +00:00
|
|
|
|
|
|
|
# Versions
|
2022-08-12 16:24:50 +00:00
|
|
|
# 2022-08-12 Added an if check for files before uploading
|
2022-08-11 22:43:39 +00:00
|
|
|
# 2022-08-11 - Initial version
|