zuul-jobs/roles/upload-git-mirror
Thierry Carrez a6fab9c48f upload-git-mirror: use retries to avoid races
To avoid errors in case of mirror race conditions, we currently
(try to) ignore mirror errors, and check for presence of the
reference after the mirror try. This requires having to play
tricks to avoid errors when the job is run in the check pipeline,
due to missing zuul.newrev. And for some reason, it does not seem
to work[1].

Instead of ignoring errors and running an additional check, let's
just retry the mirror operation three times.

The race is rare-enough that it's very unlikely that we would
hit it three times in a row.

[1] https://zuul.openstack.org/build/4966cd5617624d348fa0048de14f1f96

Change-Id: Ifa4f25ad8c961a1b2dbd9f07a3a1e4652b790c9c
2020-06-26 13:15:41 +02:00
..
defaults Add parameter to upload-git-mirror to specify ssh host key 2019-04-01 16:34:59 -04:00
tasks upload-git-mirror: use retries to avoid races 2020-06-26 13:15:41 +02:00
README.rst Add parameter to upload-git-mirror to specify ssh host key 2019-04-01 16:34:59 -04:00

Mirrors a git repository to a remote git server

Meant to be used after a change was successfully merged, this role mirrors a tested git repository to a remote git server over SSH.

The role assumes that git has been previously installed and does not require superuser privileges to run.

Role Variables

Dictionary that provides the remote git repository credentials

SSH user for the remote git repository

SSH host for the remote git repository

Literal private key contents. Should start with something like -----BEGIN RSA PRIVATE KEY-----.

SSH host key of the remote git server. Can be obtained with ssh-keyscan -H <host>.

Path of the remote git repository