Skip to content

Commit d51dceb

Browse files
authored
Add Renovate Support (#15)
* Use renovate * Add renovate support for mygeotab adapter app version
1 parent 4067914 commit d51dceb

File tree

4 files changed

+101
-32
lines changed

4 files changed

+101
-32
lines changed

.github/workflows/ami_updater.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

renovate.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:best-practices"
5+
],
6+
"ignorePresets": [
7+
":ignoreModulesAndTests"
8+
],
9+
"assignees": [
10+
"Weastie"
11+
],
12+
"terraform": {
13+
"pinDigests": true
14+
},
15+
"customManagers": [
16+
{
17+
"customType": "regex",
18+
"managerFilePatterns": [
19+
"/.+\\.tf$/"
20+
],
21+
"matchStrings": [
22+
"#\\s*renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?(?: extractVersion=(?<extractVersion>.*?))?\\s.*?_(?:version|tag)\\s*=\\s*\"(?<currentValue>.*)\""
23+
],
24+
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{/if}}"
25+
},
26+
{
27+
"customType": "regex",
28+
"managerFilePatterns": [
29+
"/.+\\.tf$/"
30+
],
31+
"matchStrings": [
32+
".*amiFilter=(?<packageName>.*?)\n(.*currentImageName=(?<currentDigest>.*?)\n)?(.*\n)?.*?(?<depName>[a-zA-Z0-9-_]*)\\s*=\\s*\"(?<currentValue>ami-[a-z0-9]{17})\""
33+
],
34+
"datasourceTemplate": "aws-machine-image",
35+
"versioningTemplate": "aws-machine-image"
36+
}
37+
],
38+
"packageRules": [
39+
{
40+
"matchManagers": [
41+
"terraform",
42+
"terraform-version"
43+
],
44+
"rangeStrategy": "pin",
45+
"pinDigests": true
46+
},
47+
{
48+
"matchDatasources": [
49+
"docker"
50+
],
51+
"separateMinorPatch": true
52+
},
53+
{
54+
"matchDatasources": [
55+
"github-releases"
56+
],
57+
"separateMinorPatch": true
58+
},
59+
{
60+
"matchFileNames": [
61+
"terraform/env/dev/**"
62+
],
63+
"matchDatasources": [
64+
"docker",
65+
"aws-machine-image"
66+
],
67+
"commitMessagePrefix": "[dev]",
68+
"additionalBranchPrefix": "dev-"
69+
},
70+
{
71+
"matchFileNames": [
72+
"terraform/env/test/**"
73+
],
74+
"matchDatasources": [
75+
"docker",
76+
"aws-machine-image"
77+
],
78+
"commitMessagePrefix": "[test]",
79+
"additionalBranchPrefix": "test-"
80+
},
81+
{
82+
"matchFileNames": [
83+
"terraform/env/prod/**"
84+
],
85+
"matchDatasources": [
86+
"docker",
87+
"aws-machine-image"
88+
],
89+
"commitMessagePrefix": "[prod]",
90+
"additionalBranchPrefix": "prod-"
91+
}
92+
]
93+
}

terraform/env/prod/ami.auto.tfvars

Lines changed: 0 additions & 3 deletions
This file was deleted.

terraform/env/prod/main.tf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,12 @@ provider "aws" {
3333
provider "secretsmanager" {
3434
}
3535

36-
variable "ec2_ami_id" {
37-
type = string
38-
}
39-
4036
module "app" {
4137
source = "../../modules/app"
4238

43-
env_name = "prod"
44-
app_name = "mygeotab-api-adapter"
39+
env_name = "prod"
40+
app_name = "mygeotab-api-adapter"
41+
# renovate: datasource=github-releases depName=Geotab/mygeotab-api-adapter
4542
app_version = "v3.11.0"
4643
dev_mode = true
4744
# Prod vpc
@@ -56,6 +53,9 @@ module "app" {
5653
# EC2
5754
ec2_instance_type = "t3.medium"
5855
ssh_key_name = "citygeo"
59-
ec2_ami_id = var.ec2_ami_id
60-
build_branch = "main"
56+
# Note: AMI is hardcoded to Kernel 6.12. Make note to occasionally update that manually
57+
# amiFilter=[{"Name":"owner-id","Values":["137112412989"]},{"Name":"name","Values":["al2023-ami-2023*-kernel-6.12-x86_64"]},{"Name":"architecture","Values":["x86_64"]},{"Name":"virtualization-type","Values":["hvm"]}]
58+
# currentImageName=al2023-ami-2023.9.20251117.1-kernel-6.12-x86_64
59+
ec2_ami_id = "ami-0f00d706c4a80fd93"
60+
build_branch = "main"
6161
}

0 commit comments

Comments
 (0)