Fix docker build

This commit is contained in:
Otto Winter
2018-08-26 11:26:14 +02:00
parent 1576e1847e
commit 74c70509c2
19 changed files with 1086 additions and 28 deletions
+54 -8
View File
@@ -5,6 +5,7 @@ variables:
stages:
- lint
- test
- build
- deploy
@@ -14,7 +15,20 @@ stages:
- python2.7
- esphomeyaml-lint
.hassio-builder: &hassio-builder
.test: &test
stage: test
before_script:
- pip install -e .
tags:
- python2.7
- esphomeyaml-test
variables:
TZ: UTC
cache:
paths:
- tests/build
.docker-builder: &docker-builder
before_script:
- docker info
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
@@ -33,8 +47,13 @@ pylint:
script:
- pylint esphomeyaml
.build: &build
<<: *hassio-builder
test:
<<: *test
script:
- esphomeyaml tests/test1.yaml compile
.build-hassio: &build-hassio
<<: *docker-builder
stage: build
script:
- |
@@ -49,10 +68,11 @@ pylint:
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}"
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}"
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:dev"
retry: 1
# Generic deploy template
.deploy: &deploy
<<: *hassio-builder
<<: *docker-builder
stage: deploy
script:
- version=${CI_COMMIT_TAG:1}
@@ -71,8 +91,20 @@ pylint:
- docker push "ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:latest"
# Build jobs
build:normal:
<<: *docker-builder
stage: build
script:
- docker build -t "${CI_REGISTRY}/ottowinter/esphomeyaml:dev" .
- |
docker tag \
"${CI_REGISTRY}/ottowinter/esphomeyaml:dev" \
"${CI_REGISTRY}/ottowinter/esphomeyaml:${CI_COMMIT_SHA}"
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml:${CI_COMMIT_SHA}"
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml:dev"
build:armhf:
<<: *build
<<: *build-hassio
variables:
ADDON_ARCH: armhf
@@ -82,12 +114,12 @@ build:armhf:
# ADDON_ARCH: aarch64
build:i386:
<<: *build
<<: *build-hassio
variables:
ADDON_ARCH: i386
build:amd64:
<<: *build
<<: *build-hassio
variables:
ADDON_ARCH: amd64
@@ -119,7 +151,6 @@ deploy:i386:
except:
- /^(?!master).+@/
deploy:amd64:
<<: *deploy
variables:
@@ -129,3 +160,18 @@ deploy:amd64:
except:
- /^(?!master).+@/
deploy:pypi:
stage: deploy
before_script:
- pip install -e .
- pip install twine
script:
- python setup.py sdist
- twine upload dist/*
tags:
- python2.7
- esphomeyaml-test
only:
- /^v\d+\.\d+\.\d+(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?$/
except:
- /^(?!master).+@/