Skip to content

Make `gitlab-terraform` script sourceable

Timo Furrer requested to merge make-sourceable into master

This change set makes the gitlab-terraform sourceable, as-in:

source gitlab-terraform.sh

or

source /usr/bin/gitlab-terraform

If the script is being sourced no Terraform command is executed.

However, the entire configuration setup via environment variables is being performed. This allows users to use their own tooling, e.g. terragrunt or run very specialized commands or command sequences which otherwise wouldn't be supported.

Implementations to check if a script is being sourced or not are never 100% bullet proof (see https://stackoverflow.com/a/28776166) - the current implementation is kinda solid though.

Closes: #51 (closed) #52 (closed) #27 (closed)

Edited by Timo Furrer

Merge request reports