95 lines
2.4 KiB
YAML
95 lines
2.4 KiB
YAML
version: 2
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- image: nikolaik/python-nodejs:python2.7-nodejs11
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- v1-dependencies-{{ checksum "package.json" }}
|
|
- v1-dependencies-
|
|
- run:
|
|
name: Install npm dependencies
|
|
command: npm install
|
|
- run:
|
|
name: Build code
|
|
command: npm run build
|
|
- run:
|
|
name: Install python dependencies
|
|
command: pip install -e .
|
|
- save_cache:
|
|
paths:
|
|
- node_modules
|
|
key: v1-dependencies-{{ checksum "package.json" }}
|
|
test:
|
|
docker:
|
|
- image: nikolaik/python-nodejs:python2.7-nodejs11
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- v1-dependencies-{{ checksum "package.json" }}
|
|
- v1-dependencies-
|
|
- run:
|
|
name: Run tests
|
|
command: npm run test
|
|
- save_cache:
|
|
paths:
|
|
- node_modules
|
|
key: v1-dependencies-{{ checksum "package.json" }}
|
|
deploy:
|
|
docker:
|
|
- image: nikolaik/python-nodejs:python2.7-nodejs11
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- v1-dependencies-{{ checksum "package.json" }}
|
|
- v1-dependencies-
|
|
- run:
|
|
name: Prepare .pypirc
|
|
command: |
|
|
echo -e "[distutils]" >> ~/.pypirc
|
|
echo -e "index-servers =" >> ~/.pypirc
|
|
echo -e " pypi" >> ~/.pypirc
|
|
echo -e "[distutils]" >> ~/.pypirc
|
|
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
|
|
workflows:
|
|
version: 2
|
|
build_and_test:
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
branches:
|
|
only: develop
|
|
- test:
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
only: develop
|
|
build_test_and_deploy:
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
branches:
|
|
only: master
|
|
- test:
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
only: master
|
|
- deploy:
|
|
requires:
|
|
- build
|
|
- test
|
|
filters:
|
|
branches:
|
|
only: master |