summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/networking/cluster/terraform-providers
diff options
context:
space:
mode:
authorTimothy Stott <stott.timothy@gmail.com>2020-10-06 16:17:34 +0100
committerTimothy Stott <stott.timothy@gmail.com>2020-10-08 19:01:08 +0100
commit60645f092193e815866c66b320ca8cfc89739b81 (patch)
tree08dd10da2dfba466c31581cf48046f6492ade7ac /pkgs/applications/networking/cluster/terraform-providers
parent107707ad82ac513eb49c9c0a5dbf46013b72fefb (diff)
terraform-providers: script to update all providers
Diffstat (limited to 'pkgs/applications/networking/cluster/terraform-providers')
-rwxr-xr-xpkgs/applications/networking/cluster/terraform-providers/update-all-providers22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/terraform-providers/update-all-providers b/pkgs/applications/networking/cluster/terraform-providers/update-all-providers
new file mode 100755
index 000000000000..052c56742c5f
--- /dev/null
+++ b/pkgs/applications/networking/cluster/terraform-providers/update-all-providers
@@ -0,0 +1,22 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p jq
+# shellcheck shell=bash
+
+# Update all providers which have specified provider source address
+set -euo pipefail
+
+providers=$(
+ jq -r 'to_entries
+ | map_values(.value + { alias: .key })
+ | .[]
+ | select(."provider-source-address"?)
+ | .alias' providers.json
+)
+
+echo "Will update providers:"
+echo "$providers"
+
+for provider in $providers; do
+ echo "Updating $provider"
+ ./update-provider "$provider"
+done