docs: enable upload to docs.mitmproxy.org/master

This commit is contained in:
Aldo Cortesi 2018-03-07 08:00:55 +13:00
parent cc00b03554
commit 8792e07210
3 changed files with 49 additions and 33 deletions

View File

@ -16,32 +16,43 @@ git:
matrix:
fast_finish: true
include:
- python: 3.6
env: TOXENV=lint
- os: osx
osx_image: xcode7.3
language: generic
env: TOXENV=py35 BDIST=1
- python: 3.5
env: TOXENV=py35 BDIST=1
dist: precise
- python: 3.6
env: TOXENV=py36
- python: 3.6
env: TOXENV=individual_coverage
- language: node_js
node_js: "node"
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
# - python: 3.6
# env: TOXENV=lint
# - os: osx
# osx_image: xcode7.3
# language: generic
# env: TOXENV=py35 BDIST=1
# - python: 3.5
# env: TOXENV=py35 BDIST=1
# dist: precise
# - python: 3.6
# env: TOXENV=py36
# - python: 3.6
# env: TOXENV=individual_coverage
# - language: node_js
# node_js: "node"
# before_install:
# - curl -o- -L https://yarnpkg.com/install.sh | bash
# - export PATH=$HOME/.yarn/bin:$PATH
# install:
# - cd web && yarn
# - yarn global add codecov
# script: npm test && codecov
# cache:
# yarn: true
# directories:
# - web/node_modules
- language: python
env:
- NAME=docs
install:
- cd web && yarn
- yarn global add codecov
script: npm test && codecov
cache:
yarn: true
directories:
- web/node_modules
- wget https://github.com/gohugoio/hugo/releases/download/v0.37/hugo_0.37_Linux-64bit.deb
- sudo dpkg -i hugo*.deb
- pip install awscli
script:
- cd docs && ./ci
after_success:
- echo done
install:
- |

13
docs/ci Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# This script gets run from CI to render and upload docs
./build
# Only upload if we have defined credentials - we only have these defined for
# trusted commits (i.e. not PRs).
if [[ ! -z "${AWS_ACCESS_KEY_ID}" && $TRAVIS_BRANCH == "updocs" ]]; then
aws s3 sync --acl public-read ./public s3://docs.mitmproxy.org/master
# aws cloudfront create-invalidation --distribution-id E3UCZ4MLN4TO7U \
# --paths "/master"
fi

View File

@ -1,8 +0,0 @@
#!/bin/sh
aws configure set preview.cloudfront true
aws --profile mitmproxy \
s3 sync --acl public-read ./public s3://docs.mitmproxy.org/master
# aws --profile mitmproxy \
# cloudfront create-invalidation --distribution-id E3UCZ4MLN4TO7U \
# --paths "/master"