Skip to content

Commit 34f307a

Browse files
kunzesesce-taid
authored andcommitted
feat: add Git LFS support
PiperOrigin-RevId: 780903357
1 parent 9d57afb commit 34f307a

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

examples/simple/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ moved {
2323
}
2424

2525
module "abfs_server" {
26-
source = "github.com/terraform-google-modules/terraform-google-abfs//modules/server?ref=v0.6.0"
26+
source = "github.com/terraform-google-modules/terraform-google-abfs//modules/server?ref=v0.7.0"
2727

2828
project_id = data.google_project.project.project_id
2929
zone = var.zone
@@ -37,7 +37,7 @@ module "abfs_server" {
3737
}
3838

3939
module "abfs_uploaders" {
40-
source = "github.com/terraform-google-modules/terraform-google-abfs//modules/uploaders?ref=v0.6.0"
40+
source = "github.com/terraform-google-modules/terraform-google-abfs//modules/uploaders?ref=v0.7.0"
4141

4242
project_id = data.google_project.project.project_id
4343
zone = var.zone
@@ -53,6 +53,7 @@ module "abfs_uploaders" {
5353
abfs_manifest_file = var.abfs_manifest_file
5454
abfs_license = var.abfs_license
5555
abfs_server_name = module.abfs_server.abfs_server_name
56+
abfs_enable_git_lfs = var.abfs_enable_git_lfs
5657
}
5758

5859
module "monitoring" {

examples/simple/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,9 @@ variable "abfs_spanner_instance_config" {
104104
type = string
105105
description = "The name of the instance's configuration (similar but not quite the same as a region) which defines the geographic placement and replication of your ABFS database in this instance (https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/spanner_instance.html#config-1)."
106106
}
107+
108+
variable "abfs_enable_git_lfs" {
109+
type = bool
110+
description = "Enable Git LFS support"
111+
default = false
112+
}

modules/uploaders/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ For example usage, please check the following [example](../../examples/simple/ma
1313
|------|-------------|------|---------|:--------:|
1414
| abfs\_datadisk\_mountpoint | Location for mounting the ABFS datadisk on the host VM | `string` | `"/mnt/disks/abfs-data"` | no |
1515
| abfs\_docker\_image\_uri | Docker image URI for the ABFS uploader | `string` | n/a | yes |
16+
| abfs\_enable\_git\_lfs | Enable Git LFS support | `bool` | `false` | no |
1617
| abfs\_gerrit\_uploader\_count | The number of gerrit uploader instances to create | `number` | `3` | no |
1718
| abfs\_gerrit\_uploader\_datadisk\_name\_prefix | A name prefix for the ABFS gerrit uploader datadisk(s) that will be attached to VM(s). Note, this does not affect the mounting of the disk - the device name is always set to "abfs-server-storage" | `string` | `"abfs-gerrit-uploader-datadisk"` | no |
1819
| abfs\_gerrit\_uploader\_datadisk\_size\_gb | Size in GB for the ABFS gerrit uploader datadisk(s) that will be attached to the VM(s) | `number` | `4096` | no |

modules/uploaders/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ data "cloudinit_config" "abfs_gerrit_uploader_configs" {
137137
content = base64gzip(templatefile("${local.common_files_root}/templates/abfs_container.env.tftpl",
138138
{
139139
envs = {
140-
"NEEDS_GIT" = true # gerrit uploaders need git access
140+
"NEEDS_GIT" = true # gerrit uploaders need git access
141+
"GIT_LFS_ENABLED" = var.abfs_enable_git_lfs
141142
}
142143
}))
143144
}
@@ -158,6 +159,7 @@ data "cloudinit_config" "abfs_gerrit_uploader_configs" {
158159
--manifest-server ${var.abfs_gerrit_uploader_manifest_server} \
159160
--remote-servers ${var.abfs_server_name}:50051 \
160161
--manifest-project-name ${var.abfs_manifest_project_name} \
162+
--lfs=${var.abfs_enable_git_lfs} \
161163
gerrit upload-daemon ${var.abfs_gerrit_uploader_count} ${count.index} \
162164
--branch ${join(",", var.abfs_gerrit_uploader_git_branch)} \
163165
--project-storage-path /abfs-storage \

modules/uploaders/metadata.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ spec:
8181
varType: set(string)
8282
defaultValue:
8383
- main
84+
- name: abfs_enable_git_lfs
85+
description: Enable Git LFS support
86+
varType: bool
87+
defaultValue: false
8488
- name: abfs_license
8589
description: ABFS license (JSON)
8690
varType: string

modules/uploaders/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ variable "abfs_gerrit_uploader_git_branch" {
8080
default = ["main"]
8181
}
8282

83+
variable "abfs_enable_git_lfs" {
84+
type = bool
85+
description = "Enable Git LFS support"
86+
default = false
87+
}
88+
8389
variable "abfs_license" {
8490
type = string
8591
description = "ABFS license (JSON)"

0 commit comments

Comments
 (0)