Commit 7345746d authored by Federico Falconieri's avatar Federico Falconieri
Browse files

docs: improves

parent 70721b14
Loading
Loading
Loading
Loading
+36 −13
Original line number Diff line number Diff line
@@ -10,6 +10,17 @@ Including the following you will automatically get a `kaniko` job and a `grype`
See `container/kaniko.yml` for the environment variables available to customise `Dockerfile` location, build context, arguments and more.

```bash
# project structure

polirepo
├── .gitlab-ci.yml
├── Dockerfile
├── README.md
├── deployment.yml
└── docker-compose.yml
```

```yml
include:
    - project: 'just-ci/templates'
      file: 'pipelines/container/polirepo.yml'
@@ -19,7 +30,7 @@ include:

The user must include the following

```bash
```yml
include:
    - project: 'just-ci/templates'
      file: 'pipelines/container/monorepo.yml'
@@ -27,28 +38,40 @@ include:

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
```bash
# project structure
monorepo
├── .gitlab-ci.yml
├── README.md
├── a
│   ├── Dockerfile
│   └── test_A.txt
└── b
    ├── Dockerfile
    └── test_B.txt
```

```yml

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

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

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

grype:image_B:
grype:b:
  extends: .grype:monorepo
  variables:
    GRYPE_CONTEXT: image_B
  needs: ["kaniko:image_B"]
    GRYPE_CONTEXT: b
  needs: ["kaniko:b"]
```
+0 −0

Empty file added.

+0 −0

Empty file added.