From 8792e072108b46cda4d80a9d47d43e3c460e5c62 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 7 Mar 2018 08:00:55 +1300 Subject: [PATCH] docs: enable upload to docs.mitmproxy.org/master --- .travis.yml | 61 +++++++++++++++++++++++++++------------------- docs/ci | 13 ++++++++++ docs/upload-master | 8 ------ 3 files changed, 49 insertions(+), 33 deletions(-) create mode 100755 docs/ci delete mode 100755 docs/upload-master diff --git a/.travis.yml b/.travis.yml index c22038fd8..9df9bd15b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: - | diff --git a/docs/ci b/docs/ci new file mode 100755 index 000000000..416738ae0 --- /dev/null +++ b/docs/ci @@ -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 diff --git a/docs/upload-master b/docs/upload-master deleted file mode 100755 index c8fcda807..000000000 --- a/docs/upload-master +++ /dev/null @@ -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"