twbs--bootstrap/build/ship.sh

53 lines
1.9 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
#
2017-09-30 21:05:45 +00:00
# Usage
# ---------------
# 1. Clone second version of Bootstrap in sibling directory named `bs-docs`.
# 2. Within `bs-docs` copy, switch to `gh-pages` branch.
# 3. Pull latest, re-bundle, re-npm.
# 4. Run script.
red=$'\e[1;31m'
green=$'\e[1;32m'
2018-03-12 16:59:57 +00:00
#blue=$'\e[1;34m'
magenta=$'\e[1;35m'
2018-03-12 16:59:57 +00:00
#cyan=$'\e[1;36m'
end=$'\e[0m'
# Get current version from package.json
current_version=$(node -p "require('./package.json').version")
if [[ $# -lt 1 ]]; then
2018-03-12 16:59:57 +00:00
printf "\n%s⚠ Shipping aborted. You must specify a version.\n%s" $red $end
exit 1
fi
# Pulling latest changes, just to be sure
2018-03-12 16:59:57 +00:00
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sPulling latest changes...%s" $magenta $end
printf "\n%s=======================================================\n\n%s" $magenta $end
git pull origin master
# Update version number
2018-03-12 16:59:57 +00:00
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sUpdating version number...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run release-version "$current_version" "$1"
2018-10-13 13:45:17 +00:00
# Build release
2018-03-12 16:59:57 +00:00
printf "\n%s=======================================================%s" $magenta $end
2018-11-25 09:49:14 +00:00
printf "\n%sBuilding release...%s" $magenta $end
2018-03-12 16:59:57 +00:00
printf "\n%s=======================================================\n%s" $magenta $end
2018-10-13 13:45:17 +00:00
npm run release
# Copy the contents of the built docs site over to `bs-docs` repo
2018-03-12 16:59:57 +00:00
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCopy it over...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
2017-09-30 21:05:45 +00:00
cp -rf _gh_pages/. ../bs-docs/
printf "\nDone!\n"
2018-03-12 16:59:57 +00:00
printf "\n%s=======================================================%s" $green $end
printf "\n%sSuccess, $1 is ready to review and publish.%s" $green $end
printf "\n%s=======================================================\n\n%s" $green $end