.gitlab-ci.yml: mirror master@lscsoft/lalsuite to master@CW/lalsuite
This patch added a CI job update-fork:cw
, which should only run on pushes to the master
branch on https://git.ligo.org/lscsoft/lalsuite (someone please check this!). It pushes the master
branch to https://git.ligo.org/CW/lalsuite in order to keep that fork up to date. It only runs after the LALSuite CI builds pass so that broken builds are not pushed to https://git.ligo.org/CW/lalsuite.
The CI job requires an access token to be given in UPDATE_FORK_CW_TOKEN
. I suggest using an access token only for this job, so it can be easily revoked if need be. Some ideas for how to do this:
- The access token is set by Adam, and I give Adam master access to https://git.ligo.org/CW/lalsuite so that the job can push to the master branch.
- The access token is set by me. I guess Adam would need to give me temporary master access to https://git.ligo.org/lscsoft/lalsuite to set this up.
A ~/.netrc
is used to set up authentication to GitLab using the access token. The alternative (including the token in the Git repo URL, e.g. git clone http://gitlab-ci-token:<TOKEN>@git.ligo.org/...
) results in git
printing the token to screen when running git push
, which would allow the token to be easily stolen. Just to be sure, the ~/.netrc
file is deleted afterwards.
The job uses git push
to push directly to https://git.ligo.org/CW/lalsuite, without setting up a remote using git remote add
. I noticed that the state of the git repository seems to be preserved between CI jobs, so if I add a remote in once CI job, that remote is still there when the job is run again. (Is this by design?) Using the https://git.ligo.org/CW/lalsuite URL directly saves the job having to add a remove, then remove it again afterwards to preserve the repo state.
Resolves issue #15 (closed)