Commit 3cf364b7 authored by Federico Falconieri's avatar Federico Falconieri
Browse files

docs: document monorepo and polirepo container pipelines

parent 4265bf57
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -12,9 +12,3 @@ kaniko:
grype:
  rules:
    - when: never

##### USAGE #####
# TODO: move to readme?
# by default, no job will run.
# the user needs to define manually a kaniko job and a grype job for each of his container images
# see tests/pipelines/container/monorepo.yml for an example
+54 −0
Original line number Diff line number Diff line
# container jobs

We support 2 type of projects:
* polirepos: projects with only one container image
* monorepos: projects with many container images

## polirepos

Including the following you will automatically get a `kaniko` job and a `grype` job to test the image build by `kaniko`.
See `docker/kaniko.yml` for the environment variables available to customise `Dockerfile` location, build context, arguments and more.

```bash
include:
    - project: 'just-ci/templates'
      file: 'pipelines/container/polirepo.yml'
```

## monorepos

The user must include the following

```bash
include:
    - project: 'just-ci/templates'
      file: 'pipelines/container/monorepo.yml'
```

However, by default no job will run. The user needs to define manually a kaniko job and a grype job for each of his container images. This is because we can not infer the location of the container contexts. For example a user with 2 container images in directories `image_A` and `image_B` in his project will need to add the following:

```yaml
# see tests/pipelines/container/monorepo.yml for a real example

kaniko:image_A:
  extends: .kaniko:monorepo:
  variables:
    CONTEXT_PATH: image_A

kaniko:image_B:
  extends: .kaniko:monorepo:
  variables:
    CONTEXT_PATH: image_B

grype:image_A:
  extends: .grype:monorepo
  variables:
    GRYPE_CONTEXT: image_A
  needs: ["kaniko:image_A"]

grype:image_B:
  extends: .grype:monorepo
  variables:
    GRYPE_CONTEXT: image_B
  needs: ["kaniko:image_B"]
```