From 449bb9383b49d98b2542b97805578b4cee3b3f1a Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 13 Mar 2018 11:43:44 -0700 Subject: [PATCH] [MAINT] Migrate to CircleCI 2.0 (#39) * [MAINT] Migrate to CircleCI 2.0 * fix config.yml * do not change workspace * fix build * fix web server * fix web server --- .circleci/config.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 25 ----------------------- 2 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..dcd77dd --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,48 @@ +version: 2 +jobs: + + build_and_test: + working_directory: /home/circleci/mriqcwebapi + + machine: + image: circleci/classic:201711-01 + + environment: + - SECRET_KEY: CI + - MONGODB_HOST: mongodb + - MONGODB_PORT: 27017 + - API_TOKEN: + - API_URL: "http://localhost/docs/api" + + steps: + - checkout + - run: + name: Install dependencies + command: | + pip install docker-compose + pip install requests + - run: + name: Set-up dockereve + command: | + mkdir -p dockereve-master/nginx/.ssl + touch dockereve-master/nginx/.ssl/mriqcep.crt + touch dockereve-master/nginx/.ssl/mriqcep.key + docker pull mongo:latest + docker pull swaggerapi/swagger-ui:v3.0.12 + docker pull nginx:latest + docker-compose -f dockereve-master/docker-compose.yml build + - run: + name: Start server + command: docker-compose -f dockereve-master/docker-compose.yml up -d + - run: + name: Test MRIQC WebAPI + command: python test/testGetPost.py + +workflows: + version: 2 + webapi: + jobs: + - build_and_test: + filters: + tags: + only: /.*/ diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 5fae6a1..0000000 --- a/circle.yml +++ /dev/null @@ -1,25 +0,0 @@ -dependencies: - override: - - pip install docker-compose - - pip install requests - -machine: - environment: - SECRET_KEY: CI - MONGODB_HOST: mongodb - MONGODB_PORT: 27017 - API_TOKEN: - API_URL: "http://localhost/docs/api" - services: - - docker - -test: - pre: - - mkdir dockereve-master/nginx/.ssl - - touch dockereve-master/nginx/.ssl/mriqcep.crt - - touch dockereve-master/nginx/.ssl/mriqcep.key - - docker-compose -f dockereve-master/docker-compose.yml build - override: - - docker-compose -f dockereve-master/docker-compose.yml up -d - - sleep 60 - - python test/testGetPost.py