## Description
<!-- **Please link some issue here describing what you are trying to achieve.**
In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->
relates to #1234
## Checklist
- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)
Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
53 lines
935 B
Bash
Executable file
53 lines
935 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# ./tf.sh apply > >(tee -a stdout.log) 2> >(tee -a stderr.log >&2)
|
|
|
|
usage() {
|
|
echo "$0 usage:" && grep "[[:space:]].)\ #" "$0" | sed 's/#//' | sed -r 's/([a-z])\)/-\1/';
|
|
exit 0;
|
|
}
|
|
|
|
[ $# -eq 0 ] && usage
|
|
|
|
CONFIG_FOLDER=$(dirname "$0")
|
|
BINARY=terraform
|
|
|
|
ADD=""
|
|
|
|
while getopts ":b:hdirt" arg; do
|
|
case $arg in
|
|
b) # Set binary (default is terraform).
|
|
BINARY=${OPTARG}
|
|
shift 2
|
|
;;
|
|
d) # Set log level to DEBUG.
|
|
TF_LOG=DEBUG
|
|
export TF_LOG
|
|
shift
|
|
;;
|
|
i) # Set log level to INFO.
|
|
TF_LOG=INFO
|
|
export TF_LOG
|
|
shift
|
|
;;
|
|
r) # Set log level to INFO.
|
|
ADD="-refresh-only"
|
|
shift
|
|
;;
|
|
t) # Set log level to TRACE.
|
|
TF_LOG=TRACE
|
|
export TF_LOG
|
|
shift
|
|
;;
|
|
h | *) # Display help.
|
|
usage
|
|
;;
|
|
esac
|
|
done
|
|
|
|
TERRAFORM_CONFIG=${CONFIG_FOLDER}/config.tfrc
|
|
export TERRAFORM_CONFIG
|
|
|
|
${BINARY} "$@" ${ADD}
|