mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-16 20:39:12 +02:00
switch to matrix for better maintainability (#47)
This commit is contained in:
18
.azure-pipelines/addon-job.yml
Normal file
18
.azure-pipelines/addon-job.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
parameters:
|
||||||
|
jobName:
|
||||||
|
addon:
|
||||||
|
arch: '--armhf --amd64 --aarch64'
|
||||||
|
poolVmImage: 'ubuntu-16.04'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: ${{ parameters.jobName }}
|
||||||
|
displayName: ${{ parameters.addon }}
|
||||||
|
pool:
|
||||||
|
vmImage: ${{ parameters.poolVmImage }}
|
||||||
|
steps:
|
||||||
|
- template: addon-template.yml
|
||||||
|
parameters:
|
||||||
|
addon: ${{ parameters.addon }}
|
||||||
|
arch: ${{ parameters.arch }}
|
||||||
|
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
||||||
|
additionalArgs: --test
|
||||||
7
.azure-pipelines/job-matrix.yml
Normal file
7
.azure-pipelines/job-matrix.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
jobs:
|
||||||
|
- ${{ each entry in parameters.matrix }}:
|
||||||
|
- template: addon-job.yml
|
||||||
|
parameters:
|
||||||
|
addon: ${{ entry.addon }}
|
||||||
|
arch: ${{ entry.arch }}
|
||||||
|
name: ${{ entry.jobName }}
|
||||||
@@ -7,198 +7,73 @@ variables:
|
|||||||
versionHadolint: 'v1.16.3'
|
versionHadolint: 'v1.16.3'
|
||||||
versionBuilder: 'latest'
|
versionBuilder: 'latest'
|
||||||
|
|
||||||
jobs:
|
stages:
|
||||||
|
- stage: lint
|
||||||
|
jobs:
|
||||||
|
- job: 'Hadolint'
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-16.04'
|
||||||
|
steps:
|
||||||
|
- script: sudo docker pull hadolint/hadolint:$(versionHadolint)
|
||||||
|
displayName: 'Install Hadolint'
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
shopt -s globstar
|
||||||
|
for dockerfile in **/Dockerfile
|
||||||
|
do
|
||||||
|
echo "Linting: $dockerfile"
|
||||||
|
sudo docker run --rm -i \
|
||||||
|
-v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \
|
||||||
|
hadolint/hadolint:$(versionHadolint) < "$dockerfile"
|
||||||
|
done
|
||||||
|
displayName: 'Run Hadolint'
|
||||||
|
|
||||||
- job: 'Hadolint'
|
- job: 'JQ'
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-16.04'
|
vmImage: 'ubuntu-16.04'
|
||||||
steps:
|
steps:
|
||||||
- script: sudo docker pull hadolint/hadolint:$(versionHadolint)
|
- script: sudo apt-get install -y jq
|
||||||
displayName: 'Install Hadolint'
|
displayName: 'Install JQ'
|
||||||
- script: |
|
- bash: |
|
||||||
set -e
|
shopt -s globstar
|
||||||
shopt -s globstar
|
cat **/*.json | jq '.'
|
||||||
for dockerfile in **/Dockerfile
|
displayName: 'Run JQ'
|
||||||
do
|
- stage: build
|
||||||
echo "Linting: $dockerfile"
|
dependsOn: lint
|
||||||
sudo docker run --rm -i \
|
jobs:
|
||||||
-v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \
|
- template: .azure-pipelines/job-matrix.yml
|
||||||
hadolint/hadolint:$(versionHadolint) < "$dockerfile"
|
parameters:
|
||||||
done
|
matrix:
|
||||||
displayName: 'Run Hadolint'
|
- addon: znc
|
||||||
|
jobName: znc
|
||||||
- job: 'JQ'
|
arch: '--armhf --amd64 --aarch64'
|
||||||
pool:
|
- addon: hydra2
|
||||||
vmImage: 'ubuntu-16.04'
|
jobName: hydra2
|
||||||
steps:
|
arch: '--armhf --amd64 --aarch64'
|
||||||
- script: sudo apt-get install -y jq
|
- addon: nzbget
|
||||||
displayName: 'Install JQ'
|
jobName: nzbget
|
||||||
- bash: |
|
arch: '--armhf --amd64 --aarch64'
|
||||||
shopt -s globstar
|
- addon: sonarr
|
||||||
cat **/*.json | jq '.'
|
jobName: sonarr
|
||||||
displayName: 'Run JQ'
|
arch: '--armhf --amd64 --aarch64'
|
||||||
|
- addon: radarr
|
||||||
- job: 'znc'
|
jobName: radarr
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
arch: '--armhf --amd64 --aarch64'
|
||||||
dependsOn:
|
- addon: emby
|
||||||
- 'Hadolint'
|
jobName: emby
|
||||||
- 'JQ'
|
arch: '--armhf --amd64 --aarch64'
|
||||||
pool:
|
- addon: jellyfin
|
||||||
vmImage: 'ubuntu-16.04'
|
jobName: jellyfin
|
||||||
steps:
|
arch: '--armhf --amd64 --aarch64'
|
||||||
- template: .azure-pipelines/addon-template.yml
|
- addon: jackett
|
||||||
parameters:
|
jobName: jackett
|
||||||
addon: 'znc'
|
arch: '--armhf --amd64 --aarch64'
|
||||||
arch: '--armhf --amd64 --aarch64'
|
- addon: transmission-openvpn
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
jobName: transmission_openvpn
|
||||||
additionalArgs: --test
|
arch: '--amd64'
|
||||||
|
- addon: transmission-magnet-redirect
|
||||||
- job: 'hydra2'
|
jobName: transmission_magnet_redirect
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
arch: '--amd64'
|
||||||
dependsOn:
|
- addon: hyperion
|
||||||
- 'Hadolint'
|
jobName: hyperion
|
||||||
- 'JQ'
|
arch: '--armhf --amd64 --aarch64'
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'hydra2'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'nzbget'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'nzbget'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'sonarr'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'sonarr'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'radarr'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'radarr'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'emby'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'emby'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'jellyfin'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'jellyfin'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'transmission_openvpn'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'transmission-openvpn'
|
|
||||||
arch: '--amd64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'jackett'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'jackett'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'transmission_magnet_redirect'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'transmission-magnet-redirect'
|
|
||||||
arch: '--amd64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
|
|
||||||
- job: 'hyperion'
|
|
||||||
condition: and(succeeded('Hadolint'), succeeded('JQ'))
|
|
||||||
dependsOn:
|
|
||||||
- 'Hadolint'
|
|
||||||
- 'JQ'
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- template: .azure-pipelines/addon-template.yml
|
|
||||||
parameters:
|
|
||||||
addon: 'hyperion'
|
|
||||||
arch: '--armhf --amd64 --aarch64'
|
|
||||||
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
|
|
||||||
additionalArgs: --test
|
|
||||||
Reference in New Issue
Block a user