travis: Save ssh-key for pushing auto-generation of GitHub pages.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
This commit is contained in:
Tim 'mithro' Ansell 2017-12-21 12:48:21 +01:00
parent 43de54b6fa
commit 67a090a7a1
3 changed files with 26 additions and 2 deletions

View File

@ -7,8 +7,11 @@ env:
- GIT_COMMITTER_NAME="SymbiYosys Travis Bot"
- GIT_COMMITTER_EMAIL="nobody@nowhere.com"
before_install:
- ./.travis/save-key.sh
script:
- ./.travis/generate-html.sh
after_install:
- if [ ! -z "$GH_KEY" ]; then ./.travis/push-html.sh; fi
- if [ -e ~/.ssh/agent.sh ]; then source ~/.ssh/agent.sh; ./.travis/push-html.sh; fi

View File

@ -15,7 +15,12 @@ for d in html/*; do
done
# Try a users version of the repo first, then try the SymbiFlow version if that fails.
git clone git+ssh://github.com/$CURRENT_OWNER/prjxray.git $TMPDIR/prjxray || git clone git+ssh://github.com/SymbiFlow/prjxray.git $TMPDIR/prjxray
if [ "$CURRENT_OWNER" != "SymbiFlow" ]; then
git clone https://github.com/$CURRENT_OWNER/prjxray.git $TMPDIR/prjxray || true
fi
if [ ! -d $TMPDIR/prjxray/.git ]; then
git clone https://github.com/SymbiFlow/prjxray.git $TMPDIR/prjxray
fi
for s in $(find -name settings.sh); do
echo

16
.travis/save-key.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
set +x
if [ ! -z "$GH_KEY" ]; then
ssh-agent > ~/.ssh/agent.sh
. ~/.ssh/agent.sh
mkdir -p ~/.ssh/
echo "$GH_KEY" | base64 -d > ~/.ssh/id_rsa
chmod 0400 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
ssh-add ~/.ssh/id_rsa
echo "Got ssh key $(ssh-add -l -E md5)"
else
echo "No ssh key."
fi