Help with the Cloud Posse build-harness https://github.com/cloudposse/build-harness
@Erik Osterman (Cloud Posse) has joined the channel
@Andriy Knysh (Cloud Posse) has joined the channel
@Igor just created this channel
@Igor has joined the channel
@Andriy Knysh (Cloud Posse) said you have some problems with the
build-harness when running
I’d like to help triage
Yes, thank you. The readme is generated but without terraform output. ie docs/terraform.md is empty.
I had similar issue (variables/outputs not generated). It was an old version of
gomplate in PATH
removed it, and then
make readme/deps installed the new version, which worked
I have no gomplate in PATH
but that was on Mac
docs/terraform.md does not have anything to do with
so we can rule that out
That’s terraform-docs, right?
docs/terraform.md is generated using the “
terraform-docs” or more accurately a shell script that wraps it and munges the terraform code (HCL2) so that it works with
i suspect there’s something we are using in that script that doesn’t work on your ubuntu distro (perhaps missing package)
this is the script we run
can you test if that script works for you?
./build-harness/bin/terraform-docs.sh md . i think
I don’t have terraform-docs in my PATH either
but it seems to be in the /vendor/ folder of the build-harness
Makefile sets the search
PATH to include the
Do I need to run make within build-harness itself?
(hides behind the tree)
not technically, you just need those things in your path
so try this:
then if you run
terraform-docs it should find it
test that that works first..
then we’ll proceed to debug
@Jeff Young has joined the channel
cannot open /bin/terraform-docs.awk
(again, just for debugging right now - none of this stuff needs to be set otherwise)
no output from terraform-docs.sh now
ok, run the script this way:
bash -x ./build-harness/bin/terraform-docs.sh md .
then we should see where it gets
+ which awk + which terraform + which terraform-docs ++ head -1 ++ terraform version + [[ Terraform v0.12.18 =~ 0\.12 ]] ++ mktemp /tmp/terraform-docs-XXXXXXXXXX + TMP_FILE=/tmp/terraform-docs-JhZVXiFB8g + awk -f ./build-harness/bin/terraform-docs.awk ./main.tf ./outputs.tf ./variables.tf ./versions.tf + terraform-docs md /tmp/terraform-docs-JhZVXiFB8g + rm -f /tmp/terraform-docs-JhZVXiFB8g
Ok, so it’s working, but appears then to be something wrong either with the awk
or the output from the awk
can you run
awk -f ./build-harness/bin/terraform-docs.awk ./main.tf ./outputs.tf ./variables.tf ./versions.tf
@roth.andy has joined the channel
we also have a couple open PRs
@cytopia has joined the channel
do any of those issues sound like they could be related to your problem?
if so, we can test that
I messed something up in my environment and now curl to get gomplate fails for me
on make readme/deps
what’s the error?
curl: (23) Failed writing body (0 != 16360)
oh, that just means the
gomplate binary is not writable
check fs permissions
all good now
trying the awk cmd, one sec
@tamsky has joined the channel
@krueger.andre has joined the channel
@cbravo has joined the channel
@daveyu has joined the channel
@oscar has joined the channel
can you download that file
then replace the awk script with that one
re-run see if it works?
if so, I’ll merge this PR
(also, i assume you can read all the
*.tf files? no perms issues, right?)
btw, @Igor which repo?
What should the expected output be for terraform-docs.awk?
I get nothing with the version above as well
the terraform variables and outputs formatted in a an old HCLv1 format
that can be read by
Here’s the issue: https://github.com/segmentio/terraform-docs/issues/62
Prerequisites Put an x into the box that applies: This issue describes a bug. This issue describes a feature request. For more information, see the Contributing Guidelines. Description With the upc…
basically we wrote an awk script to munge the HCL2 code so it could be parsed by
terraform-docs (sufficient for automatic documentation)
If I run terraform-docs directly
2019/12/17 15:58:45 At 3:26: Unknown token: 3:26 IDENT var.environment
(due to HCl2)
@Andriy Knysh (Cloud Posse) I don’t have access to my terminal ATM
can you check if you can run
readme on that project right now?
will check (but I ran it about two weeks ago)
README and terraform.md generated
IDENT error usually happens when you mix different TF versions of TF binary and the module version
e.g. try to use TF 0.12 version of the module with TF 0.11 binary
or other way around
Looks like terraform-docs doesn’t support HCL2
I don’t know enough about awk to troubleshoot why it’s failing, but it’d be great to figure it out so others don’t get stuck with the same problem
@Andriy Knysh (Cloud Posse) can you confirm that you can reproduce?
I think it’s just me
I’ll try to find time to debug it on my own
Weird! Something else though I was thinking is we should just run build harness inside of Docker
And eliminate these issues
We already have the container
And already do this in our other pipelines
I am guessing if I run geodesic, it would be more likely to work as well, right?
yes try in
and yes, I tried it many times, works (with TF 0.12 binary and 0.12 version of the module,
@Taylor has joined the channel
@Roderik van der Veer has joined the channel
@Taras has joined the channel
@Kostis (Codefresh) has joined the channel
@Eugene has joined the channel
@osirisx.tls_cloudposs has joined the channel
@curious deviant has joined the channel
@Can Kutlu Kinay has joined the channel