diff --git a/.travis.yml b/.travis.yml index a2a159426..a59608035 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,22 @@ ---- addons: - firefox: "latest" - + firefox: latest sudo: false -language: node_js - -node_js: -- '5.0.0' - +language: python +python: +- 2.7 env: global: - DISPLAY=:99.0 - - secure: |- - AZ/GEWzykeSzxh+4r14eKq2dMQnZyEvx99zFnTSp30Ke9QqJP3UQvMdwHzuV - 7jqjzHQUYMFl8o7VATMm7WeXiSURmzRP2F51W/v0rfhUyTo9BMiCxHmcI3up - wRMBtB4rJxzk3q5sUR32ucVs/fNlOCMC9M02fnSEijGw4Y+WOhc= - - secure: |- - sEQ0OSwK/9SUqLXB+w8n9oEdFEdLxZTBdMhC5fUrsCjgstfUSSgzYOT9cTFp - awR42/q/Akos2eA8NWx5yU+hRC5rr+oQG5Eio0tzi9+y3a6VXDvgS1h2SaQz - TR/MjA/29gFvV7bnp1LSs2TdZx+NGhLd4zHv01XZ+pQk/nQiW9w= - + - DOCS_GH_REF: github.com/FineUploader/docs.fineuploader.com + # fineuploader-docs-bot access token: + - secure: nDapj/IyKyPhcD6eHWqd3YnydZ3AHZDeiuAxgBOiYllSZ5AxlTahET0MX58rRp+8RsvNCZ4EBbEQ2u7I4JoqAwGyx8LhwA0q64ZQ7xI7RSHttgN289Xt4V4NEjUv1ObJgRxfXKqMbpHvU+0CVGdXunB4inconN6dOIXfGsq4HaM= +install: + - . $HOME/.nvm/nvm.sh + - nvm install 5.0.0 + - nvm use 5.0.0 + - npm install before_script: -- "sh -e /etc/init.d/xvfb start" +- sh -e /etc/init.d/xvfb start +script: +- npm test +- if [ $TRAVIS_TEST_RESULT -eq 0 ]; then make docs-travis; fi diff --git a/Makefile b/Makefile index 17752a38e..1994b290b 100644 --- a/Makefile +++ b/Makefile @@ -404,6 +404,42 @@ copy-azure-jquery-dist: copy-all-dist: make copy-build-to-dist PUB-SUBDIR=all.fine-uploader +docs: install-docfu + git config --global user.email "fineuploader-docs-bot@raynicholus.com" + git config --global user.name "fineuploader-docs-bot" + docfu --$(type) "$(type-value)" "FineUploader/fine-uploader" "docfu-temp" + git clone --depth 1 https://github.com/FineUploader/docs.fineuploader.com.git + cp -pR docfu-temp/$(type) docs.fineuploader.com/ + (cd docs.fineuploader.com ; git add .) + (cd docs.fineuploader.com ; git diff --cached --quiet || git commit -a -m "update docs for $(type) $(type-value)") + @(cd docs.fineuploader.com ; git push https://$(DOCS_PUSH_ACCESS_TOKEN)@$(DOCS_GH_REF)) + make maybe-update-root-docs +.PHONY: docs + +maybe-update-root-docs: +ifndef TRAVIS_TAG +ifeq ($(TRAVIS_BRANCH), master) + cp -pR docs.fineuploader.com/branch/master/ docs.fineuploader.com/ +endif +endif +.PHONY: maybe-update-root-docs + +docs-travis: +ifneq ($(TRAVIS_PULL_REQUEST), false) + @echo skipping docs build - not a non-PR or tag push +else ifdef TRAVIS_TAG + make docs type=tag type-value=$(TRAVIS_TAG) +else + make docs type=branch type-value=$(TRAVIS_BRANCH) +endif +.PHONY: docs-travis + +install-docfu: + git clone --depth 1 -b hotfix/cant-generate-docs-from-old-branches https://github.com/FineUploader/docfu + (cd docfu ; python setup.py install) + rm -rf docfu +.PHONY: install-docfu + tag-release: ifeq ($(simulate), true) @echo version is $(version)