https://github.com/petermosmans/jenkinslint
Basic linter (validator) for Jenkinsfiles. Can easily be used in pre-commit hooks and the pre-commit framework
https://github.com/petermosmans/jenkinslint
jenkins jenkinsfile linter pre-commit pre-commit-hook validator
Last synced: about 1 year ago
JSON representation
Basic linter (validator) for Jenkinsfiles. Can easily be used in pre-commit hooks and the pre-commit framework
- Host: GitHub
- URL: https://github.com/petermosmans/jenkinslint
- Owner: PeterMosmans
- License: gpl-3.0
- Created: 2020-07-10T08:03:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-13T19:43:09.000Z (almost 4 years ago)
- Last Synced: 2025-03-24T18:21:30.785Z (about 1 year ago)
- Topics: jenkins, jenkinsfile, linter, pre-commit, pre-commit-hook, validator
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 16
- Watchers: 1
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
###########
jenkinslint
###########
A basic Jenkinsfile linter (validator). Can validate files using a Jenkins web
interface, or the Jenkins SSH interface.
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit
Usage
=====
To configure which type of validation to use (web or SSH), create an INI file
named ``.jenkinslintrc`` in the root of your repository.
The following parameters are supported:
JENKINS_SERVER
Server name
JENKINS_SSH_PORT
When set, use SSH validation
JENKINS_UNSAFE_SSL
When set to TRUE, disable SSL/TLS certificate validation
JENKINS_URL
Full Jenkins URL for web-based validation
Not all parameters need to be set. Example:
::
JENKINS_SERVER=jenkins.demo.local
JENKINS_SSH_PORT=8022
Standalone
----------
Validate files using ``jenkinslint`` followed by the name of the Jenkinsfile,
e.g.
::
jenkinslint Jenkinsfile
Using the pre-commit framework
------------------------------
Install the pre-commit framework, and add the following to the
``.pre-commit-config.yaml`` file:
::
- repo: https://github.com/PeterMosmans/jenkinslint
rev: master
hooks:
- id: jenkinslint
This will automatically validate files named ``Jenkinsfile`` during the pre
commit phase.