Make sure you're familiar with how to configure and run of the CLI.
We assume that your project already contains a CLI configuration file like
We also assume that the Jenkins agent runs on linux. If not, you might have to make some minor changes.
How to Set Up a Job
Set up a new Freestyle Jenkins job:
Or modify an existing:
Specify the repository you want to check:
Configure the Access Token and the Acrolinx URL. Depending on security and your infrastructure, you can:
Make sure that the CLI is installed on the Jenkins agent. To be able to run the CLI, you might have to set the executable permission.
chmod +x bin/acrolinx-cli*
Execute shellbuild step, that calls CLI with its config:
bin/acrolinx-cli* check --config .cli-config.json
Make sure that you installed the
Configure a post build action to publish the test results of
Save the job configuration.
To run the job, click
To show a trend diagram, the publish test results post build action requires two, or more runs. Afterwards a diagram is shown:
Jenkins will also show failing tests by in the build status:
For each checked file, one XUnit test case is created. By default the CLI fails a test case, if the status is red, or yellow. You can restrict the failing of the tests to red only by specifying the option
Jenkins can also be configured to fail the job, if tests fail.