Skip to content

Commit

Permalink
Merge pull request #23 from dojot/fix_doc
Browse files Browse the repository at this point in the history
Fix: documentation
  • Loading branch information
Mariane Previde committed Oct 18, 2019
2 parents bf58066 + f81a648 commit c07e8ca
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -17,15 +17,16 @@ script:
- bash start-test.sh

after_success:
- docker run --volume $(pwd)/src/docs:/home/node/apiary:Z giovannicuriel/aglio -i /home/node/apiary/apiary.apib -o - > ./apiary_${TRAVIS_BRANCH}.html
- chmod +x travis/publish.sh
- chmod +x travis/deploy-gh-pages.sh
- docker build -t ${TRAVIS_REPO_SLUG} -f DockerFile .
- travis/publish.sh
- travis/deploy-gh-pages.sh

deploy:
provider: pages
skip_cleanup: true
keep_history: true
github_token: $GITHUB_TOKEN
on:
branch: ${TRAVIS_BRANCH}
branch: ${TRAVIS_BRANCH}
File renamed without changes.
4 changes: 2 additions & 2 deletions dredd.yml
Expand Up @@ -27,5 +27,5 @@ hooks-worker-term-retry: 500
hooks-worker-handler-host: 127.0.0.1
hooks-worker-handler-port: 61321
config: ./dredd.yml
blueprint: ./src/docs/apiary.apib
endpoint: 'http://127.0.0.1:3000'
blueprint: ./docs/apiary.apib
endpoint: 'http://127.0.0.1:3000'
28 changes: 28 additions & 0 deletions travis/deploy-gh-pages.sh
@@ -0,0 +1,28 @@
if [ $TRAVIS_PULL_REQUEST == false ] ; then
git remote add -f origin-gh-pages https://github.com/${TRAVIS_REPO_SLUG}
git fetch origin-gh-pages
git checkout .
git checkout -b temp-pages origin-gh-pages/gh-pages -f
git checkout origin-gh-pages/${TRAVIS_BRANCH} -- ./docs
rm -fr ./_static
mv docs/* . -f
git rm -r docs


if [ "${TRAVIS_BRANCH}" == "master" ]
then
export VERSION="latest"
else
export VERSION="${TRAVIS_BRANCH}"
fi

docker run --volume $(pwd):/temp:Z dojot/aglio -i /temp/apiary.apib -o - > ./apiary_${VERSION}.html

git add apiary_${VERSION}.html
git commit -m 'Updating gh-pages'
git push --force http://${GITHUB_TOKEN}:x-oauth-basic@github.com/${TRAVIS_REPO_SLUG} temp-pages:gh-pages

git checkout .
git clean -fd
git checkout ${TRAVIS_BRANCH} origin-gh-pages/${TRAVIS_BRANCH}
fi

0 comments on commit c07e8ca

Please sign in to comment.