mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-30 18:07:46 +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:
		
							parent
							
								
									e4983a96a2
								
							
						
					
					
						commit
						4d2cffbe09
					
				| @ -19,10 +19,11 @@ before_install: | |||||||
|   - sudo chmod +rx /usr/local/bin/hadolint |   - sudo chmod +rx /usr/local/bin/hadolint | ||||||
|   - sudo chmod +rx /usr/local/bin/docker-compose |   - sudo chmod +rx /usr/local/bin/docker-compose | ||||||
|   - sudo apt update && sudo apt install -y expect |   - sudo apt update && sudo apt install -y expect | ||||||
|  |   - sudo pip install --upgrade pip && sudo pip install yamllint | ||||||
| install: | install: | ||||||
|   - make check-scripts |   - make lint | ||||||
|   - "./test.exp" |   - "./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 |   - travis_retry make build-all | ||||||
| script: | script: | ||||||
|   - make test-ci |   - make test-ci | ||||||
|  | |||||||
							
								
								
									
										7
									
								
								.yamllint
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								.yamllint
									
									
									
									
									
										Normal 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 | ||||||
							
								
								
									
										3
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
									
									
									
									
								
							| @ -321,10 +321,11 @@ publish-webapp: tag-webapp | |||||||
| publish-zpush: tag-zpush | publish-zpush: tag-zpush | ||||||
| 	component=zpush make publish-container | 	component=zpush make publish-container | ||||||
| 
 | 
 | ||||||
| check-scripts: | lint: | ||||||
| 	grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \
 | 	grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \
 | ||||||
| 	--exclude-dir=.git --exclude=*.sw? \
 | 	--exclude-dir=.git --exclude=*.sw? \
 | ||||||
| 	| xargs shellcheck -x | 	| xargs shellcheck -x | ||||||
|  | 	git ls-files --exclude='*.yml' --ignored | xargs --max-lines=1 yamllint | ||||||
| 	# List files which name starts with 'Dockerfile' | 	# List files which name starts with 'Dockerfile' | ||||||
| 	# eg. Dockerfile, Dockerfile.build, etc. | 	# eg. Dockerfile, Dockerfile.build, etc. | ||||||
| 	git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 hadolint | 	git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 hadolint | ||||||
|  | |||||||
| @ -313,7 +313,6 @@ services: | |||||||
|     container_name: ${COMPOSE_PROJECT_NAME}_kdav |     container_name: ${COMPOSE_PROJECT_NAME}_kdav | ||||||
|     depends_on: |     depends_on: | ||||||
|       - kopano_server |       - kopano_server | ||||||
|     container_name: ${COMPOSE_PROJECT_NAME}_kdav |  | ||||||
|     volumes: |     volumes: | ||||||
|       - kopanossl/:/kopano/ssl |       - kopanossl/:/kopano/ssl | ||||||
|       - kopanosocket/:/run/kopano |       - kopanosocket/:/run/kopano | ||||||
| @ -437,13 +436,12 @@ services: | |||||||
|     image: ${docker_repo:-zokradonh}/kopano_konnect:${KONNECT_VERSION:-latest} |     image: ${docker_repo:-zokradonh}/kopano_konnect:${KONNECT_VERSION:-latest} | ||||||
|     command: wrapper.sh |     command: wrapper.sh | ||||||
|     depends_on: |     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: |     volumes: | ||||||
|       - kopanossl/:/kopano/ssl |       - kopanossl/:/kopano/ssl | ||||||
|       - kopanosocket/:/run/kopano |       - kopanosocket/:/run/kopano | ||||||
|     depends_on: |  | ||||||
|      - kopano_ssl |  | ||||||
|      - web |  | ||||||
|     environment: |     environment: | ||||||
|       - FQDN=${FQDN} |       - FQDN=${FQDN} | ||||||
|       - allow_client_guests=yes |       - allow_client_guests=yes | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user