sudokar / generator-tf-module

Project scaffolding for Terraform
https://github.com/sudokar/generator-tf-module
MIT License
264 stars 29 forks source link

Automate build-image.sh goodness #12

Closed wesley-dean-flexion closed 4 years ago

wesley-dean-flexion commented 4 years ago

There were a few things in the docker/build-image.sh that I wanted to update; feel free to accept or reject this PR.

FIRST: note that this adds a requirement for jq which is a tool for querying JSON. This requirement is only needed for extracting two values used when building the image; most users of the image will never see or need it.

So, I was testing some stuff and I wanted to tag the image differently, so I made the OWNER a variable with a default value of 'sudokar'; however, I can now build the image with a different owner's name:

OWNER=wesleydean ./build-image.sh

Next, the VERSION was hard-coded in build-image.sh so I used jq to query it out of ../package.json

I then extended the same treatment to NAME -- allow the caller to specify a value and default back to the value extracted from ../package.json.

Finally, I allowed the user to specify values for BUILD_DATE and VCS_REF with default values acquired the way the normally are (capturing output from date and git rev-parse, respectively).

sudokar commented 4 years ago

@wesley-dean-flexion Happy to merge this in. Can you please resolve conflicts when you find sometime

wesley-dean-flexion commented 4 years ago

Whoops. Sorry about that! I'll get to them pretty soon, hopefully this evening.

sudokar commented 4 years ago

Whoops. Sorry about that! I'll get to them pretty soon, hopefully this evening.

No worries, I should have been because my recent commits

wesley-dean-flexion commented 4 years ago

@sudokar Good afternoon. I've resolved the merge conflict and this should be good to go now.

sudokar commented 4 years ago

@wesley-dean-flexion Thanks for resolving conflicts and fantastic work on the docker build script 👏