Commit 38af5665 authored by Federico Falconieri's avatar Federico Falconieri
Browse files

fix: further improvements

parent 71dad99f
Loading
Loading
Loading
Loading
+14 −25
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ include:

The above is a template for Python projects. Other templates can be found in `templates/`, for example:

* Python projects with a `Dockerfile`: `templates/python-docker.yml`. This template will use your `Dockerfile` to create an image in which we run tests.
* Python projects with a `Dockerfile`: `templates/container/python.yml`. This template will use your `Dockerfile` to create an image in which we run tests.
* C projects: `templates/c.yml`.

## Disabling specific jobs
@@ -81,46 +81,35 @@ include:
    ref: 'v3.19.2'
```

# Repositories with multiple `Dockerfile`s
# monorepos vs polirepos

Use [child pipelines](https://docs.gitlab.com/ee/ci/pipelines/parent_child_pipelines.html) to work with multiple dockerfiles. An example is provided, based on a mockup project used within the tests of this repository.
We support both! Read [this](pipelines/container/readme.md) for more information on how to configure pipelines for monorepos and polirepos.

> `.gitlab-ci.yml`
### example python polirepo

Polirepos will likely work out of the box without extra configuration needed.

```yaml
---
include:
  - project: 'just-ci/templates'
    templates: 'templates/docker.yml'
    ref: 'v4.0.1'
    # root image will build fine without any further change needed

# child pipeline for second docker image
second-image:
  stage: build
  inherit:
    variables: false
  trigger:
    include:
      - local: second-image/.gitlab-ci.yml
    strategy: depend
    file: 'templates/container/python.yml'
    ref: v5.0.0-beta.1
```

> `second-image/.gitlab-ci.yml`
### example monorepo

In monorepos you can start by including the following, but you will need to write your own kaniko and grype job. Again, read [this](pipelines/container/readme.md)

```yaml
---
include:
  - project: 'just-ci/templates'
    file: 'templates/docker.yml'
    ref: 'v4.0.1'

variables:
  KANIKO_REGISTRY_IMAGE: ${CI_REGISTRY_IMAGE}/second-image
  KANIKO_CONTEXT: ${CI_PROJECT_DIR}/second-image
  KANIKO_DOCKERFILE: ${CI_PROJECT_DIR}/second-image/Dockerfile
    file: 'templates/container/monorepo.yml'
    ref: v5.0.0-beta.1
```


## Contributing

See [`CONTRIBUTING.md`](CONTRIBUTING.md)