Skip to content

Support S3 for artifacts

Via aws_s3_upload_artifacts, the contents of the artifact directory can be synced to BUCKET_ARTIFACTS. This function can be called multiple times or when no artifacts are present. A call to aws_s3_upload_artifacts has been added to the end of each script and after_script block.

Uploaded artifacts can be filtered by specifying them in the ARTIFACTS variable similar to what was done before via the GitLab artifacts yaml dict.

At the end of the general job prepare, artifacts are downloaded via aws_s3_download_artifacts.

The behavior of those two functions can be controlled by the artifacts_mode trigger variable:

  • gitlab: nothing is uploaded or downloaded
  • gitlab-s3: upload and downloads happens to/from both GitLab and S3, and artifacts from S3 are checked to match those from GitLab
  • s3: upload and download only happens to/from S3; the upload to GitLab is prevented by deleting the artifacts directory after the S3 upload

For all settings of the artifacts_mode variable, artifacts are filtered as desribed above.

Contains:

  • implementation
  • unit tests
  • integration tests
Edited by Michael Hofmann

Merge request reports