rycus86/docker-pygen

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: python
sudo: true
python:
  - '2.7'
  - '3.4'
  - '3.6'

install: skip
script:
  # prepare python modules
  - pip install -r requirements.txt
  - pip install -r test-requirements.txt
  - pip install coveralls
  # prepare reporter
  - curl -fsSL https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  - chmod +x ./cc-test-reporter
  # run the tests with Docker Swarm being active
  - docker swarm init
  # python tests
  - PYTHONPATH=src python -m coverage run --branch --source=src -m unittest discover -s tests -v
  # coverage reports
  - python -m coverage report -m
  - python -m coverage xml
  - |
    if [[ "$(python --version 2>&1)" = *2.7* ]]; then
      coveralls || exit 0
      ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT || exit 0
    fi

jobs:
  include:
    - &integration-stage
      stage: integration
      script:
       - pip install -r test-requirements.txt
       - PYTHONPATH=tests python -m unittest discover -s tests -v -p it_*.py
      env:    DIND_VERSION=18.05

    - <<: *integration-stage
      env:    DIND_VERSION=18.03

    - <<: *integration-stage
      env:    DIND_VERSION=18.01

    - <<: *integration-stage
      env:    DIND_VERSION=17.12

    - <<: *integration-stage
      env:    DIND_VERSION=17.09

    - <<: *integration-stage
      env:    DIND_VERSION=17.07

    - <<: *integration-stage
      env:    DIND_VERSION=17.05

    - <<: *integration-stage
      env:    DIND_VERSION=17.03

    - <<: *integration-stage
      env:    DIND_VERSION=1.13

    - &deploy-stage
      stage: deploy
      if: branch = master
      script:
        - ./.travis.docker.build.sh
        - ./.travis.docker.deploy.sh
      env:
        - ARCH=amd64
        - BASE_IMAGE=alpine

    - <<: *deploy-stage
      env:
        - ARCH=armhf
        - BASE_IMAGE=rycus86/armhf-alpine-qemu

    - <<: *deploy-stage
      env:
        - ARCH=aarch64
        - BASE_IMAGE=rycus86/arm64v8-alpine-qemu

    - stage: manifest
      if: branch = master
      script:
        - echo ${DOCKER_PASSWORD} | docker login --username "rycus86" --password-stdin
        - curl -fsSL https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-amd64 > ./manifest-tool
        - chmod +x ./manifest-tool
        - ./manifest-tool push from-spec manifest.yml
        - ./manifest-tool push from-spec manifest-worker.yml