From a0cba05830788407638be9d9fc3e0d5ac36c576e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 27 Jun 2019 18:04:20 +0200 Subject: [PATCH] Update and rename azure-pipelines.yml to azure-pipelines-ci.yml --- azure-pipelines-ci.yml | 49 +++++++++++++++++ azure-pipelines.yml | 119 ----------------------------------------- 2 files changed, 49 insertions(+), 119 deletions(-) create mode 100644 azure-pipelines-ci.yml delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml new file mode 100644 index 000000000..85f06f938 --- /dev/null +++ b/azure-pipelines-ci.yml @@ -0,0 +1,49 @@ +# https://dev.azure.com/home-assistant + +trigger: + batch: true + branches: + include: + - dev +pr: +- dev + +variables: + - name: versionHadolint + value: 'v1.16.3' + - name: versionShellCheck + value: 'v0.6.0' + +jobs: + +- job: 'Hadolint' + pool: + vmImage: 'ubuntu-16.04' + 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: 'ShellCheck' + pool: + vmImage: 'ubuntu-16.04' + steps: + - script: | + sudo docker pull koalaman/shellcheck:$(versionShellCheck) + displayName: 'Install ShellCheck' + - script: | + sudo docker run --rm -i \ + -v $(pwd):/mnt:ro koalaman/shellcheck:$(versionShellCheck) \ + scripts/*.sh \ + buildroot-external/scripts/*.sh \ + buildroot-external/board/**/*.sh \ + buildroot-external/rootfs-overlay/usr/sbin/* \ + buildroot-external/rootfs-overlay/usr/libexec/* \ + buildroot-external/rootfs-overlay/usr/lib/rauc/* + displayName: 'Run ShellCheck' diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index f3d66d569..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,119 +0,0 @@ -# https://dev.azure.com/home-assistant - -trigger: - batch: true - branches: - include: - - dev - tags: - include: - - '*' - exclude: - - untagged* -pr: -- dev - -variables: - - name: versionHadolint - value: 'v1.16.3' - - name: versionShellCheck - value: 'v0.6.0' - - name: versionGHR - value: 'v0.12.1' - - group: github - - group: hassos - -jobs: - -- job: 'Hadolint' - pool: - vmImage: 'ubuntu-16.04' - 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: 'ShellCheck' - pool: - vmImage: 'ubuntu-16.04' - steps: - - script: | - sudo docker pull koalaman/shellcheck:$(versionShellCheck) - displayName: 'Install ShellCheck' - - script: | - sudo docker run --rm -i \ - -v $(pwd):/mnt:ro koalaman/shellcheck:$(versionShellCheck) \ - scripts/*.sh \ - buildroot-external/scripts/*.sh \ - buildroot-external/board/**/*.sh \ - buildroot-external/rootfs-overlay/usr/sbin/* \ - buildroot-external/rootfs-overlay/usr/libexec/* \ - buildroot-external/rootfs-overlay/usr/lib/rauc/* - displayName: 'Run ShellCheck' - - -- job: 'Release' - condition: and(startsWith(variables['Build.SourceBranch'], 'refs/tags'), succeeded('ShellCheck')) - timeoutInMinutes: 240 - dependsOn: - - 'ShellCheck' - pool: - name: 'Buildroot' - strategy: - maxParallel: 1 - matrix: - OpenVirtualAppliance: - board: 'ova' - IntelNuc: - board: 'intel_nuc' - OdroidC2: - board: 'odroid_c2' - OdroidXU4: - board: 'odroid_xu4' - OrangePiPrime: - board: 'opi_prime' - RaspberryPi0-W: - board: 'rpi0_w' - RaspberryPi3: - board: 'rpi3' - RaspberryPi3-64: - board: 'rpi3_64' - RaspberryPi2: - board: 'rpi2' - RaspberryPi: - board: 'rpi' - AsusTinker: - board: 'tinker' - workspace: - clean: 'all' - steps: - - script: | - echo -e "-----BEGIN CERTIFICATE-----\n$(releaseCertificate)\n-----END CERTIFICATE-----" > cert.pem - echo -e "-----BEGIN PRIVATE KEY-----\n$(releaseKey)\n-----END PRIVATE KEY-----" > key.pem - displayName: 'Add release PKI certs' - - script: | - sudo docker build -t hassos:azure . - displayName: 'Build container for HassOS' - - script: | - curl -SsL https://github.com/tcnksm/ghr/releases/download/$(versionGHR)/ghr_$(versionGHR)_linux_amd64.tar.gz | tar xzf - - cp ghr_$(versionGHR)_linux_amd64/ghr . - rm -rf ghr_$(versionGHR)_linux_amd64 - displayName: 'Install GHR' - - script: | - BUILDER_UID="$(id -u)" - BUILDER_GID="$(id -g)" - - sudo docker run --rm --privileged -v "$(pwd):/build" \ - -e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \ - -v "/mnt/build-cache:/cache" \ - hassos:azure make $(board) - displayName: 'Build $(board)' - - script: | - ./ghr -t $(githubToken) $(Build.SourceBranchName) release/ - displayName: 'Upload $(board)'