Skip to content

Commit

Permalink
Rework travis-ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
kumy committed Jan 27, 2019
1 parent 82f9d75 commit b2acff6
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 2,717 deletions.
155 changes: 83 additions & 72 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,95 @@
language: python
sudo: required
group: edge
addons:
apt:
packages:
- python-dev
- libmysqlclient-dev
cache:
pip: true
directories:
- $HOME/.nvm/versions/node/
- pip
python:
- 2.7
# - 3.5
# before-install:
# - npm -g install npm@latest

services:
- rabbitmq
addons:
- mariadb: '10.0'

env:
- >-
APP_CONFIG="config.TestingConfig"
DATABASE_URL=mysql+mysqldb://root@localhost/geokrety_unittest?charset=utf8mb4
TEST_DATABASE_URL=mysql+mysqldb://root@localhost/geokrety_unittest?charset=utf8mb4
SERVE_STATIC=true
MINIO_ACCESS_KEY=access_key
MINIO_SECRET_KEY=secret_key
MINIO_ENDPOINT=127.0.0.1:9000
MINIO_BROWSER=off
stages:
- name: test
- name: deploy-binaries
if: tag IS present AND repo = "geokrety/geokrety-api"
- name: deploy-documentation
if: tag IS present AND repo = "geokrety/geokrety-api"

before_install:
# installing newer docker
- wget https://dl.minio.io/server/minio/release/linux-amd64/minio && chmod +x minio
- mkdir .vars && ./minio server .vars &
jobs:
include:
- stage: test
name: testing code
services:
- rabbitmq
addons:
- mariadb: '10.0'
- apt:
packages:
- python-dev
- libmysqlclient-dev
env:
- >-
APP_CONFIG="config.TestingConfig"
DATABASE_URL=mysql+mysqldb://root@localhost/geokrety_unittest?charset=utf8mb4
TEST_DATABASE_URL=mysql+mysqldb://root@localhost/geokrety_unittest?charset=utf8mb4
SERVE_STATIC=true
MINIO_ACCESS_KEY=access_key
MINIO_SECRET_KEY=secret_key
MINIO_ENDPOINT=127.0.0.1:9000
MINIO_BROWSER=off
before_script:
- wget https://dl.minio.io/server/minio/release/linux-amd64/minio && chmod +x minio
- mkdir .vars && ./minio server .vars &
- mysql -e 'FLUSH TABLES; DROP DATABASE IF EXISTS geokrety_unittest; CREATE DATABASE geokrety_unittest CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
- pip install -r requirements/tests.txt
script:
- nosetests tests/ -v --with-coverage --with-id --nologcapture --stop
after_success:
- 'bash <(curl -s https://codecov.io/bash)'
- python-codacy-coverage -r coverage.xml
# - 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then cat docs/*.apib > apiary.apib; dredd; fi' # TODO: Enable later, it's quite long during initial dev

install:
# - npm list -g [email protected] --depth=0 || npm install -g [email protected]
- pip install -r requirements/tests.txt
before_script:
- mysql -e 'FLUSH TABLES; DROP DATABASE IF EXISTS geokrety_unittest; CREATE DATABASE geokrety_unittest CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
script:
- nosetests tests/ -v --with-coverage --with-id --nologcapture --stop
after_success:
- 'bash <(curl -s https://codecov.io/bash)'
- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then python-codacy-coverage -r coverage.xml; fi'
# - 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then cat docs/*.apib > apiary.apib; dredd; fi' # TODO: Enable later, it's quite long during initial dev
- stage: deploy-binaries
name: deploy binaries
script:
- python setup.py sdist
deploy:
- provider: releases
api_key:
secure: pOLHKxFohWDtsZWupq0ps0R4xsun2AoStnkU1seOvP526AhCQRDrPlRxmtdLelGssyGvVT5vmjlUO59UZFeOPU8QF23ekvZxjWOpJaMB9zuV4b5SFEmi79n3QMRLbotLuSqA0zsd+eff1HBCbXwT/qSMVRNvCpylCQG+Ibtel6RzZrSkG46n7X2tJSkvfp51C204SN+BvGjY2cDGz09LNFNDc7WNHFZfndJvahCb7yimcjwA4Q8jCC+oRyyO5D3Vqij69C0/nHctpPuoHjJsQLfrl3NKCMQrBenpLX1sGrJWjGQLHmyf8WEt3XDXFiupmsuYjLsvpDg+GKbKrxZUN51MJ8oRlJ5O8Y/LVPQmMXx0RZjy/ffp0EZJELA60P1cr0DG09JVobR4++ZWl2fgPuGeg0nTBuiSX5oQQcLgrerk59sXwbh8QoecMrpWl9UP5uqh4mTFWbvKgy1kEAYhopyrlpMD4wlqL4d+nH9HTEd0mTGGzC2MxtnEbu9ErR0gJcBlkVA81L9tdvQuBpN9aRnuy1/c98pOjqLf1+oqzHl0wsLEzPF6SlGU9MYBk+KflEo3dcNGFNcaA/ULZdA1Z9NDskEFqXi9dsCi0hH4fEvr6PIarREZCRt8AivounWZVkaL6KrcFPFfdLk6tu+iGlQ3uc0VX+Vt6Vyc1Y5c4Kw=
file_glob: true
file: dist/geokrety-api-*.tar.gz
skip_cleanup: true
on:
repo: geokrety/geokrety-api
tags: true
- provider: pypi
user: geokrety-bot
password:
secure: MTfwKPOeG79UuNaLWjlCxtoP97CGCJkVKr5Cn9zAN/7wEetfra+9bT/1NKCB8ZwHh6mdE3tOwwV4fDr9gzlM78MtxH9qCTvgPjt/gPi1/2fJoQ75f40ytvDru8YIDtkCEF0eqlYdRBEP1CuC+6c+TYYRMw8QRZbC5+L2zPnrSQscAjU9HugPZt/+WT3iH1qTRPAyHdqnBCEN8RHHGMrYZTHwmGUPk4z63ZUFip7lsubVrDoXYn8GadwBMGpFxh43f8MMVU7ffc8C8FHK1eoaTXHIVTbiHlB95BFa7hkhEvSeqi397G7dsT1NLSzRF+kIF9VvsQYcaOuncGAQNwfWxu3cMUM8XkFgXjOy2jUd2L1mSBgokhukX3F7/kwN0RTp3AX64P6Vqa17R5+hVOiTW6WYhpN1Qg+HAjHOihn1Z6Geg8KLlrxF1zZGfmUnjrRC/szBZd6z78QPgAYO+LqMSrDGoo82cD/MYe02QglHIJQpPjmeQxZJpZmOLYJYJgqc24O4oJYI3LuunUVaM9HWo4Yd+dbg1wyO4n8BRaEINGXeP63Qnw8RnkA7iRLsniaNs9R/hPp9OihuOn4BUOvMkuVehhti95ghL+UJCkwIOXnKAnfEG7sLKMsC0YCMe4KHAEMvzvp1FhEjkXBVKwv4datMMWTNJULtVT4dzUToT1c=
on:
repo: geokrety/geokrety-api
tags: true


