Some checks failed
Code Quality & Security Scan / TFLint (push) Successful in 26s
Code Quality & Security Scan / Terraform Destroy (push) Has been skipped
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 33s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 39s
Code Quality & Security Scan / Terraform Validate (push) Failing after 32s
Code Quality & Security Scan / SonarQube Scan (push) Has been skipped
Code Quality & Security Scan / Terraform Plan (push) Has been skipped
Code Quality & Security Scan / Terraform Apply (push) Has been skipped
Add support for Renovate to detect and update Docker image versions defined in Terraform files using annotation comments. Changes: - Add 3 regex managers to config.js.tpl for different annotation patterns: - Basic: # renovate: datasource=docker - With versioning: # renovate: datasource=docker versioning=semver - Separate variable: # renovate: datasource=docker depName=redis - Update README.md with comprehensive Docker container annotation docs - Update QUICKSTART.md with Terraform Docker container examples - Add example-annotated-containers.tf with usage patterns This enables Renovate to automatically create PRs when Docker images used in Terraform container definitions have updates available.
71 lines
2.3 KiB
Smarty
71 lines
2.3 KiB
Smarty
// Renovate configuration file
|
|
// This file is generated by Terraform and uploaded to the container
|
|
|
|
module.exports = {
|
|
// Platform configuration
|
|
platform: '${platform}',
|
|
endpoint: '${endpoint}',
|
|
|
|
// Bot identity
|
|
gitAuthor: '${git_author}',
|
|
username: '${username}',
|
|
|
|
// Repository discovery
|
|
autodiscover: ${autodiscover},
|
|
|
|
// Onboarding configuration for new repositories
|
|
onboardingConfig: ${onboarding_config},
|
|
|
|
// Recommended: Use persistent cache directory
|
|
cacheDir: '/tmp/renovate/cache',
|
|
|
|
// Logging
|
|
logContext: 'renovate-bot',
|
|
|
|
// Additional recommended settings for Gitea
|
|
requireConfig: 'optional',
|
|
|
|
// Regex managers for custom version detection
|
|
// This enables Renovate to detect Docker image versions in Terraform files
|
|
// when annotated with: # renovate: datasource=docker
|
|
regexManagers: [
|
|
{
|
|
// Match Docker image versions in Terraform files (.tf and .tfvars)
|
|
// Requires annotation comment above the image line
|
|
// Example:
|
|
// # renovate: datasource=docker
|
|
// image = "nginx:1.25.0"
|
|
fileMatch: ['\\.tf$', '\\.tfvars$'],
|
|
matchStrings: [
|
|
'#\\s*renovate:\\s*datasource=docker\\s*\\n\\s*image\\s*=\\s*"(?<depName>[^:"]+):(?<currentValue>[^"]+)"'
|
|
],
|
|
datasourceTemplate: 'docker'
|
|
},
|
|
{
|
|
// Match Docker image versions with explicit versioning scheme
|
|
// Example:
|
|
// # renovate: datasource=docker versioning=semver
|
|
// image = "hashicorp/vault:1.17.3"
|
|
fileMatch: ['\\.tf$', '\\.tfvars$'],
|
|
matchStrings: [
|
|
'#\\s*renovate:\\s*datasource=docker\\s+versioning=(?<versioning>\\S+)\\s*\\n\\s*image\\s*=\\s*"(?<depName>[^:"]+):(?<currentValue>[^"]+)"'
|
|
],
|
|
datasourceTemplate: 'docker',
|
|
versioningTemplate: '{{versioning}}'
|
|
},
|
|
{
|
|
// Match separate image and version/tag variables
|
|
// Example:
|
|
// # renovate: datasource=docker depName=redis
|
|
// version = "8.0.0"
|
|
fileMatch: ['\\.tf$', '\\.tfvars$'],
|
|
matchStrings: [
|
|
'#\\s*renovate:\\s*datasource=(?<datasource>\\S+)\\s+depName=(?<depName>\\S+)\\s*\\n.*?(?:version|tag)\\s*=\\s*"(?<currentValue>[^"]+)"'
|
|
],
|
|
datasourceTemplate: '{{datasource}}'
|
|
}
|
|
],
|
|
|
|
// Repository-level settings can be overridden in renovate.json files
|
|
};
|