-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#! /bin/bash | ||
# Make sure the staging branch is in sync with its remote | ||
git reset --hard origin/production | ||
|
||
git clean -fdx | ||
|
||
# Remove all generated files and directories | ||
rake clean[all] | ||
|
||
rake setup | ||
|
||
# build site in prod profile | ||
rake --trace gen[production] | ||
|
||
rc=$? | ||
if [[ $rc != 0 ]] ; then | ||
echo "ERROR: Rake script failed!" | ||
exit $rc | ||
fi | ||
|
||
pushd _tmp | ||
# clone beanvalidation.github.io in _tmp if not present | ||
if [ ! -d "beanvalidation.github.io" ]; | ||
then | ||
git clone --depth 1 git@github.com:beanvalidation/beanvalidation.github.io.git | ||
rc=$? | ||
if [[ $rc != 0 ]] ; then | ||
echo "ERROR: beanvalidation/beanvalidation.github.io cannot be cloned!" | ||
exit $rc | ||
fi | ||
fi | ||
|
||
cd beanvalidation.github.io | ||
git fetch origin | ||
git reset --hard origin/master | ||
|
||
# copy site to git repo, commit and push | ||
# we filter cache as in production we shouldn't need that data | ||
rsync -av \ | ||
--delete \ | ||
--filter "- /cache" --exclude ".git" --exclude "latest-draft/spec" \ | ||
../../_site/ . | ||
|
||
rc=$? | ||
if [[ $rc != 0 ]] ; then | ||
echo "ERROR: Site sync failed!" | ||
exit $rc | ||
fi | ||
|
||
git add -A . | ||
if git commit -m "Publish generated site"; | ||
then | ||
git push origin master; | ||
rc=$? | ||
fi | ||
popd | ||
if [[ $rc != 0 ]] ; then | ||
echo "ERROR: Cannot push on site repository!" | ||
exit $rc | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# Make sure the staging branch is in sync with its remote | ||
git reset --hard origin/staging | ||
git clean -fdx | ||
|
||
# Remove all generated files and directories | ||
rake clean[all] | ||
|
||
# Make sure there was no update to the used dependencies (if not, this is just a quick version check for Bundler) | ||
rake setup | ||
rc=$? | ||
if [[ $rc != 0 ]] ; then | ||
echo "ERROR: Rake setup failed!" | ||
exit $rc | ||
fi | ||
|
||
# Build the site using the staging profile and sync | ||
rake --trace gen[staging] | ||
rc=$? | ||
if [[ $rc != 0 ]] ; then | ||
echo "ERROR: Site generation failed!" | ||
exit $rc | ||
fi | ||
|
||
rsync --delete --exclude "latest-draft/spec" -avh _site/ ci.hibernate.org:/var/www/staging-beanvalidation.org | ||
rc=$? | ||
if [[ $rc != 0 ]] ; then | ||
echo "ERROR: Site sync failed!" | ||
exit $rc | ||
fi |