spin-systems / quill

MIT License
0 stars 0 forks source link

Use CI/CD build automation to stand up dependent sites when they push changes #2

Closed lmmx closed 2 years ago

lmmx commented 3 years ago
lmmx commented 3 years ago

The guidance on GitLab (in: Settings ⇢ CI/CD ⇢ Pipeline triggers) is to incorporate a POST request to trigger the pipeline at the end of a build script of a dependency project

curl -X POST \
     -F token=TOKEN \
     -F "ref=REF_NAME" \
     -F "variables[RUN_NIGHTLY_BUILD]=true" \
     https://gitlab.com/api/v4/projects/project_id_goes_here/trigger/pipeline

For GitHub, the equivalent endpoint to target would need to be created, specifically one of the per-repo hooks

As an alternative to using GitHub for this, you can use the importer to mirror the GitHub repo to GitLab, which will (using the web UI with the "repo" scope) automatically create a webhook that keeps GitLab in sync.

Not clear if this needs a pipeline triggering at all: it can be done by simply pip installing the remote git repo for quill within the already-running pipeline of the site build script triggered on pushing to the dependency site (e.g. poll)

It would be possible to trigger a second build script via webhooks but surely this would be slower...