Skip to content

Commit

Permalink
Support python 3.7 / 3.8 - Alpine 3.9 / 3.10 / 3.11 (#55)
Browse files Browse the repository at this point in the history
* Update files

* Expand tags
  • Loading branch information
pvizeli authored Jan 8, 2020
1 parent da3eb54 commit b9255fb
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 96 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"context": "..",
"dockerFile": "Dockerfile",
"extensions": [
"ms-python.python"
"ms-python.python",
"esbenp.prettier-vscode"
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
Expand Down
58 changes: 28 additions & 30 deletions azure-pipelines-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,36 @@ trigger:
batch: true
branches:
include:
- master
- dev
- master
- dev
pr:
- dev
- dev
variables:
- name: versionHadolint
value: 'v1.16.3'
- name: versionHadolint
value: "v1.16.3"

jobs:
- job: "Tox"
pool:
vmImage: "ubuntu-latest"
steps:
- task: UsePythonVersion@0
displayName: "Use Python $(python.version)"
inputs:
versionSpec: "3.7"
- script: pip install tox
displayName: "Install Tox"
- script: tox
displayName: "Run Tox"

- job: 'Tox'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '3.7'
- script: pip install tox
displayName: 'Install Tox'
- script: tox
displayName: 'Run Tox'


- job: 'Hadolint'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: sudo docker pull hadolint/hadolint:$(versionHadolint)
displayName: 'Install Hadolint'
- script: |
sudo docker run --rm -i \
-v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \
hadolint/hadolint:$(versionHadolint) < Dockerfile
displayName: 'Run Hadolint'
- job: "Hadolint"
pool:
vmImage: "ubuntu-latest"
steps:
- script: sudo docker pull hadolint/hadolint:$(versionHadolint)
displayName: "Install Hadolint"
- script: |
sudo docker run --rm -i \
-v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \
hadolint/hadolint:$(versionHadolint) < Dockerfile
displayName: "Run Hadolint"
179 changes: 114 additions & 65 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,125 @@
trigger:
tags:
include:
- '*'
- "*"
pr: none
variables:
- name: versionBuilder
value: '4.4'
- group: docker
- name: versionBuilder
value: "4.4"
- group: docker
resources:
repositories:
- repository: azure
type: github
name: 'home-assistant/ci-azure'
endpoint: 'home-assistant'

- repository: azure
type: github
name: "home-assistant/ci-azure"
endpoint: "home-assistant"

stages:
- stage: "Validate"
jobs:
- template: templates/azp-job-version.yaml@azure
parameters:
ignoreDev: true

- stage: 'Validate'
jobs:
- template: templates/azp-job-version.yaml@azure
parameters:
ignoreDev: true

- stage: 'Wheels'
jobs:
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: 'Wheels_Alpine39'
builderVersion: 'dev-3.7-alpine3.9'
builderApk: 'build-base;libffi-dev;openssl-dev'
wheelsRequirement: 'requirements_all.txt'
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: 'Prepare requirements'
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: 'Wheels_Alpine310'
builderVersion: 'dev-3.7-alpine3.10'
builderApk: 'build-base;libffi-dev;openssl-dev'
wheelsRequirement: 'requirements_all.txt'
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: 'Prepare requirements'
- stage: "Wheels"
jobs:
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: "Wheels_37_Alpine39"
builderVersion: "dev-3.7-alpine3.9"
builderApk: "build-base;libffi-dev;openssl-dev"
wheelsRequirement: "requirements_all.txt"
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: "Prepare requirements"
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: "Wheels_37_Alpine310"
builderVersion: "dev-3.7-alpine3.10"
builderApk: "build-base;libffi-dev;openssl-dev"
wheelsRequirement: "requirements_all.txt"
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: "Prepare requirements"
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: "Wheels_37_Alpine311"
builderVersion: "dev-3.7-alpine3.11"
builderApk: "build-base;libffi-dev;openssl-dev"
wheelsRequirement: "requirements_all.txt"
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: "Prepare requirements"
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: "Wheels_38_Alpine39"
builderVersion: "dev-3.8-alpine3.9"
builderApk: "build-base;libffi-dev;openssl-dev"
wheelsRequirement: "requirements_all.txt"
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: "Prepare requirements"
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: "Wheels_38_Alpine310"
builderVersion: "dev-3.8-alpine3.10"
builderApk: "build-base;libffi-dev;openssl-dev"
wheelsRequirement: "requirements_all.txt"
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: "Prepare requirements"
- template: templates/azp-job-wheels.yaml@azure
parameters:
jobName: "Wheels_38_Alpine311"
builderVersion: "dev-3.8-alpine3.11"
builderApk: "build-base;libffi-dev;openssl-dev"
wheelsRequirement: "requirements_all.txt"
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: "Prepare requirements"
- stage: 'Release'
jobs:
- job: 'Release'
pool:
vmImage: 'ubuntu-latest'
strategy:
maxParallel: 2
matrix:
37-Alpine39:
buildPython: '3.7-alpine3.9'
buildArgs: ''
37-Alpine310:
buildPython: '3.7-alpine3.10'
buildArgs: '--release-tag'
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: |
sudo docker run --rm --privileged \
-v ~/.docker:/root/.docker \
-v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \
homeassistant/amd64-builder:$(versionBuilder) \
--builder-wheels $(buildPython) --all \
$(buildArgs) --version $(Build.SourceBranchName) \
-t /data --docker-hub homeassistant
displayName: 'Build Release'
- stage: "Release"
jobs:
- job: "Release"
pool:
vmImage: "ubuntu-latest"
strategy:
matrix:
37-Alpine39:
buildPython: "3.7-alpine3.9"
buildArgs: ""
37-Alpine310:
buildPython: "3.7-alpine3.10"
buildArgs: ""
37-Alpine311:
buildPython: "3.7-alpine3.11"
buildArgs: ""
38-Alpine39:
buildPython: "3.8-alpine3.9"
buildArgs: ""
38-Alpine310:
buildPython: "3.8-alpine3.10"
buildArgs: ""
38-Alpine311:
buildPython: "3.8-alpine3.11"
buildArgs: "--release-tag"
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: |
sudo docker run --rm --privileged \
-v ~/.docker:/root/.docker \
-v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \
homeassistant/amd64-builder:$(versionBuilder) \
--builder-wheels $(buildPython) --all \
$(buildArgs) --version $(Build.SourceBranchName) \
-t /data --docker-hub homeassistant
displayName: "Build Release"
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ click==7.0
click-pathlib==2019.12.28.7
requests==2.22.0
wheel==0.33.6
setuptools==44.0.0

0 comments on commit b9255fb

Please sign in to comment.