From d5c50e4d6395af6b5d332c8f7708f05c19889e09 Mon Sep 17 00:00:00 2001 From: Jodie Putrino Date: Wed, 11 Oct 2017 15:44:14 -0600 Subject: [PATCH] Fixes #161 --- .travis.yml | 90 +++++++++++++++++------------------ docs/doc_scripts/test-docs.sh | 36 +++----------- 2 files changed, 51 insertions(+), 75 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2344088..52c9d29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,55 +5,55 @@ python: services: - docker env: - - PYTHONPATH=~/heat:/home/travis/f5-common-python:$PWD + - PYTHONPATH=~/heat:/home/travis/f5-common-python:$PWD before_install: - - docker pull f5devcentral/containthedocs - - sudo apt-get -qq update - - git config --global user.email "OpenStack_TravisCI@f5.com" - - git config --global user.name "Travis F5 Openstack" - - sudo apt-get -y install build-essential libssl-dev libffi-dev python-dev - - git clone https://github.com/openstack/heat.git ~/heat - - cd ~/heat/ - - git checkout tags/kilo-eol - - cd $TRAVIS_BUILD_DIR + - docker pull f5devcentral/containthedocs + - sudo apt-get -qq update + - git config --global user.email "OpenStack_TravisCI@f5.com" + - git config --global user.name "Travis F5 Openstack" + - sudo apt-get -y install build-essential libssl-dev libffi-dev python-dev + - git clone https://github.com/openstack/heat.git ~/heat + - cd ~/heat/ + - git checkout tags/kilo-eol + - cd $TRAVIS_BUILD_DIR install: - - pip install -r requirements.unit.test.txt - - pip install -r ~/heat/requirements.txt + - pip install -r requirements.unit.test.txt + - pip install -r ~/heat/requirements.txt script: - - flake8 f5_heat/resources/ - - py.test f5_heat/resources/test --cov=f5_heat/resources - - python setup.py sdist - - ./docs/doc_scripts/docker-docs.sh ./docs/doc_scripts/test-docs.sh + - flake8 f5_heat/resources/ + - py.test f5_heat/resources/test --cov=f5_heat/resources + - python setup.py sdist + - ./docs/doc_scripts/docker-docs.sh ./docs/doc_scripts/test-docs.sh deploy: - - provider: pypi - user: $PYPI_USER - password: $PYPI_PASSWORD - server: https://pypi.python.org/pypi - on: - all_branches: true - tags: true - python: 2.7 - skip_cleanup: true - # deploy docs to s3 - # if this is not a tagged release, the docs will deploy to /products/openstack/heat-plugins/$TRAVIS_BRANCH - - provider: script - skip_cleanup: true - on: - repo: F5Networks/f5-openstack-heat-plugins - branch: kilo - condition: $TRAVIS_TAG = "" - script: - - ./docs/doc_scripts/deploy-docs.sh publish-product-docs-to-prod openstack/heat-plugins $TRAVIS_BRANCH - # if this is a tagged release, the docs go to /products/openstack/heat-plugins/$TRAVIS_BRANCH/vX.Y - - provider: script - skip_cleanup: true - env: - - RELEASE_TAG="$(echo $TRAVIS_TAG |cut -c1-4)" - on: - tags: true - repo: F5Networks/f5-openstack-heat-plugins - script: - - ./scripts/deploy-docs.sh publish-product-docs-to-prod openstack/heat-plugins/$TRAVIS_BRANCH $RELEASE_TAG +- provider: pypi + user: $PYPI_USER + password: $PYPI_PASSWORD + server: https://pypi.python.org/pypi + on: + all_branches: true + tags: true + python: 2.7 + skip_cleanup: true +# deploy docs to s3 +# if this is not a tagged release, the docs will deploy to /products/openstack/heat-plugins/$TRAVIS_BRANCH +- provider: script + skip_cleanup: true + on: + repo: F5Networks/f5-openstack-heat-plugins + branch: kilo + condition: $TRAVIS_TAG = "" + script: + - ./docs/doc_scripts/deploy-docs.sh publish-product-docs-to-prod openstack/heat-plugins $TRAVIS_BRANCH +# if this is a tagged release, the docs go to /products/openstack/heat-plugins/$TRAVIS_BRANCH/vX.Y +- provider: script + skip_cleanup: true + env: + - RELEASE_TAG=$(echo $TRAVIS_TAG | cut -d . -f 1,2) + on: + tags: true + repo: F5Networks/f5-openstack-heat-plugins + script: + - ./scripts/deploy-docs.sh publish-product-docs-to-prod openstack/heat-plugins/$TRAVIS_BRANCH $RELEASE_TAG notifications: slack: rooms: diff --git a/docs/doc_scripts/test-docs.sh b/docs/doc_scripts/test-docs.sh index dc5f49e..a4fb13b 100755 --- a/docs/doc_scripts/test-docs.sh +++ b/docs/doc_scripts/test-docs.sh @@ -1,41 +1,17 @@ #!/usr/bin/env bash -html="make -C docs html" -grammar="write-good `find ./docs -not \( -path ./docs/drafts -prune \) -name '*.rst'` --passive --so --no-illusion --thereIs --cliches" - -if [[ $TRAVIS != "" ]]; then - OUTPUT=$TRAVIS_BUILD_DIR/_build/linkcheck/output.txt -else - OUTPUT=docs/_build/linkcheck/output.txt -fi - -goodjob() { - printf "%s\n" "$*" >&2 - -} +set -e +set -x echo "Installing project dependencies" pip install --user -r requirements.txt -linkcheck=$(make -C docs linkcheck | grep 'broken') - -set -e -set -x - echo "Building docs with Sphinx" -$html +make -C docs clean +make -C docs html echo "Checking grammar and style" -$grammar - -[[ $grammar = "" ]] || goodjob "CONGRATULATIONS! You are a grammar wizard." +write-good `find ./docs -not \( -path ./docs/drafts -prune \) -name '*.rst'` --passive --so --no-illusion --thereIs --cliches -set +x -set +e echo "Checking links" -if [[ $linkcheck == "" ]]; then - echo "Linkcheck succeeded" -else - echo "WARNING: linkcheck failed. Fix the following broken links:" - grep 'broken' $OUTPUT -fi +make -C docs linkcheck | grep "broken" || true