Skip to content

daveoxley/buildkite-housekeep-artifacts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project deletes old buildkite artifacts stored in S3.

Configure the policy of branches in the buildkite pipelines using a json file. The branch is a regexp and the matching policy with the highest matchPriority is used. Here's an example:

{
  "develop": {
    "matchPriority": 10,
    "maxCount": -1,
    "maxAge": 31
  },
  "master": {
    "matchPriority": 10,
    "maxCount": -1,
    "maxAge": -1
  },
  "feature/.*": {
    "matchPriority": 10,
    "maxCount": 1,
    "maxAge": -1
  },
  ".*": {
    "matchPriority": 0,
    "maxCount": -1,
    "maxAge": 31
  }
}

To run use the following command.

go run *.go -token {buildkite access token} -org {buildkite org slug} -branchConf branch-config.json -bucket {s3 bucket}

To do a dry run add the parameter -dry-run and to see what would be deleted add -debug 1.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages