Files
Iris/.circleci/config.yml

95 lines
2.4 KiB
YAML
Raw Normal View History

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:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
2019-04-11 12:12:39 +12:00
- run:
name: Install npm dependencies
2019-04-11 12:12:39 +12:00
command: npm install
- run:
name: Build code
2019-04-11 12:12:39 +12:00
command: npm run build
2019-04-11 11:16:43 +12:00
- run:
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
key: v1-dependencies-{{ checksum "package.json" }}
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 11:43:36 +12:00
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
2019-04-11 11:16:43 +12:00
- run:
name: Run tests
command: npm run test
2019-04-11 13:58:28 +12:00
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
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:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
2019-04-11 11:16:43 +12:00
- run:
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:
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:
branches:
only: develop
2019-04-11 13:46:17 +12:00
build_test_and_deploy:
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:
- 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