Develop a "factory" mode to use with the gcp-product-factory project
The gcp-product-factory repo currently uses a custom run-product-factory.sh script to execute logan. This is useful given the per-product nature of the gcp-product-factory Terraform config. Namely in that it uses Terraform's partial backend configuration and per-product .tfvars files to separate each invocation of Terraform to a specific product. It also uses per-product docker volumes via the --terraform-data-volume-name arg to separate the .terraform folder/files for each product run.
The equivalent logan commands are not pretty and require quite a bit of typing. For example:
# Init and run a plan against the example product using run-product-factory.sh
./run-product-factory.sh -p product-vars/example -i plan
# Init and run a plan against the example product using logan directly
logan --workspace default --rm-terraform-data-volume --terraform-data-volume-name "gcp-product-factory_example" terraform init "--backend-config=./product-vars/example/example.tfbackend"
logan --workspace default --terraform-data-volume-name "gcp-product-factory_example" terraform plan "--var-file=./product-vars/example/example.tfvars"
This issue is to incorporate the ability for logan to run in a "factory" mode, replicating the functionality provided in ./run-product-factory.sh natively. This would also be handy in the upcoming gitlab-project-factory project which also proposes using partial backend configuration and per-product tfvars files. This is becoming more of a priority now so that we don't end up with multiple versions of these run scripts.