Use Gerrit's package.json to create a npm package cache

The CI installed fixed versions of npm dependencies into the slave
containers. The versions had to be updated manually, if an update
was done in the Gerrit project. Thus updating the dependencies
was quite a slow process.

Now, the npm-packages are installed with yarn from the package.json
file of the Gerrit project during the build of the slave containers.
This fills yarn's cache, which will allow to install them during a
build without having to download them.

The Gerrit-codestyle job was adapted accordingly to use yarn to install
the required packages. This is tried in offline mode from the cache and
if that fails the installation is repeated with access to the package
servers.

The eslint and polylint steps are now run by yarn directly, since the
scripts run through bazel call npm, which fails, since it does not see
the dependencies.

Change-Id: I89aa4761f8d449d4caab193361c737b6b71d6d98
4 files changed
tree: 152d39b80d25d901e7f469063d9f7e13ba93a488
  1. jenkins/
  2. jenkins-docker/
  3. worker/
  4. .gitignore
  5. Jenkinsfile
  6. README.md
  7. yamllint-config.yaml
README.md

Gerrit CI scripts

Providing jobs

This project uses Jenkins Jobs Builder [1] to generate jobs from yaml descriptor files.

To add new jobs reuse existing templates, defaults etc. as much as possible. E.g. adding a job to build an additional branch of a project may be as easy as adding the name of the branch to an existing project.

To ensure well readable yaml-files, use yamllint [2] to lint the yaml-files. Yamllint can be downloaded using Python Pip:

pip3 install yamllint

To run the linter, execute this command from the project's root directory:

yamllint -c yamllint-config.yaml jenkins/**/*.yaml

Yamllint will not fix detected issues itself.

[1] https://docs.openstack.org/infra/jenkins-job-builder/index.html [2] https://pypi.org/project/yamllint/