summaryrefslogtreecommitdiff
path: root/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
blob: ef72935ff31437ed7048238a1b0857a313abb502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# mk-ghcup-metadata

This script is used to automatically generate metadata suitable for consumption by
GHCUp.

# Usage

```
nix run -f .gitlab/rel_eng/ -c ghcup-metadata
```

```
options:
  -h, --help            show this help message and exit
  --metadata METADATA   Path to GHCUp metadata
  --pipeline-id PIPELINE_ID
                        Which pipeline to generate metadata for
  --release-mode        Generate metadata which points to downloads folder
  --fragment            Output the generated fragment rather than whole modified file
  --version VERSION     Version of the GHC compiler
  --date DATE           Date of the compiler release
```

The script also requires the `.gitlab/jobs-metadata.yaml` file which can be generated
by running `.gitlab/generate_jobs_metadata` script if you want to run it locally.


## CI Pipelines

The metadata is generated by the nightly and release pipelines.

* Nightly pipelines generate metadata where the bindist URLs point immediatley to
  nightly artifacts.
* Release jobs can pass the `--release-mode` flag which downloads the artifacts from
  the pipeline but the final download URLs for users point into the downloads folder.

The mapping from platform to bindist is not clever, it is just what the GHCUp developers
tell us to use.

## Testing Pipelines

The metadata is tested by the `ghcup-ci` repo which is triggered by the
`ghcup-metadata-testing-nightly` job.

This job sets the following variables which are then used by the downstream job
to collect the metadata from the correct place:

* `UPSTREAM_PIPELINE_ID`  - The pipeline ID which the generated metadata lives in
* `UPSTREAM_PROJECT_ID`   - The project ID for the upstream project (almost always `1` (for ghc/ghc))
* `UPSTREAM_JOB_NAME`     - The job which the metadata belongs to (ie `ghcup-metadata-nightly`)
* `UPSTREAM_PROJECT_PATH` - The path of the upstream project (almost always ghc/ghc)

Nightly pipelines are tested automaticaly but release pipelines are manually triggered
as the testing requires the bindists to be uploaded into the final release folder.