Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean shell scripts #25704

Merged
merged 2 commits into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions build/ship.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,62 @@

red=$'\e[1;31m'
green=$'\e[1;32m'
blue=$'\e[1;34m'
#blue=$'\e[1;34m'
magenta=$'\e[1;35m'
cyan=$'\e[1;36m'
#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
printf "\n${red}⚠️ Shipping aborted. You must specify a version.\n${end}"
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" $red $end
exit 1
fi

# Pulling latest changes, just to be sure
printf "\n${magenta}=======================================================${end}"
printf "\n${magenta}Pulling latest changes...${end}"
printf "\n${magenta}=======================================================\n\n${end}"
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 v4-dev

# Update version number
printf "\n${magenta}=======================================================${end}"
printf "\n${magenta}Updating version number...${end}"
printf "\n${magenta}=======================================================\n${end}"
npm run release-version $current_version $1
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"

# Compile latest CSS and JS
printf "\n${magenta}=======================================================${end}"
printf "\n${magenta}Compile latest CSS and JS...${end}"
printf "\n${magenta}=======================================================\n${end}"
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCompile latest CSS and JS...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run dist

# Generate the SRI hashes
printf "\n${magenta}=======================================================${end}"
printf "\n${magenta}Generate the SRI hashes...${end}"
printf "\n${magenta}=======================================================\n${end}"
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sGenerate the SRI hashes...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run release-sri

# Compress the dist files
printf "\n${magenta}=======================================================${end}"
printf "\n${magenta}Compressing the dist files...${end}"
printf "\n${magenta}=======================================================\n${end}"
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCompressing the dist files...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run release-zip

# Compile the docs
printf "\n${magenta}=======================================================${end}"
printf "\n${magenta}Compile hosted documentation...${end}"
printf "\n${magenta}=======================================================\n${end}"
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCompile hosted documentation...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run docs-github

# Copy the contents of the built docs site over to `bs-docs` repo
printf "\n${magenta}=======================================================${end}"
printf "\n${magenta}Copy it over...${end}"
printf "\n${magenta}=======================================================\n${end}"
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCopy it over...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
cp -rf _gh_pages/. ../bs-docs/
printf "\nDone!\n"

printf "\n${green}=======================================================${end}"
printf "\n${green}Success, $1 is ready to review and publish.${end}"
printf "\n${green}=======================================================\n\n${end}"
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
2 changes: 1 addition & 1 deletion build/upload-preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
sed -i "/^current_version:/ s/\$/+pr.${TRAVIS_COMMIT}/" _config.yml
bundle exec jekyll build --destination "$TRAVIS_COMMIT" --baseurl "/c/${TRAVIS_COMMIT}"

openssl aes-256-cbc -K $encrypted_2b749c8e6327_key -iv $encrypted_2b749c8e6327_iv -in build/gcp-key.json.enc -out build/gcp-key.json -d
openssl aes-256-cbc -K "${encrypted_2b749c8e6327_key:?}" -iv "${encrypted_2b749c8e6327_iv:?}" -in build/gcp-key.json.enc -out build/gcp-key.json -d
gcloud auth activate-service-account "$GCP_SERVICE_ACCOUNT" --key-file build/gcp-key.json &> /dev/null || (echo 'GCP login failed!'; exit 1)

echo "Uploading to http://preview.twbsapps.com/c/${TRAVIS_COMMIT} ..."
Expand Down