before_deploy:
- python setup.py sdist
- npm -g install npm@latest
- npm list -g aglio --depth=0 || npm install -g aglio
- aglio -i docs/apiary.apib -o docs/index.html --theme-variables slate --theme-full-width --no-theme-condense
deploy:
- provider: pages
skip_cleanup: true
local_dir: docs/
github_token:
secure: pOLHKxFohWDtsZWupq0ps0R4xsun2AoStnkU1seOvP526AhCQRDrPlRxmtdLelGssyGvVT5vmjlUO59UZFeOPU8QF23ekvZxjWOpJaMB9zuV4b5SFEmi79n3QMRLbotLuSqA0zsd+eff1HBCbXwT/qSMVRNvCpylCQG+Ibtel6RzZrSkG46n7X2tJSkvfp51C204SN+BvGjY2cDGz09LNFNDc7WNHFZfndJvahCb7yimcjwA4Q8jCC+oRyyO5D3Vqij69C0/nHctpPuoHjJsQLfrl3NKCMQrBenpLX1sGrJWjGQLHmyf8WEt3XDXFiupmsuYjLsvpDg+GKbKrxZUN51MJ8oRlJ5O8Y/LVPQmMXx0RZjy/ffp0EZJELA60P1cr0DG09JVobR4++ZWl2fgPuGeg0nTBuiSX5oQQcLgrerk59sXwbh8QoecMrpWl9UP5uqh4mTFWbvKgy1kEAYhopyrlpMD4wlqL4d+nH9HTEd0mTGGzC2MxtnEbu9ErR0gJcBlkVA81L9tdvQuBpN9aRnuy1/c98pOjqLf1+oqzHl0wsLEzPF6SlGU9MYBk+KflEo3dcNGFNcaA/ULZdA1Z9NDskEFqXi9dsCi0hH4fEvr6PIarREZCRt8AivounWZVkaL6KrcFPFfdLk6tu+iGlQ3uc0VX+Vt6Vyc1Y5c4Kw=
target_branch: gh-pages
on:
tags: true

- provider: releases
api_key:
secure: pOLHKxFohWDtsZWupq0ps0R4xsun2AoStnkU1seOvP526AhCQRDrPlRxmtdLelGssyGvVT5vmjlUO59UZFeOPU8QF23ekvZxjWOpJaMB9zuV4b5SFEmi79n3QMRLbotLuSqA0zsd+eff1HBCbXwT/qSMVRNvCpylCQG+Ibtel6RzZrSkG46n7X2tJSkvfp51C204SN+BvGjY2cDGz09LNFNDc7WNHFZfndJvahCb7yimcjwA4Q8jCC+oRyyO5D3Vqij69C0/nHctpPuoHjJsQLfrl3NKCMQrBenpLX1sGrJWjGQLHmyf8WEt3XDXFiupmsuYjLsvpDg+GKbKrxZUN51MJ8oRlJ5O8Y/LVPQmMXx0RZjy/ffp0EZJELA60P1cr0DG09JVobR4++ZWl2fgPuGeg0nTBuiSX5oQQcLgrerk59sXwbh8QoecMrpWl9UP5uqh4mTFWbvKgy1kEAYhopyrlpMD4wlqL4d+nH9HTEd0mTGGzC2MxtnEbu9ErR0gJcBlkVA81L9tdvQuBpN9aRnuy1/c98pOjqLf1+oqzHl0wsLEzPF6SlGU9MYBk+KflEo3dcNGFNcaA/ULZdA1Z9NDskEFqXi9dsCi0hH4fEvr6PIarREZCRt8AivounWZVkaL6KrcFPFfdLk6tu+iGlQ3uc0VX+Vt6Vyc1Y5c4Kw=
file_glob: true
file: dist/geokrety-api-*.tar.gz
skip_cleanup: true
on:
tags: true
repo: geokrety/geokrety-api

