Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets upload #992

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions aws/common/uploadS3Assets.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "aws_s3_object" "assets" {

bucket = aws_s3_bucket.asset_bucket.id
for_each = fileset("/var/tmp/notification-admin/app/assets","**")
key = each.value
source = "/var/tmp/notification-admin/app/assets/${each.value}"
}
2 changes: 1 addition & 1 deletion aws/common/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,4 @@ variable "create_cbs_bucket" {
variable "eks_cluster_name" {
description = "Name of EKS Cluster"
type = string
}
}
16 changes: 16 additions & 0 deletions env/dev/common/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
terraform {
source = "../../../aws//common"

before_hook "get-admin" {
commands = ["apply", "plan"]
execute = ["git", "clone","-b", "asset-update", "https://github.com/cds-snc/notification-admin.git", "/var/tmp/notification-admin"]
run_on_error = true

}

after_hook "cleanup-admin" {
commands = ["apply", "plan"]
execute = ["rm", "-rfd", "/var/tmp/notification-admin"]
run_on_error = true
}

}

include {
Expand Down Expand Up @@ -34,5 +48,7 @@ inputs = {
eks_cluster_name = "notification-canada-ca-dev-eks-cluster"
}



# See QueueNames in
# https://github.com/cds-snc/notification-api/blob/master/app/config.py
13 changes: 13 additions & 0 deletions env/production/common/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
#
terraform {
source = "git::https://github.com/cds-snc/notification-terraform//aws/common?ref=v${get_env("INFRASTRUCTURE_VERSION")}"

before_hook "get-admin" {
commands = ["apply", "plan"]
execute = ["git", "clone","-b", "asset-update", "https://github.com/cds-snc/notification-admin.git", "/var/tmp/notification-admin"]
run_on_error = true

}

after_hook "cleanup-admin" {
commands = ["apply", "plan"]
execute = ["rm", "-rfd", "/var/tmp/notification-admin"]
run_on_error = true
}
}

include {
Expand Down
14 changes: 14 additions & 0 deletions env/scratch/common/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
terraform {
source = "../../../aws//common"

before_hook "get-admin" {
commands = ["apply", "plan"]
execute = ["git", "clone","-b", "asset-update", "https://github.com/cds-snc/notification-admin.git", "/var/tmp/notification-admin"]
run_on_error = true

}

after_hook "cleanup-admin" {
commands = ["apply", "plan"]
execute = ["rm", "-rfd", "/var/tmp/notification-admin"]
run_on_error = true
}

}

include {
Expand Down
13 changes: 13 additions & 0 deletions env/staging/common/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
terraform {
source = "../../../aws//common"

before_hook "get-admin" {
commands = ["apply", "plan"]
execute = ["git", "clone","-b", "asset-update", "https://github.com/cds-snc/notification-admin.git", "/var/tmp/notification-admin"]
run_on_error = true

}

after_hook "cleanup-admin" {
commands = ["apply", "plan"]
execute = ["rm", "-rfd", "/var/tmp/notification-admin"]
run_on_error = true
}
}

include {
Expand Down
Loading