esphome/.gitlab-ci.yml

348 lines
6.3 KiB
YAML
Raw Normal View History

---
# Based on https://gitlab.com/hassio-addons/addon-node-red/blob/master/.gitlab-ci.yml
variables:
DOCKER_DRIVER: overlay2
2019-02-13 21:14:03 +01:00
DOCKER_HOST: tcp://docker:2375/
stages:
- lint
2018-08-26 11:26:14 +02:00
- test
- deploy
.lint: &lint
2019-02-13 21:14:03 +01:00
image: esphome/esphome-base-amd64
stage: lint
[Huge] Util Refactor, Dashboard Improvements, Hass.io Auth API, Better Validation Errors, Conditions, Custom Platforms, Substitutions (#234) * Implement custom sensor platform * Update * Ethernet * Lint * Fix * Login page * Rename cookie secret * Update manifest * Update cookie check logic * Favicon * Fix * Favicon manifest * Fix * Fix * Fix * Use hostname * Message * Temporary commit for screenshot * Automatic board selection * Undo temporary commit * Update esphomeyaml-edge * In-dashboard editing and hosting files locally * Update esphomeyaml-edge * Better ANSI color escaping * Message * Lint * Download Efficiency * Fix gitlab * Fix * Rename extra_libraries to libraries * Add example * Update README.md * Update README.md * Update README.md * HassIO -> Hass.io * Updates * Add update available notice * Update * Fix substitutions * Better error message * Re-do dashboard ANSI colors * Only include FastLED if user says so * Autoscroll logs * Remove old checks * Use safer RedirectText * Improvements * Fix * Use enviornment variable * Use http://hassio/host/info * Fix conditions * Update platformio versions * Revert "Use enviornment variable" This reverts commit 7f038eb5d26df72f76ea9ae76774e2cec1fd7f59. * Fix * README update * Temp * Better invalid config messages * Platformio debug * Improve error messages * Debug * Remove debug * Multi Conf * Update * Better paths * Remove unused * Fixes * Lint * lib_ignore * Try fix platformio colors * Fix dashboard scrolling * Revert * Lint * Revert
2018-12-05 21:22:06 +01:00
before_script:
- pip install -e .
2019-02-13 21:14:03 +01:00
- pip install flake8==3.6.0 pylint==1.9.4 pillow
tags:
2019-02-13 21:14:03 +01:00
- docker
2018-08-26 11:26:14 +02:00
.test: &test
2019-02-13 21:14:03 +01:00
image: esphome/esphome-base-amd64
2018-08-26 11:26:14 +02:00
stage: test
before_script:
- pip install -e .
tags:
2019-02-13 21:14:03 +01:00
- docker
2018-08-26 11:26:14 +02:00
variables:
TZ: UTC
2019-02-13 21:14:03 +01:00
.docker-base: &docker-base
image: esphome/esphome-base-builder
before_script:
- docker info
2019-02-13 21:14:03 +01:00
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
script:
- docker run --rm --privileged hassioaddons/qemu-user-static:latest
- TAG="${CI_COMMIT_TAG#v}"
- TAG="${TAG:-${CI_COMMIT_SHA:0:7}}"
- echo "Tag ${TAG}"
- |
if [[ "${IS_HASSIO}" == "YES" ]]; then
BUILD_FROM=esphome/esphome-hassio-base-${BUILD_ARCH}:1.5.1
2019-02-13 21:14:03 +01:00
BUILD_TO=esphome/esphome-hassio-${BUILD_ARCH}
DOCKERFILE=docker/Dockerfile.hassio
else
BUILD_FROM=esphome/esphome-base-${BUILD_ARCH}:1.5.1
2019-02-13 21:14:03 +01:00
if [[ "${BUILD_ARCH}" == "amd64" ]]; then
BUILD_TO=esphome/esphome
else
BUILD_TO=esphome/esphome-${BUILD_ARCH}
fi
DOCKERFILE=docker/Dockerfile
fi
- |
docker build \
--build-arg "BUILD_FROM=${BUILD_FROM}" \
--build-arg "BUILD_VERSION=${TAG}" \
--tag "${BUILD_TO}:${TAG}" \
--file "${DOCKERFILE}" \
.
- |
if [[ "${RELEASE}" = "YES" ]]; then
echo "Pushing to ${BUILD_TO}:${TAG}"
docker push "${BUILD_TO}:${TAG}"
fi
- |
if [[ "${LATEST}" = "YES" ]]; then
echo "Pushing to :latest"
docker tag ${BUILD_TO}:${TAG} ${BUILD_TO}:latest
docker push ${BUILD_TO}:latest
fi
- |
if [[ "${BETA}" = "YES" ]]; then
echo "Pushing to :beta"
docker tag \
${BUILD_TO}:${TAG} \
${BUILD_TO}:beta
docker push ${BUILD_TO}:beta
fi
- |
if [[ "${DEV}" = "YES" ]]; then
echo "Pushing to :dev"
docker tag \
${BUILD_TO}:${TAG} \
${BUILD_TO}:dev
docker push ${BUILD_TO}:dev
fi
services:
- docker:dind
tags:
2019-02-13 21:14:03 +01:00
- docker
stage: deploy
flake8:
<<: *lint
script:
- flake8 esphome
pylint:
<<: *lint
script:
- pylint esphome
2018-09-26 18:39:41 +02:00
test1:
2018-08-26 11:26:14 +02:00
<<: *test
script:
- esphome tests/test1.yaml compile
2018-08-26 11:26:14 +02:00
2018-09-26 18:39:41 +02:00
test2:
<<: *test
script:
- esphome tests/test2.yaml compile
2018-09-26 18:39:41 +02:00
test3:
<<: *test
2018-10-20 18:20:21 +02:00
script:
- esphome tests/test3.yaml compile
2018-10-20 18:20:21 +02:00
.deploy-pypi: &deploy-pypi
2018-08-26 11:26:14 +02:00
stage: deploy
2019-02-13 21:14:03 +01:00
image: python:2.7
2018-10-20 18:26:44 +02:00
before_script:
- pip install -e .
- pip install twine
script:
- python setup.py sdist bdist_wheel
2018-10-20 18:26:44 +02:00
- twine upload dist/*
tags:
2019-02-13 21:14:03 +01:00
- docker
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).+@/
2019-02-13 21:14:03 +01:00
.latest: &latest
<<: *docker-base
only:
- /^v([0-9\.]+)$/
except:
- branches
.latest-vars: &latest-vars
RELEASE: YES
LATEST: YES
# Also push to beta tag
BETA: YES
.beta: &beta
<<: *docker-base
only:
- /^v([0-9\.]+b\d+)$/
except:
- branches
.beta-vars: &beta-vars
RELEASE: YES
BETA: YES
.dev: &dev
<<: *docker-base
only:
- dev
.dev-vars: &dev-vars
DEV: YES
#aarch64-beta-docker:
# <<: *beta
# variables:
# BETA: "YES"
# BUILD_ARCH: aarch64
# IS_HASSIO: "NO"
# RELEASE: "YES"
#aarch64-beta-hassio:
# <<: *beta
# variables:
# BETA: "YES"
# BUILD_ARCH: aarch64
# IS_HASSIO: "YES"
# RELEASE: "YES"
#aarch64-dev-docker:
# <<: *dev
# variables:
# BUILD_ARCH: aarch64
# DEV: "YES"
# IS_HASSIO: "NO"
#aarch64-dev-hassio:
# <<: *dev
# variables:
# BUILD_ARCH: aarch64
# DEV: "YES"
# IS_HASSIO: "YES"
#aarch64-latest-docker:
# <<: *latest
# variables:
# BETA: "YES"
# BUILD_ARCH: aarch64
# IS_HASSIO: "NO"
# LATEST: "YES"
# RELEASE: "YES"
#aarch64-latest-hassio:
# <<: *latest
# variables:
# BETA: "YES"
# BUILD_ARCH: aarch64
# IS_HASSIO: "YES"
# LATEST: "YES"
# RELEASE: "YES"
2019-02-13 21:14:03 +01:00
amd64-beta-docker:
<<: *beta
variables:
BETA: "YES"
BUILD_ARCH: amd64
IS_HASSIO: "NO"
RELEASE: "YES"
amd64-beta-hassio:
<<: *beta
variables:
BETA: "YES"
BUILD_ARCH: amd64
IS_HASSIO: "YES"
RELEASE: "YES"
2019-02-17 15:54:15 +01:00
amd64-dev-docker:
<<: *dev
variables:
BUILD_ARCH: amd64
DEV: "YES"
IS_HASSIO: "NO"
amd64-dev-hassio:
<<: *dev
variables:
BUILD_ARCH: amd64
DEV: "YES"
IS_HASSIO: "YES"
2019-02-13 21:14:03 +01:00
amd64-latest-docker:
<<: *latest
variables:
BETA: "YES"
BUILD_ARCH: amd64
IS_HASSIO: "NO"
LATEST: "YES"
RELEASE: "YES"
amd64-latest-hassio:
<<: *latest
variables:
BETA: "YES"
BUILD_ARCH: amd64
IS_HASSIO: "YES"
LATEST: "YES"
RELEASE: "YES"
2019-02-17 15:54:15 +01:00
armhf-beta-docker:
<<: *beta
variables:
BETA: "YES"
BUILD_ARCH: armhf
IS_HASSIO: "NO"
RELEASE: "YES"
2019-02-13 21:14:03 +01:00
armhf-beta-hassio:
<<: *beta
variables:
BETA: "YES"
BUILD_ARCH: armhf
IS_HASSIO: "YES"
RELEASE: "YES"
2019-02-17 15:54:15 +01:00
armhf-dev-docker:
<<: *dev
variables:
BUILD_ARCH: armhf
DEV: "YES"
IS_HASSIO: "NO"
armhf-dev-hassio:
<<: *dev
variables:
BUILD_ARCH: armhf
DEV: "YES"
IS_HASSIO: "YES"
armhf-latest-docker:
<<: *latest
variables:
BETA: "YES"
BUILD_ARCH: armhf
IS_HASSIO: "NO"
LATEST: "YES"
RELEASE: "YES"
2019-02-13 21:14:03 +01:00
armhf-latest-hassio:
<<: *latest
variables:
BETA: "YES"
BUILD_ARCH: armhf
IS_HASSIO: "YES"
LATEST: "YES"
RELEASE: "YES"
i386-beta-docker:
<<: *beta
variables:
BETA: "YES"
BUILD_ARCH: i386
IS_HASSIO: "NO"
RELEASE: "YES"
i386-beta-hassio:
<<: *beta
variables:
BETA: "YES"
BUILD_ARCH: i386
IS_HASSIO: "YES"
RELEASE: "YES"
2019-02-17 15:54:15 +01:00
i386-dev-docker:
<<: *dev
variables:
BUILD_ARCH: i386
DEV: "YES"
IS_HASSIO: "NO"
i386-dev-hassio:
<<: *dev
variables:
BUILD_ARCH: i386
DEV: "YES"
IS_HASSIO: "YES"
2019-02-13 21:14:03 +01:00
i386-latest-docker:
<<: *latest
variables:
BETA: "YES"
BUILD_ARCH: i386
IS_HASSIO: "NO"
LATEST: "YES"
RELEASE: "YES"
i386-latest-hassio:
<<: *latest
variables:
BETA: "YES"
BUILD_ARCH: i386
IS_HASSIO: "YES"
LATEST: "YES"
RELEASE: "YES"