Continuous Integration (CI)

Instant devOps - just add water!™

Configuring code quality on your CI servers should be simple - we've got it down to 2 lines of config!

In your CI build config, simply add these lines.
npm i sidekick
sidekick run --ci

If you're running on Travis, then you can use Sidekick to check your pull requests.

Simply tell Sidekick you're running on Travis.
sidekick run --travis
This will run Sidekick on only the code that has changed in the PR.
Because we are only analysing the modified code, your quality check is super fast!

What do you get for your 2 lines of config?

Sidekick will:

1
Download all required analysers from npm (usually cached by your CI server)
2
If your repo contains a .sidekickrc file, we will use these settings when analysing.
3
If you have no .sidekickrc file, then we will download our standard set of analysers (security, dependencies..)
4
We will evaluate the repo contents to see if we have any analysers that might help (e.g. JS-TODOS for JavaScript)
5
We will look in the repo root for analyser config files such as .eslintrc, .jscsrc, tslintConfig.json and download the corresponding analysers.
6
Sidekick will then run with the options that you have specified or our default options.
7
Sidekick will fail the build for any analyser that is marked as 'failCiOnError: true' in your .sidekickrc file.

Troubleshooting

First, check that your CI server can provide node (we use version 4.2+).
Secondly, check that you can download Sidekick from npm. If you use nexus to mirror npm dependencies, then you need to be running Nexus 3+ (because we use scoped packages on npm).
Jenkins
Check that you have Execute Shell build steps for:
npm i sidekick
sidekick run --ci
Ensure that you have node installed in your Jenkins instance.
Ensure that the version of node that will run is 4+.
Travis
Check that your .travisrc file contains
install:
- npm i sidekick
and (to analyse PRs)
script:
- sidekick run --travis
or (to analyse all code)
script:
- sidekick run --ci
Codeship
Check that your setup commands contains
npm i sidekick
and your test commands contains
sidekick run --ci