Created
March 24, 2023 15:56
-
-
Save hendrixroa/6abf9e1e00a6c503f53dc4df698099da to your computer and use it in GitHub Desktop.
Packaging ecr docker images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "null_resource" "docker_packaging" { | |
provisioner "local-exec" { | |
command = <<EOF | |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${data.aws_caller_identity.current.account_id}.dkr.ecr.us-east-1.amazonaws.com | |
gradle build -p noiselesstech | |
docker build -t "${aws_ecr_repository.noiselesstech.repository_url}:latest" -f noiselesstech/Dockerfile . | |
docker push "${aws_ecr_repository.noiselesstech.repository_url}:latest" | |
EOF | |
} | |
triggers = { | |
"run_at" = timestamp() | |
} | |
depends_on = [ | |
aws_ecr_repository.noiselesstech, | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment