Coder Social home page Coder Social logo

cytopia / docker-yamllint Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 8.0 88 KB

Alpine-based multistage-build of yamllint for reproducible usage in CI

License: MIT License

Makefile 100.00%
alpine docker dockerfile docker-image docker-container yamllint yaml ci continuous-integration lint

docker-yamllint's Introduction

Docker image for yamllint

Tag License

lint build nightly

All #awesome-ci Docker images

ansible-lint ansible awesome-ci bandit black checkmake eslint file-lint gofmt goimports golint jsonlint kubeval linkcheck mypy php-cs-fixer phpcbf phpcs phplint pycodestyle pydocstyle pylint terraform-docs terragrunt-fmt terragrunt yamlfmt yamllint

View Dockerfiles on GitHub.

Available Architectures: amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x

Tiny Alpine-based dockerized version of yamllint[1]. The image is built nightly against the latest stable version of yamllint and pushed to Dockerhub.

[1] Official project: https://github.com/adrienverge/yamllint

🐳 Available Docker image versions

Docker

Rolling releaess

The following Docker image tags are rolling releases and are built and updated every night.

nightly

Docker Tag Git Ref Yamllint Flavour Available Architectures
latest master latest default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine master latest Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
1 master 1.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-1 master 1.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x

Point in time releases

The following Docker image tags are built once and can be used for reproducible builds. Its version never changes so you will have to update tags in your pipelines from time to time in order to stay up-to-date.

build

Docker Tag Git Ref Yamllint Flavour Available Architectures
latest-0.10 tag: <tag> latest default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-latest-0.10 tag: <tag> latest Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
1-0.10 tag: <tag> 1.x.x default amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x
alpine-1-0.10 tag: <tag> 1.x.x Alpine amd64, i386, arm64, arm/v7, arm/v6, ppc64le, s390x

Where <tag> refers to the chosen git tag from this repository.

📂 Docker mounts

The working directory inside the Docker container is /data/ and should be mounted locally to the root of your project where your .yamllint file is located.

💻 Usage

Command line

docker run --rm -it -v $(pwd):/data cytopia/yamllint .

Makefile

ifneq (,)
.error This Makefile requires GNU Make.
endif

lint: lint-yaml

lint-yaml:
	@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/yamllint:latest .

GitLab CI

stages:
 - lint

lint-yaml:
  stage: lint
  image:
    name: cytopia/yamllint
    entrypoint: ["/bin/ash", "-c"]
  script:
    - yamllint -f colored .

🔄 Related #awesome-ci projects

Docker images

Save yourself from installing lot's of dependencies and pick a dockerized version of your favourite linter below for reproducible local or remote CI tests:

GitHub DockerHub Type Description
awesome-ci aci-hub-img Basic Tools for git, file and static source code analysis
file-lint flint-hub-img Basic Baisc source code analysis
linkcheck linkcheck-hub-img Basic Search for URLs in files and validate their HTTP status code
ansible ansible-hub-img Ansible Multiple versions and flavours of Ansible
ansible-lint alint-hub-img Ansible Lint Ansible
gofmt gfmt-hub-img Go Format Go source code [1]
goimports gimp-hub-img Go Format Go source code [1]
golint glint-hub-img Go Lint Go code
eslint elint-hub-img Javascript Lint Javascript code
jsonlint jlint-hub-img JSON Lint JSON files [1]
kubeval kubeval-hub-img K8s Lint Kubernetes files
checkmake cm-hub-img Make Lint Makefiles
phpcbf pcbf-hub-img PHP PHP Code Beautifier and Fixer
phpcs pcs-hub-img PHP PHP Code Sniffer
phplint plint-hub-img PHP PHP Code Linter [1]
php-cs-fixer pcsf-hub-img PHP PHP Coding Standards Fixer
bandit bandit-hub-img Python A security linter from PyCQA
black black-hub-img Python The uncompromising Python code formatter
mypy mypy-hub-img Python Static source code analysis
pycodestyle pycs-hub-img Python Python style guide checker
pydocstyle pyds-hub-img Python Python docstyle checker
pylint pylint-hub-img Python Python source code, bug and quality checker
terraform-docs tfdocs-hub-img Terraform Terraform doc generator (TF 0.12 ready) [1]
terragrunt tg-hub-img Terraform Terragrunt and Terraform
terragrunt-fmt tgfmt-hub-img Terraform terraform fmt for Terragrunt files [1]
yamlfmt yfmt-hub-img Yaml Format Yaml files [1]
yamllint ylint-hub-img Yaml Lint Yaml files

[1] Uses a shell wrapper to add enhanced functionality not available by original project.

Makefiles

Visit cytopia/makefiles for dependency-less, seamless project integration and minimum required best-practice code linting for CI. The provided Makefiles will only require GNU Make and Docker itself removing the need to install anything else.

📄 License

MIT License

Copyright (c) 2019 cytopia

docker-yamllint's People

Contributors

cytopia avatar dependabot[bot] avatar jeffwidman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-yamllint's Issues

Missing images for yamllint after v1.26

Hello, I couldn't find the images for yamllint after version 1.26. The latest tagged image does have the latest version of the yamllint though (i.e. 1.32.0), but would be great to have the images that are tagged with the version of the tool.

Nightly build has stopped running

cytopia/yamllint:latest is currently about 3 months old and contains yamllint 1.26.3. The latest yamllint right now is 1.27.1, released a couple of weeks ago.

It seems the image hasn't been updated because Github has automatically disabled the nightly build due to no activity on this repo.

Docker image for yamllint 1.26

Hi there,

First thanks for your work, packaging yamllint is very helpfull to me and my team.
Have planned to release a new version of the image to include yamllint 1.26 which include nice feature ? Let me know if we can provide some any help.

FileNotFoundError: [Errno 2] No such file or directory: 'if [ -x /usr/local/bin/bash ];

Hi all

I try to run this on my gitlab repo.

.gitlab-ci.yml:

stages:
 - lint
 
lint-yaml:
  stage: lint
  image: cytopia/yamllint
  script:
    - .

Screenshot 2020-05-19 at 13 19 39

�[0K�[0K�[36;1mRunning before_script and script�[0;m
�[0;mTraceback (most recent call last):
  File "/usr/bin/yamllint", line 10, in <module>
    sys.exit(run())
  File "/usr/lib/python3.8/site-packages/yamllint/cli.py", line 160, in run
    conf = YamlLintConfig(file=args.config_file)
  File "/usr/lib/python3.8/site-packages/yamllint/config.py", line 39, in __init__
    with open(file) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash \nelif [ -x /usr/bin/bash ]; then\n\texec /usr/bin/bash \nelif [ -x /bin/bash ]; then\n\texec /bin/bash \nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh \nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh \nelif [ -x /bin/sh ]; then\n\texec /bin/sh \nelif [ -x /busybox/sh ]; then\n\texec /busybox/sh \nelse\n\techo shell not found\n\texit 1\nfi\n\n'
section_end:1589886959:build_script
�[0Ksection_start:1589886959:after_script
�[0K�[0K�[36;1mRunning after_script�[0;m
�[0;mTraceback (most recent call last):
  File "/usr/bin/yamllint", line 10, in <module>
    sys.exit(run())
  File "/usr/lib/python3.8/site-packages/yamllint/cli.py", line 160, in run
    conf = YamlLintConfig(file=args.config_file)
  File "/usr/lib/python3.8/site-packages/yamllint/config.py", line 39, in __init__
    with open(file) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash \nelif [ -x /usr/bin/bash ]; then\n\texec /usr/bin/bash \nelif [ -x /bin/bash ]; then\n\texec /bin/bash \nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh \nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh \nelif [ -x /bin/sh ]; then\n\texec /bin/sh \nelif [ -x /busybox/sh ]; then\n\texec /busybox/sh \nelse\n\techo shell not found\n\texit 1\nfi\n\n'
section_end:1589886960:after_script
�[0Ksection_start:1589886960:upload_artifacts_on_failure
�[0K�[0K�[36;1mUploading artifacts for failed job�[0;m
�[0;msection_end:1589886962:upload_artifacts_on_failure
�[0K�[31;1mERROR: Job failed: exit code 1
�[0;m

Is that possible to tag your yamllint with given release version?

Thanks a lot for preparing this yamllint docker for community to use.

Just one feature request is that possible to add version tags to the releases? In this case, the new version 1.18.0 just released, but people were still use 1.17.0, and surprise to see a new release and changed behavior.

So far, I can only see latest and latest-0.2 etc.

Really appreciate your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.