Skip to content

Commit

Permalink
deploy develop manual
Browse files Browse the repository at this point in the history
  • Loading branch information
jdreier committed Jul 17, 2023
1 parent 002fa7d commit 9d55a43
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
27 changes: 14 additions & 13 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
set -e # Exit with nonzero exit code if anything fails

# Set up some git information.
REPO=`git config remote.origin.url`
REPO=`git config remote.${1:=origin}.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD`
BRANCH=`git rev-parse --abbrev-ref HEAD`

SOURCE_BRANCH="master"
MASTER_BRANCH="master"
DEVELOP_BRANCH="develop"
TARGET_BRANCH="gh-pages"

function doCompile {
make
make pdf
}

# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
#if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
# echo "Skipping deploy; not the right kind of build."
# exit 0
#fi
if [ [$BRANCH != $MASTER_BRANCH] -o [$BRANCH != $DEVELOP_BRANCH] ]; then
echo "Please use this script on branch $MASTER_BRANCH or $DEVELOP_BRANCH only. You seem to be on $BRANCH."
exit 0
fi

# Clone the existing gh-pages for this repo into a temporary folder $CHECKOUT.
CHECKOUT=`mktemp -d`
Expand All @@ -29,15 +30,15 @@ git -C $CHECKOUT config user.email "$COMMIT_AUTHOR_EMAIL"
git -C $CHECKOUT checkout $TARGET_BRANCH || git -C $CHECKOUT checkout --orphan $TARGET_BRANCH

# Replace existing contents of checkout with the results of a fresh compile.
rm -rf $CHECKOUT/* || exit 0
rm -rf $CHECKOUT/$BRANCH || exit 0
mkdir -p $CHECKOUT/$BRANCH/tex
doCompile
for x in book code code_ERRORexamples code_ObsEquiv images
do
cp -r $x $CHECKOUT
cp -r $x $CHECKOUT/$BRANCH
done
mkdir -p $CHECKOUT/tex
cp tex/tamarin-manual.pdf $CHECKOUT/tex/tamarin-manual.pdf
cp index.html $CHECKOUT/index.html
cp tex/tamarin-manual.pdf $CHECKOUT/$BRANCH/tex/tamarin-manual.pdf
cp index.html $CHECKOUT/$BRANCH/index.html

# If there are no changes to the compiled book (e.g. this is a README update) then just bail.
if [[ -z `git -C $CHECKOUT status --porcelain` ]]; then
Expand All @@ -47,7 +48,7 @@ fi

# Commit the "changes", i.e. the new version. The delta will show diffs between new and old versions.
git -C $CHECKOUT add \*
git -C $CHECKOUT commit -m "Deploy to GitHub Pages: ${SHA}"
git -C $CHECKOUT commit -m "Deploy to GitHub Pages on ${BRANCH}: ${SHA}"

# Get the deploy key by using Githubs's stored variables to decrypt deploy_key.enc.
openssl enc -nosalt -aes-256-cbc -d -in deploy_key.enc -out deploy_key -base64 -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV
Expand Down
18 changes: 17 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,23 @@
<div id='page'>
<h1>Welcome to the Tamarin Manual</h1>
<p class="halfbreak">
The manual is available as a <a href='tex/tamarin-manual.pdf'>PDF</a> or as <a href='book/001_introduction.html'>HTML</a> for online browsing.
The manual is available as a
<a href='master/tex/tamarin-manual.pdf'>PDF</a>
or as
<a href='master/book/001_introduction.html'>HTML</a>
for online browsing.
</p>

<p style="font-size: smaller">
(For developers and others who are working with the
<a href="https://github.com/tamarin-prover/tamarin-prover/tree/develop">
development branch
</a>
of Tamarin: see here for the
<a href='develop/tex/tamarin-manual.pdf'>PDF</a>
and
<a href='develop/book/001_introduction.html'>HTML</a>
in sync with <tt>develop</tt>.)
</p>
</div>
</div>
Expand Down

0 comments on commit 9d55a43

Please sign in to comment.