Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- image: docker:latest
- stages:
- - preflight
- - test
- # Generic preflight template
- .preflight: &preflight
- stage: preflight
- # Generic test template
- .dev: &test
- stage: test
- variables:
- PYTHONPATH: "/usr/src/app:$PYTHONPATH"
- before_script:
- - python -m homeassistant --version
- - pip3 install colorlog
- - cp secrets_redacted.yaml secrets.yaml
- - mkdir fake_directory/
- - touch fake_directory/data.log
- - touch fake_directory/cert.log
- - touch fake_directory/cert_eu.log
- - echo "10" > fake_directory/cert.log
- - echo "10" > fake_directory/cert_eu.log
- # - touch ./home-assistant_v2.db
- # - touch ./home-assistant.log
- # - touch ./OZW_Log.txt
- script:
- - |
- python -m homeassistant \
- --script check_config -c . #\
- # --info all
- # Preflight jobs
- shellcheck:
- <<: *preflight
- image:
- name: koalaman/shellcheck-alpine:stable
- entrypoint: [""]
- before_script:
- - shellcheck --version
- - apk --no-cache add grep
- - |
- find . -type f -print0 | \
- xargs -0 sed -i 's:#!/usr/bin/with-contenv bash:#!/bin/bash:g'
- script:
- - |
- for file in $(grep -IRl "#\!\(/usr/bin/env \|/bin/\)" --exclude-dir ".git" "${ADDON_TARGET}"); do
- if ! shellcheck $file; then
- export FAILED=1
- else
- echo "$file OK"
- fi
- done
- if [ "${FAILED}" = "1" ]; then
- exit 1
- fi
- yamllint:
- <<: *preflight
- image: sdesbure/yamllint
- allow_failure: true
- before_script:
- - yamllint --version
- script:
- - yamllint .
- jsonlint:
- <<: *preflight
- image: sahsu/docker-jsonlint
- allow_failure: true
- before_script:
- - jsonlint --version || true
- script:
- - |
- for file in $(find . -type f -name "*.json"); do
- if ! jsonlint -q $file; then
- export FAILED=1
- else
- echo "$file OK"
- fi
- done
- if [ "${FAILED}" = "1" ]; then
- exit 1
- fi
- markdownlint:
- <<: *preflight
- image:
- name: ruby:alpine
- entrypoint: [""]
- allow_failure: true
- before_script:
- - gem install mdl
- - mdl --version
- script:
- - mdl --style all --warnings .
- # Test jobs
- latest:
- <<: *test
- image:
- name: homeassistant/home-assistant:latest
- entrypoint: [""]
- rc:
- <<: *test
- image:
- name: homeassistant/home-assistant:rc
- entrypoint: [""]
- allow_failure: true
- dev:
- <<: *test
- image:
- name: homeassistant/home-assistant:dev
- entrypoint: [""]
- allow_failure: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement