esphome/.gitlab-ci.yml

343 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/
BASE_VERSION: '2.1.1'
2019-05-28 10:23:15 +02:00
TZ: UTC
stages:
- lint
2018-08-26 11:26:14 +02:00
- test
- deploy
.lint: &lint
2019-05-28 10:23:15 +02:00
image: esphome/esphome-lint:latest
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:
2019-05-28 10:23:15 +02:00
- script/setup
tags:
2019-02-13 21:14:03 +01:00
- docker
2018-08-26 11:26:14 +02:00
.test: &test
2019-05-28 10:39:24 +02:00
image: esphome/esphome-lint:latest
2018-08-26 11:26:14 +02:00
stage: test
before_script:
2019-05-28 10:23:15 +02:00
- script/setup
2018-08-26 11:26:14 +02:00
tags:
2019-02-13 21:14:03 +01:00
- docker
2018-08-26 11:26:14 +02:00
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 multiarch/qemu-user-static:5.0.0-2 --reset -p yes
2019-02-13 21:14:03 +01:00
- TAG="${CI_COMMIT_TAG#v}"
- TAG="${TAG:-${CI_COMMIT_SHA:0:7}}"
- echo "Tag ${TAG}"
- |
if [[ "${IS_HASSIO}" == "YES" ]]; then
2019-05-28 10:23:15 +02:00
BUILD_FROM=esphome/esphome-hassio-base-${BUILD_ARCH}:${BASE_VERSION}
2019-02-13 21:14:03 +01:00
BUILD_TO=esphome/esphome-hassio-${BUILD_ARCH}
DOCKERFILE=docker/Dockerfile.hassio
else
2019-05-28 10:23:15 +02:00
BUILD_FROM=esphome/esphome-base-${BUILD_ARCH}:${BASE_VERSION}
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
2019-05-28 10:23:15 +02:00
lint-custom:
<<: *lint
script:
- script/ci-custom.py
lint-python:
<<: *lint
script:
- script/lint-python
lint-tidy:
<<: *lint
script:
2019-05-28 10:23:15 +02:00
- pio init --ide atom
- script/clang-tidy --all-headers --fix
- script/ci-suggest-changes
2019-05-28 10:23:15 +02:00
lint-format:
<<: *lint
script:
2019-05-28 10:23:15 +02:00
- script/clang-format -i
- script/ci-suggest-changes
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
2019-05-28 10:23:15 +02:00
<<: *lint
2018-08-26 11:26:14 +02:00
stage: deploy
2018-10-20 18:26:44 +02:00
script:
2019-05-28 11:49:11 +02:00
- pip install twine wheel
2019-05-28 10:23:15 +02:00
- python setup.py sdist bdist_wheel
- twine upload dist/*
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:
2019-05-28 10:23:15 +02:00
- /^v([0-9\.]+)$/
2019-02-13 21:14:03 +01:00
except:
2019-05-28 10:23:15 +02:00
- branches
2019-02-13 21:14:03 +01:00
.beta: &beta
<<: *docker-base
only:
2019-05-28 10:23:15 +02:00
- /^v([0-9\.]+b\d+)$/
2019-02-13 21:14:03 +01:00
except:
2019-05-28 10:23:15 +02:00
- branches
2019-02-13 21:14:03 +01:00
.dev: &dev
<<: *docker-base
only:
2019-05-28 10:23:15 +02:00
- dev
2019-02-13 21:14:03 +01:00
2019-05-28 10:23:15 +02:00
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-05-28 10:23:15 +02:00
armv7-beta-docker:
2019-02-17 15:54:15 +01:00
<<: *beta
variables:
BETA: "YES"
2019-05-28 10:23:15 +02:00
BUILD_ARCH: armv7
2019-02-17 15:54:15 +01:00
IS_HASSIO: "NO"
RELEASE: "YES"
2019-05-28 10:23:15 +02:00
armv7-beta-hassio:
2019-02-13 21:14:03 +01:00
<<: *beta
variables:
BETA: "YES"
2019-05-28 10:23:15 +02:00
BUILD_ARCH: armv7
2019-02-13 21:14:03 +01:00
IS_HASSIO: "YES"
RELEASE: "YES"
2019-05-28 10:23:15 +02:00
armv7-dev-docker:
2019-02-17 15:54:15 +01:00
<<: *dev
variables:
2019-05-28 10:23:15 +02:00
BUILD_ARCH: armv7
2019-02-17 15:54:15 +01:00
DEV: "YES"
IS_HASSIO: "NO"
2019-05-28 10:23:15 +02:00
armv7-dev-hassio:
2019-02-17 15:54:15 +01:00
<<: *dev
variables:
2019-05-28 10:23:15 +02:00
BUILD_ARCH: armv7
2019-02-17 15:54:15 +01:00
DEV: "YES"
IS_HASSIO: "YES"
2019-05-28 10:23:15 +02:00
armv7-latest-docker:
2019-02-17 15:54:15 +01:00
<<: *latest
variables:
BETA: "YES"
2019-05-28 10:23:15 +02:00
BUILD_ARCH: armv7
2019-02-17 15:54:15 +01:00
IS_HASSIO: "NO"
LATEST: "YES"
RELEASE: "YES"
2019-05-28 10:23:15 +02:00
armv7-latest-hassio:
2019-02-13 21:14:03 +01:00
<<: *latest
variables:
BETA: "YES"
2019-05-28 10:23:15 +02:00
BUILD_ARCH: armv7
2019-02-13 21:14:03 +01:00
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"