2018-06-22 19:49:50 +03:00
|
|
|
version: 2.0
|
|
|
|
jobs:
|
|
|
|
build-deploy: # build for the master branch
|
|
|
|
machine: true
|
|
|
|
working_directory: ~/redash-ui-tests
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Build docker image and push to repo
|
|
|
|
command: |
|
|
|
|
docker version
|
|
|
|
make build
|
|
|
|
docker tag redash-ui-tests mozilla/redash-ui-tests:latest
|
|
|
|
docker login -u "${DOCKERHUB_USER}" -p "${DOCKERHUB_PASS}"
|
|
|
|
docker push mozilla/redash-ui-tests:latest
|
|
|
|
build-release: # build for tags
|
|
|
|
machine: true
|
|
|
|
working_directory: ~/redash-ui-tests
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Build docker image and push to repo
|
|
|
|
command: |
|
|
|
|
docker version
|
|
|
|
make build
|
|
|
|
docker tag redash-ui-tests "mozilla/redash-ui-tests:${CIRCLE_TAG}"
|
|
|
|
docker login -u "${DOCKERHUB_USER}" -p "${DOCKERHUB_PASS}"
|
|
|
|
docker push "mozilla/redash-ui-tests:${CIRCLE_TAG}"
|
2018-06-27 12:25:36 +03:00
|
|
|
integration_tests:
|
2018-06-22 19:49:50 +03:00
|
|
|
working_directory: ~/redash-ui-tests
|
|
|
|
machine: true
|
|
|
|
steps:
|
2018-06-27 19:41:12 +03:00
|
|
|
- checkout
|
2018-06-22 19:49:50 +03:00
|
|
|
- run:
|
|
|
|
name: Install Docker Compose
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
pip install docker-compose>=1.18
|
|
|
|
docker-compose --version
|
|
|
|
- run:
|
|
|
|
name: Pull images and build ui-tests image
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
docker-compose up -d
|
|
|
|
sleep 20
|
|
|
|
- run:
|
|
|
|
name: Start container and setup redash instance
|
|
|
|
command: |
|
|
|
|
docker-compose ps
|
|
|
|
make setup-redash
|
|
|
|
- run:
|
|
|
|
name: Run tests
|
|
|
|
command: |
|
|
|
|
make docker-ui-tests
|
|
|
|
- store_artifacts:
|
|
|
|
path: report.html
|
2018-06-23 06:50:21 +03:00
|
|
|
code_quality:
|
|
|
|
working_directory: ~/redash-ui-tests
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.6.5
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Install dependencies
|
2018-06-27 19:41:12 +03:00
|
|
|
command: |
|
2018-06-23 06:50:21 +03:00
|
|
|
pip install pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
- run:
|
|
|
|
name: Flake8
|
|
|
|
command: make flake8
|
|
|
|
- run:
|
|
|
|
name: Formatting check
|
|
|
|
command: make formatting
|
2018-06-28 15:03:38 +03:00
|
|
|
- run:
|
|
|
|
name: Static type check
|
|
|
|
command: make mypy
|
2018-06-22 19:49:50 +03:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build_test_deploy_release:
|
|
|
|
jobs:
|
2018-06-27 19:41:12 +03:00
|
|
|
- build-deploy:
|
|
|
|
requires:
|
|
|
|
- integration_tests
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
- build-release:
|
|
|
|
requires:
|
|
|
|
- integration_tests
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-06-27 12:25:36 +03:00
|
|
|
- integration_tests
|
2018-06-27 19:41:12 +03:00
|
|
|
- code_quality
|