昨日、Argo CDで参照しているHelm ChartをRenovateで自動アップデートする
という記事を公開しました。
これはregexManagersを使って指定したGitHubレポのReleaseからバージョン情報を取得する方法でしたが、 今回はもっと楽に簡単に実施する設定を紹介します。
前回の振り返り
前回は、regexManagersの追加と、更新対象の行にコメントを追加する方法でした。
// renovate.json5 "regexManagers": [ { "datasourceTemplate": "github-releases", "fileMatch": [ "argocd-config/base/.*\\.yaml" ], "matchStrings": [ // e.g.) targetRevision: 5.31.0 # renovate: depName=argoproj/argo-helm extractVersion=^argo-cd-(?<version>.+)$ " +targetRevision: +(?<currentValue>[^'\" ]+) +# renovate: depName=(?<depName>[^ \\n]+) +(extractVersion=(?<extractVersion>[^\\n]+))?", ], }, ]
# 更新対象にはコメントを追加 targetRevision: 5.31.0 # renovate: depName=argoproj/argo-helm extractVersion=^argo-cd-(?<version>.+)$
今回は、これよりも楽に自動更新させていきます。
もっと楽にするために
ドキュメントを読む
もっと楽に自動更新させるためには、Managersのドキュメントをまず読みます。
Managersを読む理由は、この中に既に適したManagersがあればそれについての設定を書くだけで簡単に自動更新対象になります。
ここになければ、regexManagersを書いたり、Issue作ったり、PR投げたりしましょう。
さてこれを見ていくと、どうやらargocd
というマネージャーがありました。
あまりそのまま使えるかどうかの話が出てきませんが、Additional Informationに以下のような文言があり、Argo CDのAppliactionに使えそうな雰囲気があります。
The argocd manager has no fileMatch default patterns, so it won't match any files until you configure it with a pattern. This is because there is no commonly accepted file/directory naming convention for argocd YAML files and we don't want to check every single *.yaml file in repositories just in case any of them have ArgoCD definitions.
設定を定義する
regexManagers
の定義がある場合は削除しておきましょう。
fileMatch
に更新対象のファイルのパスを定義すれば良いので、以下を定義します。
"argocd": { "fileMatch": [ "argocd-config/base/.*\\.yaml", ], },
これを追加するだけで更新対象となります、前回の方法よりもかなり簡単ですね。
作成されたPRs
おわりに
以上が、Argo CD ApplicationをRenovateで自動アップデートするための簡単な方法でした。
とりあえず導入するだけでも良いので試してみてください。