mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-03 18:41:31 +00:00
71 lines
1.4 KiB
YAML
71 lines
1.4 KiB
YAML
---
|
|
image: docker:latest
|
|
|
|
variables:
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
stages:
|
|
- preflight
|
|
|
|
# Generic preflight template
|
|
.preflight: &preflight
|
|
stage: preflight
|
|
tags:
|
|
- preflight
|
|
|
|
# Preflight jobs
|
|
shellcheck:
|
|
<<: *preflight
|
|
image: pipelinecomponents/shellcheck:latest
|
|
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" "lib"); do
|
|
if ! shellcheck --external-sources $file; then
|
|
export FAILED=1
|
|
else
|
|
echo "$file OK"
|
|
fi
|
|
done
|
|
if [ "${FAILED}" = "1" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
yamllint:
|
|
<<: *preflight
|
|
image: pipelinecomponents/yamllint:latest
|
|
before_script:
|
|
- yamllint --version
|
|
script:
|
|
- yamllint .
|
|
|
|
jsonlint:
|
|
<<: *preflight
|
|
image: pipelinecomponents/jsonlint:latest
|
|
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: pipelinecomponents/markdownlint:latest
|
|
before_script:
|
|
- mdl --version
|
|
script:
|
|
- mdl --style all --warnings .
|