This commit is contained in:
Nikita Sorokin
2023-09-28 16:08:15 +03:00
parent 739289fbb8
commit 83ca627cea
44 changed files with 1994 additions and 123 deletions

View File

@@ -27,18 +27,19 @@ arch=$(basename $filename | cut -d '_' -f 4)
plugins_dir=~/.terraform.d/plugins/
provider_path=basis/decort/decort/$version/$os\_$arch/
print_success () {
echo "DECORT provider version $version has been successfully installed"
echo "\n"
echo "Copy this provider configuration to main.tf file"
echo "terraform {"
echo " required_providers {"
echo " decort = {"
echo " version = \"$version\""
echo " source = \"basis/decort/decort\""
echo " }"
echo " }"
echo "}"
print_info () {
cat <<EOF
Copy this provider configuration to main.tf file
terraform {
required_providers {
decort = {
version = "$version"
source = "basis/decort/decort"
}
}
}
EOF
}
install () {
@@ -47,15 +48,17 @@ install () {
echo "Provider directory already exists, checking for decort provider executable.."
if [[ ! "$(ls -A $plugins_dir$provider_path)" ]]; then
cp bin/terraform-provider-decort_$version\_$os\_$arch $plugins_dir$provider_path/terraform-provider-decort
print_success
print_info
else
echo "DECORT provider version $version is already installed. Exiting.."
print_info
fi
else
echo "Creating provider directory.."
mkdir -p $plugins_dir/$provider_path
cp bin/terraform-provider-decort_$version\_$os\_$arch $plugins_dir$provider_path/terraform-provider-decort
print_success
echo "DECORT provider version $version has been successfully installed"
print_info
fi
}