From 936332f0b146e0e57f087348d885f78b3ebc8813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Fri, 25 Aug 2017 14:42:44 +0200 Subject: [PATCH] Use Travis to deploy to new server This is the same setup as in https://github.com/whatwg/books. --- .travis.yml | 16 ++++++++++++++++ deploy.sh | 19 +++++++++++++++++++ deploy_key.enc | Bin 0 -> 1680 bytes 3 files changed, 35 insertions(+) create mode 100644 .travis.yml create mode 100644 deploy.sh create mode 100644 deploy_key.enc diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7bfa0d5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: generic + +env: + global: + - ENCRYPTION_LABEL="51dbb505c079" + - SERVER="165.227.248.76" + - SERVER_PUBLIC_KEY="ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDt6Igtp73aTOYXuFb8qLtgs80wWF6cNi3/AItpWAMpX3PymUw7stU7Pi+IoBJz21nfgmxaKp3gfSe2DPNt06l8=" + - WEB_ROOT="html-differences.whatwg.org" + +script: + - bash ./deploy.sh + +notifications: + email: + on_success: never + on_failure: always diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..a238712 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +if [ "$TRAVIS_BRANCH" != "master" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then + echo "Skipping deploy for a pull request" +else + 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 deploy_key.enc -out deploy_key -d + chmod 600 deploy_key + eval `ssh-agent -s` + ssh-add deploy_key + echo "$SERVER $SERVER_PUBLIC_KEY" > known_hosts + mkdir $WEB_ROOT + mv Overview.whatwg.html $WEB_ROOT/index.html + rsync --archive --chmod=D755,F644 --verbose --compress --delete --rsh="ssh -o UserKnownHostsFile=known_hosts" $WEB_ROOT deploy@$SERVER:/var/www/ +fi diff --git a/deploy_key.enc b/deploy_key.enc new file mode 100644 index 0000000000000000000000000000000000000000..aed8e58b39dea89245eb02fc37e358b220a2f919 GIT binary patch literal 1680 zcmV;B25esB1HrxB$rdY(2(nmb9Hh7=<%)@kS zPNPgSiMmWg29=bmv~n_wOOMq)&%ci3#BS`~A$ElYGBK;|V%32?&xQnpa62V4b~7E- z%;x&-Q)9$X7r>HUTlr0j3~o`JE4y5uVo_OzTVafF8S6>G2aq@&7Zi$CykhfopskfD znpX%*2j=D*3)CC$x_lEG_6HwI-^@MfKGbI*n5@-_Qix%^(*MV{Y_u&K1Uewq>@79U z_>&HQ5Rc&8h3+zaW*6SeyOu35$OkF@MYX)}#?IH^u;rN!$cz*sNZf2U&SRQ_a3 z^bczK3693e{a&9&y(V5->gJV)ytiJV+@hG2p?N*!^uX;P*EbIc1pop+=4Ia^+#0lR zr(?fg_jc?7)k|9S3=ZkLCD^5+C)<<6lh*k_nGrJQr5W5BZM5jT?;z)pL~9?ocziU|3WeDsPl=U9tfj+&H2ql|r3YbK~@TxMatmI;!gj0B&Hu>}T6% z{`v01(dnlkofv3k-jil_jiv*t9hzLqCrY1cf;~*(pj(oOtjWi{9cs)_y!*Y=RDt6# zz|}ajP~r)k!N%4bvs|)Zov^aK&$ApF<0V`jwH4CJAU2p1WB8>xG=Z4y<5cHUExpHD zsEK0jUobZe`DJZF*c+8iC~u;AT9OFx45*vno*^|}j{=D8^p}aQSA>ctsnfU0MU5(w z$e-;X!YQ|3xZQR#a%_nx%s=Wleei%09Hu_blzV5#g|`+*Y*(74du&U6S(vFwnGdc@ z*@?su`dI%=q7}Tte2%Y)DcwlKnb0hsZN2N#=)Z!u?*C~MHzT5o-A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