Skip to content

Latest commit

 

History

History
 
 

.ci

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Continuous integration

Structure

We are using Jenkins as CI runner and keep its configuration as code in the repo. The address of the instance we use is https://devops-ci.elastic.co/view/cloud-on-k8s/.

There are few layers in most of our jobs:

  1. Job definition - description of the job.
  2. Jenkinsfile - loads vault credentials, sets up configuration.
  3. CI makefile - creates container to run CI in, consolidates dev and CI setups.
  4. Main makefile - contains logic, delegates to specific tools as needed.
  5. tools - e.g. for e2e test running and cluster provisioning.

Local repro

For debugging and development purposes it's possible to run CI jobs from dev box. It requires minimal setup and it mirrors CI closely, starting at CI makefile layer.

Once, run:

# fill out:
export VAULT_ADDR=YOUR_VAULT_INSTANCE_ADDRESS
export GITHUB_TOKEN=YOUR_PERSONAL_ACCESS_TOKEN

Per repro, depending on the job, set up .env and deployer-config.yml files by using setenvconfig invocation from the respective Jenkinsfile. The script will prompt for any missing environment variables that are required for a given job. See examples below.

Test the cloud-on-k8s-e2e-tests-main job:

.ci/setenvconfig e2e/main
make -C .ci get-test-artifacts TARGET=ci-build-operator-e2e-run ci

Test the cloud-on-k8s-e2e-tests-stack-versions job:

JKS_PARAM_OPERATOR_IMAGE=docker.elastic.co/eck-snapshots/eck-operator:1.0.1-SNAPSHOT-2020-02-05-7892889 \
  .ci/setenvconfig e2e/stack-versions eck-75-dev-e2e 7.5.1
make -C .ci test-license.json license.key TARGET=ci-e2e ci

The CI Makefile will take care of setting up correct credentials in the deployer-config.yml file. For more details about settings in this file, see deployer.

This will run e2e tests using the same:

  1. container
  2. credentials
  3. settings
  4. call path

as the CI job.

CI container

You can build and run CI container interactively with:

make -C .ci ci-interactive