forked from codalab/codalab-worksheets
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
64 lines (64 loc) · 2.65 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
jobs:
include:
- stage: check
language: python
python: 3.6
install: pip install --upgrade black==18.9b0
script: black . --check --diff
- stage: check
language: javascript
install: cd frontend && npm install
script:
- npm run check-ci
- stage: check
language: python
sudo: required
services:
- docker
env:
- CODALAB_USERNAME=codalab CODALAB_PASSWORD=codalab CI=true
python: 3.6
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- sudo service mysql stop
install:
- python3 codalab_service.py build services --version ${TRAVIS_BRANCH} --pull $([ -z "${CODALAB_DOCKER_USERNAME}" ] || [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ] || echo "--push")
- python3 codalab_service.py start --services default monitor --version ${TRAVIS_BRANCH}
script:
- python3 codalab_service.py test --version ${TRAVIS_BRANCH} default
# Make sure restarting worker doesn't cause any issues (ie in serialization/deserialization)
- docker restart codalab_worker_1 && python3 codalab_service.py test run --version ${TRAVIS_BRANCH}
- docker stop codalab_worker_1
- python3 codalab_service.py start --services worker --version ${TRAVIS_BRANCH} --shared-file-system
- python3 codalab_service.py test --version ${TRAVIS_BRANCH} --shared-file-system basic run read write kill resources netcat netcurl workers
- stage: deploy
script: echo "Deploying"
language: python
sudo: required
services:
- docker
env:
- CODALAB_USERNAME=codalab CODALAB_PASSWORD=codalab CI=true
python: 3.6
after_success: echo "skipped"
before_deploy:
- pip install twine
deploy:
# Build docker images using tag if it's a version tag (we're releasing)
# Otherwise if we're on master or staging build named images
- provider: script
# Remove first char of tag (v) to get version number from tag
script: ./scripts/travis-deploy.sh ${TRAVIS_TAG#?}
on:
# only build on valid semver tags
tags: true
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+
- provider: script
# Build with branch name if not releasing
script: ./scripts/travis-deploy.sh master
on:
# only build for master and staging for debugging
branch: master