artifacts – expire_in

The expire_in sub-parameter is provided with a string defining how long artifacts should be kept for in the GitLab instance. If this is not specified, it defaults to the instance setting, which is 30 days by default for self-hosted GitLab or forever for GitLab.com projects. Some examples of strings that you can provide include the following:

  • 42 weeks
  • 42 days
  • 42 mins 42 secs
  • 2 mos 1 day
  • 42 years 6 mos 6 hrs
  • 1 week and 2 days

Keep in mind that the job that deletes old artifacts is run on an hourly basis, so units of time less than one hour might not be effective. There is also a Keep button in the GitLab web user interface that can be used to keep an artifact forever and override the specified time value.

Get GitLab Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.