Skip to content

Instantly share code, notes, and snippets.

@andrew-candela
Last active October 26, 2018 09:43
Show Gist options
  • Save andrew-candela/b9a9915ebef26bc5506022d947237d1a to your computer and use it in GitHub Desktop.
Save andrew-candela/b9a9915ebef26bc5506022d947237d1a to your computer and use it in GitHub Desktop.
circleCI config
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/python:3.5.6
working_directory: ~/repo
steps:
- checkout
- restore_cache:
name: Restore PIP Cache
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
- v1-dependencies
- run:
name: Install Dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}
- run:
name: Run nosetests
command: |
. venv/bin/activate
echo "hello world!"
- store_test_results:
path: test-reports
- store_artifacts:
path: test-reports
deploy:
docker:
- image: circleci/python:3.5.6
working_directory: ~/repo
steps:
- run:
name: package repo into egg file
command: python setup.py bdist_egg
- run:
name: ship to S3
command: aws s3 cp --recursive ./dist/ s3://my-bucket/path
test_job:
docker:
- image: circleci/python:3.5.6
working_directory: ~/repo
steps:
- run:
name: package repo into egg file
command: echo "hello world"
workflows:
version: 2
build-n-deploy:
jobs:
- build:
context: org-global
- test_job:
context: org-global
requires:
- build
# filters:
# branches:
# only: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment