From 0deb8080b2b514939af3a297b2fa3b44db8c9811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Pezz=C3=A8?= Date: Sun, 26 Apr 2020 16:35:52 +0200 Subject: [PATCH 1/4] fix(circleci_: run on master only --- .circleci/config.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 60bcc279b7..06a2acdb11 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,9 +4,6 @@ jobs: build: docker: - image: circleci/python:3.6.5 - filters: - branches: - only: master steps: - checkout - run: pip install --user -r requirements.txt @@ -19,6 +16,21 @@ jobs: - run: tar czf _gen.tar.gz _gen/* - store_artifacts: path: _gen.tar.gz - + deploy: # 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" + +workflows: + version: 2 + build-and-deploy: + jobs: + - build: + filters: + branches: + only: master + - deploy: + requires: + - build + filters: + branches: + only: master \ No newline at end of file From 51bfca908ff30b1f750a16907d17a978be26d576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Pezz=C3=A8?= Date: Sun, 26 Apr 2020 16:39:07 +0200 Subject: [PATCH 2/4] fix(circleci): add executor --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06a2acdb11..5c319e7c14 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,9 @@ jobs: - store_artifacts: path: _gen.tar.gz deploy: + docker: + - image: circleci/python:3.6.5 + 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" From 43594b33d9082db6286862076b1ae16180ba21be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Pezz=C3=A8?= Date: Sun, 26 Apr 2020 17:11:29 +0200 Subject: [PATCH 3/4] feat(circleci): run test ditto/upgrade to 2.1 --- .circleci/config.yml | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c319e7c14..ff548900f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,33 +1,50 @@ -version: 2 +version: 2.1 -jobs: - build: +executors: + python36: docker: - - image: circleci/python:3.6.5 + - 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 + 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: - docker: - - image: circleci/python:3.6.5 + 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" workflows: version: 2 - build-and-deploy: + test-build-and-deploy: jobs: + - test - build: + requires: + - test filters: branches: only: master From 7d223d2d96063ecfe6f0c447bd1d0dbb22b37f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Pezz=C3=A8?= Date: Sun, 26 Apr 2020 17:17:54 +0200 Subject: [PATCH 4/4] fix(circleci): use new indentation --- .circleci/config.yml | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff548900f3..4b08e599c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,48 +9,48 @@ commands: ditto-transform: description: Run Ditto in order to transform the base URL to https://pokeapi.co instead of localhost steps: - - 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: 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 + - checkout + - ditto-transform build: executor: python36 steps: - - checkout - - ditto-transform - - run: tar czf _gen.tar.gz _gen/* - - store_artifacts: - path: _gen.tar.gz + - 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 \ No newline at end of file + - test + - build: + requires: + - test + filters: + branches: + only: master + - deploy: + requires: + - build + filters: + branches: + only: master \ No newline at end of file