-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor scripts to support branch switching and flattening of `gh-pa…
…ges`.
- Loading branch information
1 parent
73b39d4
commit d8cc3ae
Showing
10 changed files
with
150 additions
and
57 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
This file was deleted.
Oops, something went wrong.
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
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,13 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -e | ||
|
||
cd $(dirname "$BASH_SOURCE") | ||
repo_dir=`pwd` | ||
|
||
out_dir="$repo_dir"/out | ||
src_hash=`cat "$out_dir"/hash` | ||
|
||
cp -r "$repo_dir"/script "$out_dir" | ||
|
||
"$out_dir"/script/publish.sh |
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,34 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Fetch and build the API documentation via `rustdoc` and the website | ||
# documentation via `mkdocs` and write the outputs to the `out` directory. | ||
|
||
set -e | ||
|
||
cd $(dirname "$BASH_SOURCE") | ||
script_dir=`pwd` | ||
|
||
repo_dir="$script_dir"/../.. | ||
src_dir="$repo_dir"/src | ||
out_dir="$repo_dir"/out | ||
mkdocs_out_dir="$out_dir"/doc | ||
rustdoc_out_dir="$out_dir"/lib/target/doc | ||
|
||
cd "$repo_dir" | ||
|
||
which cargo > /dev/null | ||
which git > /dev/null | ||
#which peru > /dev/null | ||
|
||
git checkout master | ||
|
||
mkdir -p "$out_dir" | ||
git rev-parse --short HEAD > "$out_dir"/hash | ||
|
||
#peru reup | ||
|
||
mkdocs build > /dev/null | ||
|
||
"$out_dir"/lib/rustdoc.sh --all-features --manifest-path="$out_dir"/lib/Cargo.toml > /dev/null | ||
rm -rf "$mkdocs_out_dir"/rustdoc | ||
cp -r "$rustdoc_out_dir" "$mkdocs_out_dir"/rustdoc |
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,33 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Ensure the master branch is clean, perform a build, and copy the output to the | ||
# gh-pages branch. | ||
|
||
set -e | ||
|
||
cd $(dirname "$BASH_SOURCE") | ||
script_dir=`pwd` | ||
|
||
repo_dir="$script_dir"/../.. | ||
out_dir="$repo_dir"/out | ||
|
||
cd "$repo_dir" | ||
|
||
which git > /dev/null | ||
|
||
git checkout master | ||
|
||
if [ -n "$(git status --porcelain)" ] ; then | ||
git status | ||
exit 1 | ||
fi | ||
git fetch | ||
if [ "$(git rev-parse @)" != "$(git rev-parse @{u})" ] ; then | ||
git status | ||
exit 1 | ||
fi | ||
|
||
"$script_dir"/build.sh | ||
|
||
git checkout gh-pages | ||
cp -r "$out_dir"/doc/* "$repo_dir"/. |
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,27 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Commit any changes to gh-pages and reset the initial commit. This flattens the | ||
# history on the gh-pages branch. | ||
|
||
set -e | ||
|
||
cd $(dirname "$BASH_SOURCE") | ||
script_dir=`pwd` | ||
|
||
repo_dir="$script_dir"/../.. | ||
out_dir="$repo_dir"/out | ||
src_hash=`cat "$out_dir"/hash` | ||
|
||
cd "$repo_dir" | ||
|
||
which git > /dev/null | ||
|
||
git checkout gh-pages | ||
|
||
if [ -z "$(git status --porcelain)" ] ; then | ||
exit 1 | ||
fi | ||
|
||
git add . | ||
git commit -m "Build from $src_hash." | ||
git reset $(git commit-tree HEAD^{tree} -m "Build from $src_hash.") |
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,17 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Forces a push to the gh-pages branch on the origin remote. Checks out the | ||
# master branch when done. | ||
|
||
set -e | ||
|
||
cd $(dirname "$BASH_SOURCE") | ||
script_dir=`pwd` | ||
|
||
repo_dir="$script_dir"/../.. | ||
|
||
cd "$repo_dir" | ||
|
||
"$script_dir"/checkout.sh | ||
"$script_dir"/commit.sh | ||
"$script_dir"/push.sh |
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,22 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Forces a push to the gh-pages branch on the origin remote. Checks out the | ||
# master branch when done. | ||
|
||
set -e | ||
|
||
cd $(dirname "$BASH_SOURCE") | ||
script_dir=`pwd` | ||
|
||
repo_dir="$script_dir"/../.. | ||
out_dir="$repo_dir"/out | ||
src_hash=`cat "$out_dir"/hash` | ||
|
||
cd "$repo_dir" | ||
|
||
which git > /dev/null | ||
|
||
git checkout gh-pages | ||
|
||
git push origin gh-pages --force | ||
git checkout master |