Skip to content

Instantly share code, notes, and snippets.

@sebbrandt87
Created July 22, 2019 13:32
Show Gist options
  • Save sebbrandt87/0b62ac6bc9a9b1362319f313c9e1a824 to your computer and use it in GitHub Desktop.
Save sebbrandt87/0b62ac6bc9a9b1362319f313c9e1a824 to your computer and use it in GitHub Desktop.
Updated inputs for terraform dcos-docs
for i in ./pages/install-include/*-inputs*; do (
CURDIR=${PWD}
echo "${PWD}"/${i};
cd ${HOME}/src/github.com/dcos-terraform/terraform-$(basename ${i} | sed -E "s/-.*//")-dcos/
IFS=$'\n' FILES=($(egrep -H -r '^(variable \")' *.tf | cut -d: -f1 | uniq | gsed 's/:.*//'));
for j in $FILES; do
VARFILES="${VARFILES} ${HOME}/src/github.com/dcos-terraform/terraform-$(basename ${i} | sed -E "s/-.*//")-dcos/${j}"
done;
cd ${CURDIR};
echo "Here is a list of all the variables that are currently supported on the Universal Installer and available for you to customize your cluster." > ${i}
/bin/sh -c "terraform-docs --sort-inputs-by-required --with-aggregate-type-defaults md ${VARFILES} >> ${i}"
); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment