Skip to content

Commit

Permalink
CCM-7357: Run CLI branch deployment job during apply
Browse files Browse the repository at this point in the history
  • Loading branch information
m-houston committed Nov 13, 2024
1 parent eb3a817 commit cd36578
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions infrastructure/terraform/components/app/amplify_branch_deploy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "null_resource" "amplify_branch_deploy" {
# Using triggers to force execution on every apply
triggers = {
always_run = timestamp()
}

depends_on = [module.amplify_branch]

provisioner "local-exec" {
command = "aws amplify start-job --app-id ${aws_amplify_app.main.id} --branch-name ${var.branch_name} --commit-message \"${replace(var.deployment_description, "\"", "\\\"")}\" --commit-id ${var.commit_id} --job-type RELEASE"
}
}
14 changes: 13 additions & 1 deletion infrastructure/terraform/components/app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,20 @@ variable "branch_name" {
default = "main"
}

variable "commit_id" {
type = string
description = "The commit to deploy. Must be in the tree for branch_name"
default = "HEAD"
}

variable "deployment_description" {
type = string
description = "A message describing the deployment"
default = "Deploy HEAD"
}

variable "disable_content" {
type = string
description = "Value for turning switching disable conten true/false"
description = "Value for turning switching disable content true/false"
default = "false"
}

0 comments on commit cd36578

Please sign in to comment.