forked from home-assistant/wheels-custom-integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-ci.yml
42 lines (37 loc) · 1.2 KB
/
azure-pipelines-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# https://dev.azure.com/home-assistant
trigger:
batch: true
branches:
include:
- master
pr:
- master
jobs:
- job: 'JQ'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: sudo apt-get install -y jq
displayName: 'Install JQ'
- bash: |
shopt -s globstar
cat components/* | jq '.'
displayName: 'Run JQ to validate JSON files'
- bash: |
for component in components/*; do
manifestlink=$(jq --raw-output ".manifest" "${component}")
echo "Process: ${component} -> ${manifestlink}"
manifest=$(curl -s "${manifestlink}" | jq -e --raw-output .)
if [[ "$?" != 0 ]]; then
echo "Unable to read the manifest file at ${manifestlink}"
echo "The URL might be wrong or is not a raw URL."
exit 1
fi
echo "${manifest}" | jq -e --raw-output '.requirements[0]'
if [[ "$?" != 0 ]]; then
echo "The integration in $component, does not seem to have any Python requirements."
echo "Adding it to this repository has no use, since there are nothing to build for it."
exit 1
fi
done
displayName: 'Check if integration have requirements'