forked from ethereum/yellowpaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis_deploy.sh
executable file
·28 lines (23 loc) · 1023 Bytes
/
travis_deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -e
SHA=`git rev-parse --verify HEAD`
git config user.name "$COMMIT_AUTHOR"
git config user.email "$COMMIT_AUTHOR_EMAIL"
git checkout --orphan gh-pages
git rm --cached -r .
echo "# Automatic build" > README.md
echo "Built pdf from \`$SHA\`. See https://github.com/ethereum/yellowpaper/ for details." >> README.md
echo "The generated pdf is here: https://ethereum.github.io/yellowpaper/paper.pdf" >> README.md
echo '<html><head><meta http-equiv="refresh" content="0; url=paper.pdf" /></head><body></body></html>' > index.html
mv build/Paper.pdf paper.pdf
git add -f README.md index.html paper.pdf
git commit -m "Built pdf from {$SHA}."
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploykey.enc -out deploykey -d
chmod 600 deploykey
eval `ssh-agent -s`
ssh-add deploykey
git push -f "$PUSH_REPO" gh-pages