Fixed "datasette publish now ... --alias=x"

The --alias argument can now be passed more than once.

Also updated our Travis configuration to use this.

Fixes #459
This commit is contained in:
Simon Willison 2019-05-11 13:20:36 -07:00
commit 09ef305c68
4 changed files with 47 additions and 38 deletions

View file

@ -27,11 +27,7 @@ jobs:
- npm install -g now
- python tests/fixtures.py fixtures.db fixtures.json
- export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7`
- echo "{\"name\":\"datasette-latest-$ALIAS\",\"alias\":\"latest.datasette.io\"}" > now.json
- datasette publish now fixtures.db -m fixtures.json --token=$NOW_TOKEN --branch=$TRAVIS_COMMIT --version-note=$TRAVIS_COMMIT --name=datasette-latest-$ALIAS
- now --target production --token=$NOW_TOKEN
- echo "{\"name\":\"datasette-latest-$ALIAS\",\"alias\":\"$ALIAS.datasette.io\"}" > now.json
- now --target production --token=$NOW_TOKEN
- datasette publish now 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
- stage: release tagged version
if: tag IS present
python: 3.6
@ -39,8 +35,7 @@ jobs:
- npm install -g now
- export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7`
- export TAG=`echo $TRAVIS_TAG | sed 's/\./-/g' | sed 's/.*/v&/'`
- echo "{\"name\":\"datasette-latest-$ALIAS\",\"alias\":\"$TAG.datasette.io\"}" > now.json
- now --target production --token=$NOW_TOKEN
- now alias $ALIAS.datasette.io $TAG.datasette.io --token=$NOW_TOKEN
# Build and release to Docker Hub
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- export REPO=datasetteproject/datasette