2017-11-04 23:47:46 +00:00
|
|
|
language: python
|
2019-05-03 18:16:52 +00:00
|
|
|
dist: xenial
|
2017-11-04 23:47:46 +00:00
|
|
|
|
2018-06-17 21:24:39 +00:00
|
|
|
# 3.6 is listed first so it gets used for the later build stages
|
2017-11-04 23:47:46 +00:00
|
|
|
python:
|
2018-07-12 17:36:00 +00:00
|
|
|
- "3.6"
|
2019-05-03 18:16:52 +00:00
|
|
|
- "3.7"
|
2019-11-11 03:45:34 +00:00
|
|
|
- "3.8"
|
2017-11-04 23:47:46 +00:00
|
|
|
|
2018-06-17 21:24:39 +00:00
|
|
|
# Executed for 3.5 AND 3.5 as the first "test" stage:
|
2017-11-04 23:47:46 +00:00
|
|
|
script:
|
2018-06-24 01:03:46 +00:00
|
|
|
- pip install -U pip wheel
|
|
|
|
- pip install .[test]
|
2019-05-25 16:19:30 +00:00
|
|
|
- pytest
|
2018-06-24 01:03:46 +00:00
|
|
|
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.cache/pip
|
2018-06-17 21:24:39 +00:00
|
|
|
|
|
|
|
# This defines further stages that execute after the tests
|
|
|
|
jobs:
|
|
|
|
include:
|
|
|
|
- stage: deploy latest.datasette.io
|
2018-06-18 03:21:02 +00:00
|
|
|
if: branch = master AND type = push
|
2018-06-17 21:24:39 +00:00
|
|
|
script:
|
2019-06-24 03:23:07 +00:00
|
|
|
- pip install .[test]
|
2018-06-17 21:24:39 +00:00
|
|
|
- npm install -g now
|
|
|
|
- python tests/fixtures.py fixtures.db fixtures.json
|
2018-06-17 21:39:45 +00:00
|
|
|
- export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7`
|
2019-12-22 16:04:45 +00:00
|
|
|
- datasette publish nowv1 fixtures.db -m fixtures.json --token=$NOW_TOKEN --branch=$TRAVIS_COMMIT --version-note=$TRAVIS_COMMIT --name=datasette-latest-$ALIAS --alias=latest.datasette.io --alias=$ALIAS.datasette.io --extra-options='--config template_debug:1'
|
2018-06-17 22:19:21 +00:00
|
|
|
- stage: release tagged version
|
2019-07-07 20:03:19 +00:00
|
|
|
if: tag IS present
|
|
|
|
python: 3.6
|
|
|
|
deploy:
|
|
|
|
- provider: pypi
|
|
|
|
user: simonw
|
|
|
|
distributions: bdist_wheel
|
|
|
|
password: ${PYPI_PASSWORD}
|
|
|
|
on:
|
|
|
|
branch: master
|
|
|
|
tags: true
|
|
|
|
- stage: publish docker image
|
2018-06-17 22:19:21 +00:00
|
|
|
if: tag IS present
|
|
|
|
python: 3.6
|
|
|
|
script:
|
|
|
|
- npm install -g now
|
|
|
|
- export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7`
|
|
|
|
- export TAG=`echo $TRAVIS_TAG | sed 's/\./-/g' | sed 's/.*/v&/'`
|
2019-05-11 20:20:36 +00:00
|
|
|
- now alias $ALIAS.datasette.io $TAG.datasette.io --token=$NOW_TOKEN
|
2018-07-24 04:17:57 +00:00
|
|
|
# Build and release to Docker Hub
|
2018-07-24 04:48:36 +00:00
|
|
|
- docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2018-07-24 04:17:57 +00:00
|
|
|
- export REPO=datasetteproject/datasette
|
|
|
|
- docker build -f Dockerfile -t $REPO:$TRAVIS_TAG .
|
2018-09-19 18:23:56 +00:00
|
|
|
- docker tag $REPO:$TRAVIS_TAG $REPO:latest
|
2018-07-24 04:17:57 +00:00
|
|
|
- docker push $REPO
|