zuul-jobs/roles/upload-afs-roots
Ian Wienand cd258e5a1d upload-afs: rename to upload-afs-roots; add afs-upload-synchronize
The upload-afs role is actually fairly specialised for uploading docs
with its root-marker scheme.  As we're moving more parts of our
infrastructure to publish via AFS I think it's worth making this quite
explicit by renaming the upload-afs role to upload-afs-roots.  This
should be transparent as we call the renamed role, and once callers
have been migrated we can use the usual deprecation process.

Add a partner role, upload-afs-synchronize, which is more of a
straight copy with options to synchronize.  This will be suitable for
uploading tarball and release artifacts.  This is similar in concept
to the promotion job used by zuul [1], but in this case will be
focused on the extant publishing jobs in project-config which don't
currently use the artifact-reporting/promote process.

[1] https://opendev.org/opendev/base-jobs/src/branch/master/playbooks/artifacts/promote.yaml#L39

Change-Id: I493d8829e3fd98e84f1b8f0e776e7ba41abf16c2
Story: #2006598
Task: #38600
2020-02-04 07:41:00 +11:00
..
defaults upload-afs: rename to upload-afs-roots; add afs-upload-synchronize 2020-02-04 07:41:00 +11:00
library upload-afs: rename to upload-afs-roots; add afs-upload-synchronize 2020-02-04 07:41:00 +11:00
tasks upload-afs: rename to upload-afs-roots; add afs-upload-synchronize 2020-02-04 07:41:00 +11:00
__init__.py upload-afs: rename to upload-afs-roots; add afs-upload-synchronize 2020-02-04 07:41:00 +11:00
README.rst upload-afs: rename to upload-afs-roots; add afs-upload-synchronize 2020-02-04 07:41:00 +11:00

Copy contents from {{ zuul.executor.work_root }}/artifacts/ to AFS

This is intented for documentation publishing, it deletes files that do not exist in the content from the source.

Before the job rsyncs the build into its final location, it must first create a list of directories that should not be deleted. This way if an entire directory is removed from a document, it will still be removed from the website, but directories which are themselves roots of other documents (for example, the stein branch) are not removed. A marker file, called .root-marker, at the root of each such directory will accomplish this; therefore each build job should also ensure that it leaves such a marker file at the root of its build. The job will find each of those in the destination hierarchy and add their containing directories to a list of directories to exclude from rsyncing.

Role Variables

Path to local source directory.

Target path in AFS (should begin with '/afs/...').