Skip to content

Commit fc0b86f

Browse files
authored
Handling Windows paths (#1)
1 parent f67d2cf commit fc0b86f

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.0.6
4+
5+
Added escaping of local-exec command path to handle Windows paths.
6+
37
## 0.0.5
48

59
Remove region bias for push

main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
locals {
2+
module_path = replace(path.module, "\\", "/")
3+
}
4+
15
resource "null_resource" "docker_pullpush" {
26

37
triggers = {
48
shell_hash = sha256("${var.docker_source}${var.ecr_repo_name}${var.ecr_repo_tag}")
59
}
610
provisioner "local-exec" {
7-
command = "${abspath(path.module)}/docker_pullpush.sh ${var.docker_source} ${var.aws_region} ${var.aws_account_id} ${var.ecr_repo_name} ${var.ecr_repo_tag} ${var.aws_profile}"
11+
command = "${local.module_path}/docker_pullpush.sh ${var.docker_source} ${var.aws_region} ${var.aws_account_id} ${var.ecr_repo_name} ${var.ecr_repo_tag} ${var.aws_profile}"
812
}
913
}

variables.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
variable "aws_region" {
2-
description = "The region in which the ECR repository is located."
2+
description = "The region in which the ECR repository is located."
33
}
44

55
variable "docker_source" {
6-
description = "The source location of the Docker image being pulled."
6+
description = "The source location of the Docker image being pulled."
77
}
88

99
variable "aws_account_id" {
10-
description = "The AWS Account ID where the ECR repository is located."
10+
description = "The AWS Account ID where the ECR repository is located."
1111
}
1212

1313
variable "aws_profile" {
14-
description = "The awscli profile name (located in the ~/.aws/credentials file) used to authenticate the ECR login and push (Optional)"
15-
default = ""
14+
description = "The awscli profile name (located in the ~/.aws/credentials file) used to authenticate the ECR login and push (Optional)"
15+
default = ""
1616
}
1717

1818
variable "ecr_repo_name" {
19-
description = "The name of the ECR repository being pushed to."
19+
description = "The name of the ECR repository being pushed to."
2020
}
2121

2222
variable "ecr_repo_tag" {
23-
description = "The tag of the ECR repository image being pushed."
23+
description = "The tag of the ECR repository image being pushed."
2424
}

0 commit comments

Comments
 (0)