Files
zuul-jobs/roles/upload-artifactory
James E. Blair 15828c7a85 Simplify testing of some upload roles
These two roles no longer need the delegation variable used in
testing, so it is removed.  Role execution now happens on the
executor.

Since the remote servers are still on the worker node, we open
the firewall on the remote node in both cases.

In the artifactory role, the ensure-docker role is moved to a
"roles" section for simplicity.  Additionally, one of the
artifactory API calls is wrapped in retries as a precaution
since I saw that fail in local testing.

Change-Id: Ia4409edc217e1935775a5aece2e7d9bcfd935762
2025-09-03 17:11:15 -07:00
..
2021-12-16 06:48:49 -08:00

Upload artifacts specified from the executor to artifactory.

Note

This role uses the src function of the uri module introduced in Ansible 2.7 therefore any ansible version lower than that is not supported.

Role Variables

Complex argument that contains the information about credentials, fqdn and name. This argument is expected to come from a secret.

User for authenticating.

Password for authenticating. Has a lower precedense than api_key.

API key for authenticating. Has a higher precedense than password.

Fully qualified domain name to the instance.

Dictionary of types of items to upload. Currently only supports artifacts.

Variable that contains a manifest of the artifacts that should be uploaded to a specific instance of artifactory. This is expected to be set during the build as a cached fact.

artifacts:
  - name: tarball
    src: artifact.tar.gz
    dest: /destination/to/put/artifact/artifact.tar.gz
    instance: artifact-server1
    headers:
      Content-Type: application/gzip

The attributes available on an artifact are the following.

Name of the artifact. This will be displayed in the build page.

Path relative to {{ zuul.executor.work_root }}/artifacts/.

Destination where the artifact should be put in.

Artifactory instance to place the artiface in, this is to choose which entry in :zuulupload-artifactory.upload_artifactory_instances to upload the artifact to.

Any headers that should be passed to ansibles uri module when uploading.

Properties to set in artifactory.

Properties can be either strings or lists of strings.

properties:
  property1: value1
  property2:
    - value2
    - value3

Any metadata that should be returned to Zuul together with the artifact link.