From 44f5e1203c73ebbc2af167493acd56edc445fb7e Mon Sep 17 00:00:00 2001 From: Kai Hendry Date: Fri, 29 Jul 2022 15:18:38 +0800 Subject: [PATCH] Git version in a tag! --- .terraform.lock.hcl | 30 +++++++++++++++--------------- git-describe.sh | 2 ++ init.tf | 5 +++++ 3 files changed, 22 insertions(+), 15 deletions(-) create mode 100755 git-describe.sh diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl index e7cb815..940f478 100644 --- a/.terraform.lock.hcl +++ b/.terraform.lock.hcl @@ -40,22 +40,22 @@ provider "registry.terraform.io/hashicorp/cloudinit" { ] } -provider "registry.terraform.io/hashicorp/helm" { - version = "2.6.0" +provider "registry.terraform.io/hashicorp/external" { + version = "2.2.2" hashes = [ - "h1:rGVucCeYAqklKupwoLVG5VPQTIkUhO7WGcw3WuHYrm8=", - "zh:0ac248c28acc1a4fd11bd26a85e48ab78dd6abf0f7ac842bf1cd7edd05ac6cf8", - "zh:3d32c8deae3740d8c5310136cc11c8afeffc350fbf88afaca0c34a223a5246f5", - "zh:4055a27489733d19ca7fa2dfce14d323fe99ae9dede7d0fea21ee6db0b9ca74b", - "zh:58a8ed39653fd4c874a2ecb128eccfa24c94266a00e349fd7fb13e22ad81f381", - "zh:6c81508044913f25083de132d0ff81d083732aba07c506cc2db05aa0cefcde2c", - "zh:7db5d18093047bfc4fe597f79610c0a281b21db0d61b0bacb3800585e976f814", - "zh:8269207b7422db99e7be80a5352d111966c3dfc7eb98511f11c8ff7b2e813456", - "zh:b1d7ababfb2374e72532308ff442cc906b79256b66b3fe7a98d42c68c4ddf9c5", - "zh:ca63e226cbdc964a5d63ef21189f059ce45c3fa4a5e972204d6916a9177d2b44", - "zh:d205a72d60e8cc362943d66f5bcdd6b6aaaa9aab2b89fd83bf6f1978ac0b1e4c", - "zh:db47dc579a0e68e5bfe3a61f2e950e6e2af82b1f388d1069de014a937962b56a", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + "h1:e7RpnZ2PbJEEPnfsg7V0FNwbfSk0/Z3FdrLsXINBmDY=", + "zh:0b84ab0af2e28606e9c0c1289343949339221c3ab126616b831ddb5aaef5f5ca", + "zh:10cf5c9b9524ca2e4302bf02368dc6aac29fb50aeaa6f7758cce9aa36ae87a28", + "zh:56a016ee871c8501acb3f2ee3b51592ad7c3871a1757b098838349b17762ba6b", + "zh:719d6ef39c50e4cffc67aa67d74d195adaf42afcf62beab132dafdb500347d39", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:7fbfc4d37435ac2f717b0316f872f558f608596b389b895fcb549f118462d327", + "zh:8ac71408204db606ce63fe8f9aeaf1ddc7751d57d586ec421e62d440c402e955", + "zh:a4cacdb06f114454b6ed0033add28006afa3f65a0ea7a43befe45fc82e6809fb", + "zh:bb5ce3132b52ae32b6cc005bc9f7627b95259b9ffe556de4dad60d47d47f21f0", + "zh:bb60d2976f125ffd232a7ccb4b3f81e7109578b23c9c6179f13a11d125dca82a", + "zh:f9540ecd2e056d6e71b9ea5f5a5cf8f63dd5c25394b9db831083a9d4ea99b372", + "zh:ffd998b55b8a64d4335a090b6956b4bf8855b290f7554dd38db3302de9c41809", ] } diff --git a/git-describe.sh b/git-describe.sh new file mode 100755 index 0000000..b2a650a --- /dev/null +++ b/git-describe.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo { \"version\": \"$(git describe --tags --always --dirty)\"} diff --git a/init.tf b/init.tf index 9a99dd7..f0244ac 100644 --- a/init.tf +++ b/init.tf @@ -6,11 +6,16 @@ terraform { } } +data "external" "git_describe" { + program = ["${path.module}/git-describe.sh"] +} + provider "aws" { region = local.region default_tags { tags = { Source = "https://github.com/kaihendry/hello-eks" + Version = data.external.git_describe.result["version"] } } }