@@ -12,14 +12,9 @@ This repository is mainly meant to share scripts and configs between the two rep
``` bash
.
├── includes # folder for (possibly shared) yaml files which are included in the main ones
│ ├── default-variables-basop.yml
│ ├── default-variables.yml
│ ├── job-templates.yml
│ ├── rules-basop.yml
│ └── rules.yml
├── includes # folder for shared yaml files which are included in the main ones
├── main-basop.yml # CI config for ivas-basop repo
├── main.yml # shared CI config
├── main-float.yml # CI config for ivas-basop repo
├── ...
└── snippets # Folder for scripts used in CI only. Shared ones go in the folder directly. Can be small ones or bigger scripts which implement a whole job
├── basop
@@ -32,7 +27,7 @@ This repository is mainly meant to share scripts and configs between the two rep
## Usage
For both repositories (ivas-codec and ivas-basop), there should be one main yml file in here which includes stuff from `includes`.
Ideally, there is no other CI code in the respective repositories except a minimal `.gitlab-ci.yml` file which includes from here (currently only achieved for ivas-basop), e.g. (from ivas-basop):
There is no other CI code in the respective repositories except a minimal `.gitlab-ci.yml` file which includes from here, e.g. (from ivas-basop):
``` yaml
variables:
@@ -47,9 +42,32 @@ include:
file:main-basop.yml
```
This way, any CI change can be developed centrally in this repository and does not need to be merged/ported to different repositories/branches (e.g. keeping ivas-basop main and ivas-float-update in synch).
This way, any CI change can be developed centrally in this repository and does not need to be merged/ported to different repositories/branches.
### Adding new CI code
### Adding a new job
In general, job definitions should go into `main-float.yml` or `main-basop-yml` if they are specific to one of the repos.
Shared jobs should go into `includes/`.
It might also be helpful for bundling stuff together to put repo-specific code into `includes/` as well.
The workflow and rules section for each CI config are located at the top of the respective `main-*.yml` file.
After implementing your job, adapt or add there so that your job runs when desired.
Prefer adding scripts in `snippets/` over yaml anchors.
Also check the [guidelines](#some-guidelines-hints) below.
For shared jobs, it might be needed to check in which project the CI is running.
You can do that by checking the gitlab-predefined `CI_PROJECT_ID` variable against `PROJECT_ID_FLOAT` and/or `PROJECT_ID_BASOP`, e.g.:
``` yaml
script:
-|
if [ "$CI_PROJECT_ID" == "$PROJECT_ID_BASOP" ]; then