Skip to content

Commit

Permalink
refactor: Terraform to seed causes and donations test data to Firesto…
Browse files Browse the repository at this point in the history
…re (#650)

* campaign collection resources

* add resources for causes firestore collection

* add resources for donations firestore collection

* tf fmt

Co-authored-by: Roger Martinez <rogerthatdev@gmail.com>
  • Loading branch information
rogerthatdev and Roger Martinez committed Aug 30, 2022
1 parent c6b0153 commit a192c14
Show file tree
Hide file tree
Showing 7 changed files with 2,275 additions and 1 deletion.
25 changes: 25 additions & 0 deletions terraform/modules/emblem-app/files/templates/campaigns.tftpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
${jsonencode({
name = {
stringValue = name
}
description = {
stringValue = description
}
cause = {
stringValue = cause
}
managers = {
arrayValue = {
values = [ for email in split(",", managers) : { "stringValue": email } ]
}
}
goal = {
integerValue = goal
}
imageUrl = {
stringValue = imageUrl
}
active = {
booleanValue = active
}
})}
14 changes: 14 additions & 0 deletions terraform/modules/emblem-app/files/templates/causes.tftpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
${jsonencode({
name = {
stringValue = name
}
description = {
stringValue = description
}
imageUrl = {
stringValue = imageUrl
}
active = {
booleanValue = active
}
})}
11 changes: 11 additions & 0 deletions terraform/modules/emblem-app/files/templates/donations.tftpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
${jsonencode({
campaign = {
stringValue = campaign
}
donor = {
stringValue = donor
}
amount = {
integerValue = amount
}
})}
Loading

0 comments on commit a192c14

Please sign in to comment.