Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

Commit 11d2456

Browse files
committed
Use Travis to deploy to new server
This is the same setup as in https://github.com/whatwg/books.
1 parent cb79d0e commit 11d2456

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: generic
2+
3+
env:
4+
global:
5+
- ENCRYPTION_LABEL="51dbb505c079"
6+
- SERVER="165.227.248.76"
7+
- SERVER_PUBLIC_KEY="ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDt6Igtp73aTOYXuFb8qLtgs80wWF6cNi3/AItpWAMpX3PymUw7stU7Pi+IoBJz21nfgmxaKp3gfSe2DPNt06l8="
8+
- WEB_ROOT="html-differences.whatwg.org"
9+
10+
script:
11+
- bash ./deploy.sh
12+
13+
notifications:
14+
email:
15+
on_success: never
16+
on_failure: always

deploy.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ "$TRAVIS_BRANCH" != "master" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then
5+
echo "Skipping deploy for a pull request"
6+
else
7+
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
8+
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
9+
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
10+
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
11+
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d
12+
chmod 600 deploy_key
13+
eval `ssh-agent -s`
14+
ssh-add deploy_key
15+
echo "$SERVER $SERVER_PUBLIC_KEY" > known_hosts
16+
mkdir $WEB_ROOT
17+
mv Overview.whatwg.html $WEB_ROOT/index.html
18+
rsync --archive --chmod=D755,F644 --verbose --compress --delete --rsh="ssh -o UserKnownHostsFile=known_hosts" $WEB_ROOT deploy@$SERVER:/var/www/
19+
fi

deploy_key.enc

1.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)