- provider: pypi
user: geokrety-bot
password:
secure: MTfwKPOeG79UuNaLWjlCxtoP97CGCJkVKr5Cn9zAN/7wEetfra+9bT/1NKCB8ZwHh6mdE3tOwwV4fDr9gzlM78MtxH9qCTvgPjt/gPi1/2fJoQ75f40ytvDru8YIDtkCEF0eqlYdRBEP1CuC+6c+TYYRMw8QRZbC5+L2zPnrSQscAjU9HugPZt/+WT3iH1qTRPAyHdqnBCEN8RHHGMrYZTHwmGUPk4z63ZUFip7lsubVrDoXYn8GadwBMGpFxh43f8MMVU7ffc8C8FHK1eoaTXHIVTbiHlB95BFa7hkhEvSeqi397G7dsT1NLSzRF+kIF9VvsQYcaOuncGAQNwfWxu3cMUM8XkFgXjOy2jUd2L1mSBgokhukX3F7/kwN0RTp3AX64P6Vqa17R5+hVOiTW6WYhpN1Qg+HAjHOihn1Z6Geg8KLlrxF1zZGfmUnjrRC/szBZd6z78QPgAYO+LqMSrDGoo82cD/MYe02QglHIJQpPjmeQxZJpZmOLYJYJgqc24O4oJYI3LuunUVaM9HWo4Yd+dbg1wyO4n8BRaEINGXeP63Qnw8RnkA7iRLsniaNs9R/hPp9OihuOn4BUOvMkuVehhti95ghL+UJCkwIOXnKAnfEG7sLKMsC0YCMe4KHAEMvzvp1FhEjkXBVKwv4datMMWTNJULtVT4dzUToT1c=
on:
tags: true
repo: geokrety/geokrety-api
- stage: deploy-documentation
name: deploy documentation
language: node_js
cache:
- directories:
- $HOME/.nvm/versions/node/
before_install:
- npm install -g aglio
script:
- aglio -i docs/apiary.apib -o docs/index.html --theme-variables slate --theme-full-width --no-theme-condense
deploy:
- provider: pages
skip_cleanup: true
local_dir: docs/
github_token:
secure: pOLHKxFohWDtsZWupq0ps0R4xsun2AoStnkU1seOvP526AhCQRDrPlRxmtdLelGssyGvVT5vmjlUO59UZFeOPU8QF23ekvZxjWOpJaMB9zuV4b5SFEmi79n3QMRLbotLuSqA0zsd+eff1HBCbXwT/qSMVRNvCpylCQG+Ibtel6RzZrSkG46n7X2tJSkvfp51C204SN+BvGjY2cDGz09LNFNDc7WNHFZfndJvahCb7yimcjwA4Q8jCC+oRyyO5D3Vqij69C0/nHctpPuoHjJsQLfrl3NKCMQrBenpLX1sGrJWjGQLHmyf8WEt3XDXFiupmsuYjLsvpDg+GKbKrxZUN51MJ8oRlJ5O8Y/LVPQmMXx0RZjy/ffp0EZJELA60P1cr0DG09JVobR4++ZWl2fgPuGeg0nTBuiSX5oQQcLgrerk59sXwbh8QoecMrpWl9UP5uqh4mTFWbvKgy1kEAYhopyrlpMD4wlqL4d+nH9HTEd0mTGGzC2MxtnEbu9ErR0gJcBlkVA81L9tdvQuBpN9aRnuy1/c98pOjqLf1+oqzHl0wsLEzPF6SlGU9MYBk+KflEo3dcNGFNcaA/ULZdA1Z9NDskEFqXi9dsCi0hH4fEvr6PIarREZCRt8AivounWZVkaL6KrcFPFfdLk6tu+iGlQ3uc0VX+Vt6Vyc1Y5c4Kw=
target_branch: gh-pages
keep-history: false
verbose: true
on:
repo: geokrety/geokrety-api
tags: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GeoKrety API Server enable to track GeoKrety objects. The system provides API en

# Documentation

[Api documentation](https://geokrety.github.io/geokrety-api/api.html) is available online.
[Api documentation](https://geokrety.github.io/geokrety-api/index.html) is available online.

# License

Expand Down
1 change: 0 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
*.html
Loading

0 comments on commit b2acff6

Please sign in to comment.