2019-04-11 11:16:43 +12:00
|
|
|
version: 2
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
docker:
|
2019-04-11 11:43:36 +12:00
|
|
|
- image: nikolaik/python-nodejs:python2.7-nodejs11
|
2019-04-11 11:16:43 +12:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
2019-04-11 11:43:36 +12:00
|
|
|
- restore_cache:
|
|
|
|
|
keys:
|
2019-04-11 14:37:29 +12:00
|
|
|
- v1-dependencies-{{ checksum "VERSION.md" }}
|
2019-04-11 12:12:39 +12:00
|
|
|
- run:
|
2019-04-11 12:24:09 +12:00
|
|
|
name: Install npm dependencies
|
2019-04-11 12:12:39 +12:00
|
|
|
command: npm install
|
|
|
|
|
- run:
|
2019-04-11 12:24:09 +12:00
|
|
|
name: Build code
|
2019-04-11 12:12:39 +12:00
|
|
|
command: npm run build
|
2019-04-11 11:16:43 +12:00
|
|
|
- run:
|
2019-04-11 12:24:09 +12:00
|
|
|
name: Install python dependencies
|
2019-04-11 12:12:39 +12:00
|
|
|
command: pip install -e .
|
2019-04-11 11:43:36 +12:00
|
|
|
- save_cache:
|
|
|
|
|
paths:
|
|
|
|
|
- node_modules
|
2019-04-11 14:26:06 +12:00
|
|
|
- mopidy_iris
|
2019-04-11 14:37:29 +12:00
|
|
|
key: v1-dependencies-{{ checksum "VERSION.md" }}
|
2019-04-11 11:34:38 +12:00
|
|
|
test:
|
2019-04-11 11:16:43 +12:00
|
|
|
docker:
|
2019-04-11 11:43:36 +12:00
|
|
|
- image: nikolaik/python-nodejs:python2.7-nodejs11
|
2019-04-11 11:16:43 +12:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
2019-04-11 14:31:58 +12:00
|
|
|
- restore_cache:
|
|
|
|
|
keys:
|
2019-04-11 14:37:29 +12:00
|
|
|
- v1-dependencies-{{ checksum "VERSION.md" }}
|
2019-04-11 11:16:43 +12:00
|
|
|
- run:
|
2019-04-11 12:24:09 +12:00
|
|
|
name: Run tests
|
|
|
|
|
command: npm run test
|
2019-04-11 11:34:38 +12:00
|
|
|
deploy:
|
|
|
|
|
docker:
|
2019-04-11 13:58:28 +12:00
|
|
|
- image: nikolaik/python-nodejs:python2.7-nodejs11
|
2019-04-11 11:34:38 +12:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
2019-04-11 11:43:36 +12:00
|
|
|
- restore_cache:
|
|
|
|
|
keys:
|
2019-04-11 14:37:29 +12:00
|
|
|
- v1-dependencies-{{ checksum "VERSION.md" }}
|
2019-04-11 11:16:43 +12:00
|
|
|
- run:
|
2019-04-11 12:24:09 +12:00
|
|
|
name: Prepare .pypirc
|
2019-04-11 11:16:43 +12:00
|
|
|
command: |
|
2019-04-11 14:11:39 +12:00
|
|
|
echo -e "[distutils]" >> ~/.pypirc
|
|
|
|
|
echo -e "index-servers =" >> ~/.pypirc
|
|
|
|
|
echo -e " pypi" >> ~/.pypirc
|
|
|
|
|
echo -e "[distutils]" >> ~/.pypirc
|
2019-04-11 11:16:43 +12:00
|
|
|
echo -e "[pypi]" >> ~/.pypirc
|
|
|
|
|
echo -e "username = jaedb" >> ~/.pypirc
|
|
|
|
|
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
|
|
|
|
|
- run:
|
2019-04-11 12:24:09 +12:00
|
|
|
name: Create and distribute package to pypi
|
|
|
|
|
command: python setup.py sdist upload -r pypi
|
2019-04-11 11:16:43 +12:00
|
|
|
workflows:
|
|
|
|
|
version: 2
|
2019-04-11 13:46:17 +12:00
|
|
|
build_and_test:
|
2019-04-11 11:16:43 +12:00
|
|
|
jobs:
|
2019-04-11 12:25:11 +12:00
|
|
|
- build:
|
|
|
|
|
filters:
|
|
|
|
|
branches:
|
|
|
|
|
only: develop
|
2019-04-11 11:34:38 +12:00
|
|
|
- test:
|
2019-04-11 11:16:43 +12:00
|
|
|
requires:
|
|
|
|
|
- build
|
2019-04-11 11:34:38 +12:00
|
|
|
filters:
|
2019-04-11 12:24:09 +12:00
|
|
|
branches:
|
|
|
|
|
only: develop
|
2019-04-11 13:46:17 +12:00
|
|
|
build_test_and_deploy:
|
2019-04-11 12:24:09 +12:00
|
|
|
jobs:
|
2019-04-11 12:25:11 +12:00
|
|
|
- build:
|
|
|
|
|
filters:
|
2019-04-11 12:34:16 +12:00
|
|
|
branches:
|
|
|
|
|
only: master
|
2019-04-11 12:25:11 +12:00
|
|
|
- test:
|
|
|
|
|
requires:
|
|
|
|
|
- build
|
|
|
|
|
filters:
|
2019-04-11 12:34:16 +12:00
|
|
|
branches:
|
|
|
|
|
only: master
|
2019-04-11 11:34:38 +12:00
|
|
|
- deploy:
|
|
|
|
|
requires:
|
2019-04-11 12:24:09 +12:00
|
|
|
- build
|
2019-04-11 11:34:38 +12:00
|
|
|
- test
|
2019-04-11 11:16:43 +12:00
|
|
|
filters:
|
2019-04-11 12:34:16 +12:00
|
|
|
branches:
|
|
|
|
|
only: master
|