zuul-jobs/roles/test-prepare-workspace-git
James E. Blair 78276a58c5 Fix prepare-workspace-git operating on existing repos
Commit 8003cdc76ca177061b1a462d07efaff83e18491b causes problems
if the remote repo already exists (e.g., the worker node is static
and not ephemeral) because it unconditionally removes settings
which are only conditionally set if the workspace is newly cloned.

Fix that by remove the Ansible "creates" check from the task and
executing the set calls unconditionally (but also, recreate the
functionality of the create check for the cloning part of the
task, which is what we're really trying to avoid).

This will run a few extra command such as clearing the bare flag
and also resetting the origin remote.  That should be fine in
this role since we expect it to do whatever it takes to make the
remote repo the same as the local one.

Also, resync test-prepare-workspace-git.

Change-Id: Ife12992df9ce2b0ce199b3980a4baa255cb0f28a
2024-07-23 17:18:03 -07:00
..

Mirror the local git repos to remote nodes

This role uses git operations (unlike :zuulprepare-workspace which uses rsync) to mirror the locally prepared git repos to the remote nodes while taking advantage of cached repos on the node if they exist. This role works generically regardless of the existence of a cached repo on the node.

The cached repos need to be placed using the canonical name under the cached_repos_root directory.

Role Variables