1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-06 15:36:40 +00:00

Add linting for yaml files (#186)

* rename check-scripts target to lint
* install yamllint through pip on travis
* add yamllint config, do not fail on too long lines
* fix yaml linting errors
* remove circular dependency
This commit is contained in:
Felix Bartels 2019-06-19 18:08:36 +02:00 committed by GitHub
parent e4983a96a2
commit 4d2cffbe09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 92 additions and 85 deletions

View File

@ -19,10 +19,11 @@ before_install:
- sudo chmod +rx /usr/local/bin/hadolint
- sudo chmod +rx /usr/local/bin/docker-compose
- sudo apt update && sudo apt install -y expect
- sudo pip install --upgrade pip && sudo pip install yamllint
install:
- make check-scripts
- make lint
- "./test.exp"
- make check-scripts # rerun check-scripts to see if output is different with .env in place
- make lint # rerun lint to see if output is different with .env in place
- travis_retry make build-all
script:
- make test-ci

7
.yamllint Normal file
View File

@ -0,0 +1,7 @@
extends: default
rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 80
level: warning

View File

@ -321,10 +321,11 @@ publish-webapp: tag-webapp
publish-zpush: tag-zpush
component=zpush make publish-container
check-scripts:
lint:
grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \
--exclude-dir=.git --exclude=*.sw? \
| xargs shellcheck -x
git ls-files --exclude='*.yml' --ignored | xargs --max-lines=1 yamllint
# List files which name starts with 'Dockerfile'
# eg. Dockerfile, Dockerfile.build, etc.
git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 hadolint

View File

@ -313,7 +313,6 @@ services:
container_name: ${COMPOSE_PROJECT_NAME}_kdav
depends_on:
- kopano_server
container_name: ${COMPOSE_PROJECT_NAME}_kdav
volumes:
- kopanossl/:/kopano/ssl
- kopanosocket/:/run/kopano
@ -437,13 +436,12 @@ services:
image: ${docker_repo:-zokradonh}/kopano_konnect:${KONNECT_VERSION:-latest}
command: wrapper.sh
depends_on:
- kopano_server
- kopano_ssl
- web
# to be useful Konnect also need a running kopano_server, but this dependency cannot be added here since this would be a circular dependency
volumes:
- kopanossl/:/kopano/ssl
- kopanosocket/:/run/kopano
depends_on:
- kopano_ssl
- web
environment:
- FQDN=${FQDN}
- allow_client_guests=yes