2019-05-01 07:54:48 +00:00
|
|
|
# https://dev.azure.com/home-assistant
|
|
|
|
|
|
|
|
trigger:
|
2019-05-01 12:42:52 +00:00
|
|
|
batch: true
|
2019-05-01 07:54:48 +00:00
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- dev
|
|
|
|
tags:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
variables:
|
2019-05-02 17:00:39 +00:00
|
|
|
- name: versionBuilder
|
2019-05-08 21:47:01 +00:00
|
|
|
value: '3.2'
|
2019-05-02 17:00:39 +00:00
|
|
|
- name: versionWheels
|
2019-05-08 14:02:19 +00:00
|
|
|
value: '0.3'
|
2019-05-02 17:00:39 +00:00
|
|
|
- group: docker
|
|
|
|
- group: wheels
|
2019-05-14 08:18:01 +00:00
|
|
|
- group: github
|
2019-05-01 07:54:48 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
- job: 'Wheels'
|
|
|
|
condition: eq(variables['Build.SourceBranchName'], 'dev')
|
2019-05-01 19:49:08 +00:00
|
|
|
timeoutInMinutes: 360
|
2019-05-01 07:54:48 +00:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-16.04'
|
|
|
|
strategy:
|
2019-05-01 12:42:52 +00:00
|
|
|
maxParallel: 3
|
2019-05-01 07:54:48 +00:00
|
|
|
matrix:
|
|
|
|
amd64:
|
2019-05-01 08:06:08 +00:00
|
|
|
buildArch: 'amd64'
|
2019-05-01 12:38:51 +00:00
|
|
|
i386:
|
|
|
|
buildArch: 'i386'
|
|
|
|
armhf:
|
|
|
|
buildArch: 'armhf'
|
|
|
|
armv7:
|
|
|
|
buildArch: 'armv7'
|
|
|
|
aarch64:
|
|
|
|
buildArch: 'aarch64'
|
2019-05-01 07:54:48 +00:00
|
|
|
steps:
|
2019-05-01 12:47:38 +00:00
|
|
|
- script: |
|
2019-05-16 07:28:08 +00:00
|
|
|
sudo apt-get update
|
2019-05-01 12:49:12 +00:00
|
|
|
sudo apt-get install -y --no-install-recommends \
|
2019-05-01 12:47:38 +00:00
|
|
|
qemu-user-static \
|
|
|
|
binfmt-support
|
|
|
|
|
|
|
|
sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
|
|
|
|
sudo update-binfmts --enable qemu-arm
|
|
|
|
sudo update-binfmts --enable qemu-aarch64
|
|
|
|
displayName: 'Initial cross build'
|
2019-05-01 11:58:43 +00:00
|
|
|
- script: |
|
2019-05-02 17:00:39 +00:00
|
|
|
mkdir -p .ssh
|
|
|
|
echo -e "-----BEGIN RSA PRIVATE KEY-----\n$(wheelsSSH)\n-----END RSA PRIVATE KEY-----" >> .ssh/id_rsa
|
|
|
|
ssh-keyscan -H $(wheelsHost) >> .ssh/known_hosts
|
|
|
|
chmod 600 .ssh/*
|
2019-05-01 11:58:43 +00:00
|
|
|
displayName: 'Install ssh key'
|
2019-05-01 08:06:08 +00:00
|
|
|
- script: sudo docker pull homeassistant/$(buildArch)-wheels:$(versionWheels)
|
|
|
|
displayName: 'Install wheels builder'
|
2019-05-01 09:01:51 +00:00
|
|
|
- script: |
|
|
|
|
cp requirements_all.txt requirements_hassio.txt
|
|
|
|
|
2019-05-02 08:04:44 +00:00
|
|
|
# Enable because we can build it
|
2019-05-01 09:04:11 +00:00
|
|
|
sed -i "s|# pytradfri|pytradfri|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# pybluez|pybluez|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# bluepy|bluepy|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# beacontools|beacontools|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# RPi.GPIO|RPi.GPIO|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# raspihats|raspihats|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# rpi-rf|rpi-rf|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# blinkt|blinkt|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# fritzconnection|fritzconnection|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# pyuserinput|pyuserinput|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# evdev|evdev|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# smbus-cffi|smbus-cffi|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# i2csense|i2csense|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# python-eq3bt|python-eq3bt|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# pycups|pycups|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# homekit|homekit|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# decora_wifi|decora_wifi|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# decora|decora|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# PySwitchbot|PySwitchbot|g" requirements_hassio.txt
|
|
|
|
sed -i "s|# pySwitchmate|pySwitchmate|g" requirements_hassio.txt
|
2019-05-02 08:04:44 +00:00
|
|
|
|
|
|
|
# Disable because of error
|
|
|
|
sed -i "s|insteonplm|# insteonplm|g" requirements_hassio.txt
|
2019-05-01 09:01:51 +00:00
|
|
|
displayName: 'Prepare requirements files for Hass.io'
|
2019-05-01 07:54:48 +00:00
|
|
|
- script: |
|
2019-05-02 17:00:39 +00:00
|
|
|
sudo docker run --rm -v $(pwd):/data:ro -v $(pwd)/.ssh:/root/.ssh:rw \
|
2019-05-01 08:06:08 +00:00
|
|
|
homeassistant/$(buildArch)-wheels:$(versionWheels) \
|
2019-05-01 08:14:51 +00:00
|
|
|
--apk "build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;linux-headers;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev" \
|
|
|
|
--index https://wheels.hass.io \
|
2019-05-01 12:38:51 +00:00
|
|
|
--requirement requirements_hassio.txt \
|
2019-05-01 08:14:51 +00:00
|
|
|
--upload rsync \
|
2019-05-02 17:00:39 +00:00
|
|
|
--remote wheels@$(wheelsHost):/opt/wheels
|
2019-05-01 07:54:48 +00:00
|
|
|
displayName: 'Run wheels build'
|
2019-05-02 08:29:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
- job: 'Release'
|
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
|
|
timeoutInMinutes: 120
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-16.04'
|
|
|
|
strategy:
|
|
|
|
maxParallel: 5
|
|
|
|
matrix:
|
|
|
|
amd64:
|
|
|
|
buildArch: 'amd64'
|
|
|
|
buildMachine: 'qemux86-64,intel-nuc'
|
|
|
|
i386:
|
|
|
|
buildArch: 'i386'
|
|
|
|
buildMachine: 'qemux86'
|
|
|
|
armhf:
|
|
|
|
buildArch: 'armhf'
|
|
|
|
buildMachine: 'qemuarm,raspberrypi'
|
|
|
|
armv7:
|
|
|
|
buildArch: 'armv7'
|
|
|
|
buildMachine: 'raspberrypi2,raspberrypi3,odroid-xu,tinker'
|
|
|
|
aarch64:
|
|
|
|
buildArch: 'aarch64'
|
|
|
|
buildMachine: 'qemuarm-64,raspberrypi3-64,odroid-c2,orangepi-prime'
|
|
|
|
steps:
|
|
|
|
- script: sudo docker login -u $(dockerUser) -p $(dockerPassword)
|
|
|
|
displayName: 'Docker hub login'
|
|
|
|
- script: sudo docker pull homeassistant/amd64-builder:$(versionBuilder)
|
|
|
|
displayName: 'Install Builder'
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
sudo docker run --rm --privileged \
|
|
|
|
-v ~/.docker:/root/.docker \
|
|
|
|
-v /run/docker.sock:/run/docker.sock:rw \
|
|
|
|
homeassistant/amd64-builder:$(versionBuilder) \
|
|
|
|
--homeassistant $(Build.SourceBranchName) "--$(buildArch)" \
|
|
|
|
-r https://github.com/home-assistant/hassio-homeassistant \
|
|
|
|
-t generic --docker-hub homeassistant
|
|
|
|
|
|
|
|
sudo docker run --rm --privileged \
|
|
|
|
-v ~/.docker:/root/.docker \
|
|
|
|
-v /run/docker.sock:/run/docker.sock:rw \
|
|
|
|
homeassistant/amd64-builder:$(versionBuilder) \
|
|
|
|
--homeassistant-machine "$(Build.SourceBranchName)=$(buildMachine)" \
|
|
|
|
-r https://github.com/home-assistant/hassio-homeassistant \
|
|
|
|
-t machine --docker-hub homeassistant
|
|
|
|
displayName: 'Build Release'
|
2019-05-14 08:18:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
- job: 'ReleasePublish'
|
|
|
|
condition: and(startsWith(variables['Build.SourceBranch'], 'refs/tags'), succeeded('Release'))
|
|
|
|
dependsOn:
|
|
|
|
- 'Release'
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-16.04'
|
|
|
|
steps:
|
|
|
|
- script: |
|
|
|
|
sudo apt-get install -y --no-install-recommends \
|
|
|
|
git jq
|
|
|
|
|
|
|
|
git config --global user.name "Pascal Vizeli"
|
|
|
|
git config --global user.email "pvizeli@syshack.ch"
|
|
|
|
git config --global credential.helper store
|
|
|
|
|
2019-05-16 06:57:43 +00:00
|
|
|
echo "https://$(githubToken):x-oauth-basic@github.com" > $HOME\.git-credentials
|
2019-05-14 08:18:01 +00:00
|
|
|
displayName: 'Install requirements'
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
version="$(Build.SourceBranchName)"
|
|
|
|
|
|
|
|
git clone https://github.com/home-assistant/hassio-version
|
|
|
|
cd hassio-version
|
|
|
|
|
|
|
|
dev_version="$(jq --raw-output '.homeassistant.default' dev.json)"
|
|
|
|
beta_version="$(jq --raw-output '.homeassistant.default' beta.json)"
|
|
|
|
stable_version="$(jq --raw-output '.homeassistant.default' stable.json)"
|
|
|
|
|
|
|
|
if [[ "$version" =~ b ]]; then
|
|
|
|
sed -i "s|$dev_version|$version|g" dev.json
|
|
|
|
sed -i "s|$beta_version|$version|g" beta.json
|
|
|
|
else
|
|
|
|
sed -i "s|$dev_version|$version|g" dev.json
|
|
|
|
sed -i "s|$beta_version|$version|g" beta.json
|
|
|
|
sed -i "s|$stable_version|$version|g" stable.json
|
|
|
|
fi
|
|
|
|
|
|
|
|
git commit -am "Bump Home Assistant $version"
|
|
|
|
git push
|