maestro-server/discovery-api

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: python
python:
  - "3.6"
addons:
  apt:
    packages:
      - libgnutls28-dev
install:
  - pip install -r requirements.txt
jobs:
  include:
    - stage: unit test
      script:
      - python -m unittest discover
      
    - stage: coverage
      script:
        - pip install codeclimate-test-reporter coverage==4.3 python-coveralls
        - coverage run --source=app -m unittest discover -s app/tests/
      after_success:
        - codeclimate-test-reporter
        - coveralls

    - stage: build docker image - flask (base)
      if: branch != master
      script:
        - docker build -f Dockerfile -t $REPO_FLASK .
      after_success:
        - docker login -u $DOCKER_USER -p $DOCKER_PASS
        - docker tag $REPO_FLASK $DOCKER_USER/$REPO_FLASK:$TRAVIS_BRANCH
        - docker push $DOCKER_USER/$REPO_FLASK:$TRAVIS_BRANCH

    - stage: build docker image - celery (base)
      if: branch != master
      script:
        - docker build -f DockerfileCelery -t $REPO_CELERY .
      after_success:
        - docker login -u $DOCKER_USER -p $DOCKER_PASS
        - docker tag $REPO_CELERY $DOCKER_USER/$REPO_CELERY:$TRAVIS_BRANCH
        - docker push $DOCKER_USER/$REPO_CELERY:$TRAVIS_BRANCH

    - stage: build docker image - flask (latest)
      if: branch = master
      script:
        - docker build -f Dockerfile -t $REPO_FLASK .
      after_success:
        - docker login -u $DOCKER_USER -p $DOCKER_PASS
        - docker tag $REPO_FLASK $DOCKER_USER/$REPO_FLASK:latest
        - docker push $DOCKER_USER/$REPO_FLASK:latest

    - stage: build docker image - celery (latest)
      if: branch = master
      script:
        - docker build -f DockerfileCelery -t $REPO_CELERY .
      after_success:
        - docker login -u $DOCKER_USER -p $DOCKER_PASS
        - docker tag $REPO_CELERY $DOCKER_USER/$REPO_CELERY:latest
        - docker push $DOCKER_USER/$REPO_CELERY:latest