summaryrefslogtreecommitdiff
path: root/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/rel_eng/mk-ghcup-metadata/README.mkd')
-rw-r--r--.gitlab/rel_eng/mk-ghcup-metadata/README.mkd56
1 files changed, 56 insertions, 0 deletions
diff --git a/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd b/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
new file mode 100644
index 0000000000..fe16439b61
--- /dev/null
+++ b/.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
@@ -0,0 +1,56 @@
+# 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
+```
+
+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.
+
+
+