2018-06-13 11:13:53 +02:00
|
|
|
---
|
|
|
|
# Based on https://gitlab.com/hassio-addons/addon-node-red/blob/master/.gitlab-ci.yml
|
|
|
|
variables:
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- lint
|
2018-08-26 11:26:14 +02:00
|
|
|
- test
|
2018-06-13 11:13:53 +02:00
|
|
|
- build
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
.lint: &lint
|
|
|
|
stage: lint
|
2018-12-05 21:22:06 +01:00
|
|
|
before_script:
|
|
|
|
- pip install -e .
|
2018-06-13 11:13:53 +02:00
|
|
|
tags:
|
|
|
|
- python2.7
|
2019-02-13 16:54:02 +01:00
|
|
|
- esphome-lint
|
2018-06-13 11:13:53 +02:00
|
|
|
|
2018-08-26 11:26:14 +02:00
|
|
|
.test: &test
|
|
|
|
stage: test
|
|
|
|
before_script:
|
|
|
|
- pip install -e .
|
|
|
|
tags:
|
|
|
|
- python2.7
|
2019-02-13 16:54:02 +01:00
|
|
|
- esphome-test
|
2018-08-26 11:26:14 +02:00
|
|
|
variables:
|
|
|
|
TZ: UTC
|
|
|
|
|
|
|
|
.docker-builder: &docker-builder
|
2018-06-13 11:13:53 +02:00
|
|
|
before_script:
|
|
|
|
- docker info
|
|
|
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
tags:
|
|
|
|
- hassio-builder
|
|
|
|
|
|
|
|
flake8:
|
|
|
|
<<: *lint
|
|
|
|
script:
|
2019-02-13 16:54:02 +01:00
|
|
|
- flake8 esphome
|
2018-06-13 11:13:53 +02:00
|
|
|
|
|
|
|
pylint:
|
|
|
|
<<: *lint
|
|
|
|
script:
|
2019-02-13 16:54:02 +01:00
|
|
|
- pylint esphome
|
2018-06-13 11:13:53 +02:00
|
|
|
|
2018-09-26 18:39:41 +02:00
|
|
|
test1:
|
2018-08-26 11:26:14 +02:00
|
|
|
<<: *test
|
|
|
|
script:
|
2019-02-13 16:54:02 +01:00
|
|
|
- esphome tests/test1.yaml compile
|
2018-08-26 11:26:14 +02:00
|
|
|
|
2018-09-26 18:39:41 +02:00
|
|
|
test2:
|
|
|
|
<<: *test
|
|
|
|
script:
|
2019-02-13 16:54:02 +01:00
|
|
|
- esphome tests/test2.yaml compile
|
2018-09-26 18:39:41 +02:00
|
|
|
|
2019-02-13 16:54:02 +01:00
|
|
|
test3:
|
|
|
|
<<: *test
|
2018-10-20 18:20:21 +02:00
|
|
|
script:
|
2019-02-13 16:54:02 +01:00
|
|
|
- esphome tests/test3.yaml compile
|
2018-06-13 11:13:53 +02:00
|
|
|
|
|
|
|
# Build jobs
|
2018-08-26 11:26:14 +02:00
|
|
|
build:normal:
|
|
|
|
<<: *docker-builder
|
|
|
|
stage: build
|
|
|
|
script:
|
2019-02-13 16:54:02 +01:00
|
|
|
- docker build -t "${CI_REGISTRY}/esphome/esphome:dev" .
|
2018-06-13 11:13:53 +02:00
|
|
|
|
2018-10-20 18:20:21 +02:00
|
|
|
.deploy-pypi: &deploy-pypi
|
2018-08-26 11:26:14 +02:00
|
|
|
stage: deploy
|
2018-10-20 18:26:44 +02:00
|
|
|
before_script:
|
|
|
|
- pip install -e .
|
|
|
|
- pip install twine
|
|
|
|
script:
|
|
|
|
- python setup.py sdist
|
|
|
|
- twine upload dist/*
|
|
|
|
tags:
|
|
|
|
- python2.7
|
2019-02-13 16:54:02 +01:00
|
|
|
- esphome-test
|
2018-10-20 18:20:21 +02:00
|
|
|
|
|
|
|
deploy-release:pypi:
|
|
|
|
<<: *deploy-pypi
|
2018-08-26 11:26:14 +02:00
|
|
|
only:
|
2018-10-20 18:20:21 +02:00
|
|
|
- /^v\d+\.\d+\.\d+$/
|
2018-08-26 11:26:14 +02:00
|
|
|
except:
|
|
|
|
- /^(?!master).+@/
|
2018-10-20 18:20:21 +02:00
|
|
|
|
|
|
|
deploy-beta:pypi:
|
|
|
|
<<: *deploy-pypi
|
|
|
|
only:
|
|
|
|
- /^v\d+\.\d+\.\d+b\d+$/
|
|
|
|
except:
|
|
|
|
- /^(?!rc).+@/
|