Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 51 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,56 @@
version: 2
version: 2.1

jobs:
build:
executors:
python36:
docker:
- image: circleci/python:3.6.5
filters:
branches:
only: master
- image: circleci/python:3.6.5

commands:
ditto-transform:
description: Run Ditto in order to transform the base URL to https://pokeapi.co instead of localhost
steps:
- checkout
- run: pip install --user -r requirements.txt
- run:
command: |
~/.local/bin/ditto transform \
--base-url='https://pokeapi.co' \
--src-dir=data \
--dest-dir=_gen
- run: tar czf _gen.tar.gz _gen/*
- store_artifacts:
path: _gen.tar.gz
- run: pip install --user -r requirements.txt
- run:
command: |
~/.local/bin/ditto transform \
--base-url='https://pokeapi.co' \
--src-dir=data \
--dest-dir=_gen

jobs:
test:
executor: python36
steps:
- checkout
- ditto-transform
build:
executor: python36
steps:
- checkout
- ditto-transform
- run: tar czf _gen.tar.gz _gen/*
- store_artifacts:
path: _gen.tar.gz
deploy:
executor: python36
steps:
# Trigger a new build of the deploy project
- run: "curl -X POST --header \"Content-Type: application/json\" https://circleci.com/api/v1.1/project/github/PokeAPI/deploy/build?circle-token=$CIRCLECI_API_TOKEN"
- run: "curl -X POST --header \"Content-Type: application/json\" https://circleci.com/api/v1.1/project/github/PokeAPI/deploy/build?circle-token=$CIRCLECI_API_TOKEN"

workflows:
version: 2
test-build-and-deploy:
jobs:
- test
- build:
requires:
- test
filters:
branches:
only: master
- deploy:
requires:
- build
filters:
branches:
only: master