Skip to content

Commit

Permalink
Manage CI VM image updates with renovate
Browse files Browse the repository at this point in the history
This compliments the date/time based versioning implemented
in containers/automation_images#247

Once merged, these changes will result in renovate opening PRs
for tagged CI VM image commits in containers/automation_images.
Renovate will ignore any existing configurations using the old
`$CIRRUS_BUILD_ID` based *IMAGE_SUFFIX* values.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Jan 27, 2023
1 parent 8ff4776 commit 8c9402f
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion renovate/defaults.json5
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@ Validate this file before commiting with (from repository root):
"rollbackPrs": false,
},

/**************************************************
***** Manager-specific configuration options *****
**************************************************/

"regexManagers": [
{
"fileMatch": "^.cirrus.yml$",
// Expected veresion format: c<automation_images IMG_SFX value>
// For example `c20230120t152650z-f37f36u2204`
"matchStrings": ["c(?<currentValue>20\\d{6}t\\d{6}z-\\w+)"],
"depNameTemplate": "containers/automation_images",
"datasourceTemplate": "github-tags",
// Only treat the date/time component as the "version", saving the
// distro/version component for use by a package-rule (below).
// N/B: Must match exactly to 'versioning' in the 'regex' package rule.
"versioningTemplate": "regex:^(?<major>20\\d{6})t(?<minor>\\d{6})z-(?<compatibility>\\w+)$"
},
],

// N/B: LAST MATCHING RULE WINS, match statems are ANDed together.
// https://docs.renovatebot.com/configuration-options/#packagerules
"packageRules": [
Expand Down Expand Up @@ -104,6 +123,20 @@ Validate this file before commiting with (from repository root):
"matchManagers": ["github-actions"],
"matchDepTypes": ["action"],
"commitMessagePrefix": "[skip-ci]"
}
},

// Group together all CI VM image updates into a single PR. This is needed
// to handle the case where an IMG_SFX is mentioned in a comment. For
// example, flagging an important TODO or FIXME item. Or, where CI VM
// images are split across multiple IMG_SFX values that all need to be updated.
{
"matchManagers": ["regex"],
"matchFiles": [".cirrus.yml"], // full-path exact-match
"groupName": "CI VM Image",
// Block renovate from opening image update PRs with *compatibility*
// changes (i.e. distro's and/or versions)
// N/B: Must match exactly to 'versioningTemplate' in the regex manager.
"versioning": "regex:^(?<major>20\\d{6})t(?<minor>\\d{6})z-(?<compatibility>\\w+)$",
},
],
}

0 comments on commit 8c9402f

Please sign in to comment.