diff options
author | Wael M. Nasreddine <wael.nasreddine@gmail.com> | 2018-09-18 20:24:21 -0700 |
---|---|---|
committer | Wael M. Nasreddine <wael.nasreddine@gmail.com> | 2018-09-27 09:51:35 -0700 |
commit | cc481ceddae0727289fb76610bbbca909488bd44 (patch) | |
tree | f106b7f031b343a08f098d3aaa4e3c30a483686f /pkgs/applications/networking/cluster/terraform/providers | |
parent | f95c18f3d151eca3876abf8b30dc808658b2c9a8 (diff) | |
download | nixlib-cc481ceddae0727289fb76610bbbca909488bd44.tar nixlib-cc481ceddae0727289fb76610bbbca909488bd44.tar.gz nixlib-cc481ceddae0727289fb76610bbbca909488bd44.tar.bz2 nixlib-cc481ceddae0727289fb76610bbbca909488bd44.tar.lz nixlib-cc481ceddae0727289fb76610bbbca909488bd44.tar.xz nixlib-cc481ceddae0727289fb76610bbbca909488bd44.tar.zst nixlib-cc481ceddae0727289fb76610bbbca909488bd44.zip |
terraform: update-all: add support for parsing list of providers in providers.txt
Diffstat (limited to 'pkgs/applications/networking/cluster/terraform/providers')
3 files changed, 75 insertions, 31 deletions
diff --git a/pkgs/applications/networking/cluster/terraform/providers/data.nix b/pkgs/applications/networking/cluster/terraform/providers/data.nix index 508f0658354e..fead9af601f7 100644 --- a/pkgs/applications/networking/cluster/terraform/providers/data.nix +++ b/pkgs/applications/networking/cluster/terraform/providers/data.nix @@ -11,8 +11,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-alicloud"; - version = "1.16.0"; - sha256 = "10v6g25wna63nay0ac3l31qbwdb8bs4vj6d1dr2kqzfqqmw9wnna"; + version = "1.17.0"; + sha256 = "1zmywmcgfmx5ccp0qxj912sqymisxdg2s84b4qclfa225hrbaqpn"; }; archive = { @@ -39,8 +39,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-aws"; - version = "1.36.0"; - sha256 = "10lcdi609fa4q5xmqxp0vjb4ajqxvkhn61h7bfcc6syhpm20hdj1"; + version = "1.38.0"; + sha256 = "1jhr2l8p7wf7kgr2y0c40n1jb9p2153xkpcp4b2half2vhsh1nwi"; }; azurerm = { @@ -56,6 +56,13 @@ version = "0.4.0"; sha256 = "1c9am0v4aq95k1jblc767vykk76dp0d6z2fvy148ag77cy2jgryc"; }; + bigip = + { + owner = "terraform-providers"; + repo = "terraform-provider-bigip"; + version = "0.12.0"; + sha256 = "0fmmlx757hph45ffm19zafjfkldg41qkw83vz0jjmvxicza1afbd"; + }; bitbucket = { owner = "terraform-providers"; @@ -81,8 +88,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-circonus"; - version = "0.1.0"; - sha256 = "0v05g91yg2zh4wczp8mi3hmvwb35z0y9044bwy67nm1l624xlj64"; + version = "0.1.1"; + sha256 = "05n1q9hc0h31icxsmyi2y60wiwd5fs2hz1dqm3bl6hgh5x3ss1im"; }; clc = { @@ -95,8 +102,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-cloudflare"; - version = "1.4.0"; - sha256 = "17ajzm0m73lrp14ikabg26s9gj1dbh23a34231dwv9zqqky93dn7"; + version = "1.5.0"; + sha256 = "0l8bmnxmjr2g3xxw8w0ay91cvs4kzc65wkdwybfahvq9r6mww45n"; }; cloudscale = { @@ -130,8 +137,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-datadog"; - version = "1.2.0"; - sha256 = "1hr3zsisyv04b0skl3v7ghycz3ac2dqkn47qjszmkdg5vvy8dh0g"; + version = "1.3.0"; + sha256 = "0d3xccfkzibjp4jl8irja1cdhppdn3b7nh4wy857zvfxpfhz7aj2"; }; digitalocean = { @@ -249,8 +256,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-huaweicloud"; - version = "1.1.0"; - sha256 = "1jsvv5yfxgz998p4wbldbq82hl4ykn1yp21igphl94n3b0jj33dj"; + version = "1.2.0"; + sha256 = "0r05dfgpzci0lpc2ivbrj6ivib8svbks9612by3w3zakzclpv467"; }; icinga2 = { @@ -368,8 +375,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-oci"; - version = "3.0.0"; - sha256 = "08p13yzc3h8xng77ia3x4lmar8k6860gkx6w16ccw311ndzl586h"; + version = "3.1.1"; + sha256 = "0wrvb44gs0c1khvam5lrq53l2889japg7d4nyk2hrpywy9japc8m"; }; oneandone = { @@ -410,8 +417,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-oraclepaas"; - version = "1.3.1"; - sha256 = "1vyqkxq3c98gfpshr1zz4y91jfblnyzrbzwr40dsc6r9b6jlbwqa"; + version = "1.3.2"; + sha256 = "138522cidaiy2akqqblik3w6qnx8zgn70ih7am1sxn13vqm1vlhb"; }; ovh = { @@ -483,6 +490,13 @@ version = "2.0.0"; sha256 = "0plg139pbvqwbs5hcl7d5kjn7vwknjr4n0ysc2j5s25iyhikkv9s"; }; + rightscale = + { + owner = "terraform-providers"; + repo = "terraform-provider-rightscale"; + version = "1.3.0"; + sha256 = "1brzxyd5hg99x75qh0p707lr9cvqpzx2az1swr624w3rzhjl2ygm"; + }; rundeck = { owner = "terraform-providers"; @@ -494,8 +508,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-runscope"; - version = "0.3.0"; - sha256 = "1srnnlw94q1av8rzy8753fk4vazv5ldbimgr9gd51vrmpvmlgxas"; + version = "0.4.0"; + sha256 = "1n3q2hdwvkkn5rphrcl5qfv4ry2mrr13dcjwzhbym2i1nhpxkld0"; }; scaleway = { @@ -550,8 +564,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-tfe"; - version = "0.1.0"; - sha256 = "1mzrp2yk2w8clqkydkz761vj5spgb2n79yi3ng85rkqvchzamsh5"; + version = "0.2.0"; + sha256 = "1d3yiaxmmlnnjmx6vnckvdnqgyxakc9i70dgxdbn8ihw5i6anvik"; }; tls = { @@ -578,8 +592,8 @@ { owner = "terraform-providers"; repo = "terraform-provider-vault"; - version = "1.1.3"; - sha256 = "1aq82w4g3hdvb3ba86fisjc2lqbzsymn2q2kni8cyqvwhcxk1r4c"; + version = "1.1.4"; + sha256 = "00i9rl9pnmicvndkmvcmlj6y80341dmkqnhq09f94yljh1w1zpvv"; }; vcd = { diff --git a/pkgs/applications/networking/cluster/terraform/providers/providers.txt b/pkgs/applications/networking/cluster/terraform/providers/providers.txt new file mode 100644 index 000000000000..d0c4a6505981 --- /dev/null +++ b/pkgs/applications/networking/cluster/terraform/providers/providers.txt @@ -0,0 +1,13 @@ +# lines starting with a # are comments + +# The accepted format (double escape all grep expresssions): +# <organisation> [grep-expression] [grep-v-expression] - include all repositories in the organisation. +# grep-expression: filter repo matching the expression +# grep-v-expression: filter repo not matching the expression +# <organisation>/<repo> - include only the named repository. + +# include all terraform-providers +terraform-providers terraform-provider- terraform-provider-\\(azure-classic\\|scaffolding\\|google-beta\\) + +# include terraform-provider-nixos +tweag/terraform-provider-nixos diff --git a/pkgs/applications/networking/cluster/terraform/providers/update-all b/pkgs/applications/networking/cluster/terraform/providers/update-all index ac005c5f59e9..2009d474db7b 100755 --- a/pkgs/applications/networking/cluster/terraform/providers/update-all +++ b/pkgs/applications/networking/cluster/terraform/providers/update-all @@ -4,7 +4,7 @@ # # This scripts scans the github terraform-providers repo for new releases, # generates the corresponding nix code and finally generates an index of -# all the providers. +# all the providers given in ./providers.txt. set -euo pipefail # the maximum number of attempts before giving up inside of GET and prefetch_github @@ -109,15 +109,32 @@ cat <<HEADER > data.nix { HEADER -# add all the repos under the terraform-providers organisation -org=terraform-providers -repos=$(get_org_repos "$org" | grep terraform-provider- | grep -v terraform-provider-scaffolding | grep -v terraform-provider-azure-classic | sort) -for repo in $repos; do - add_repo "$org" "$repo" -done +while read line; do + IFS=' ' read -r -a fields <<< "$line" + if [[ "${#fields[@]}" -eq 0 ]]; then + continue + fi + + if [[ "${fields[0]}" = *"/"* ]]; then + org="$(echo "${fields[0]}" | cut -d/ -f1)" + repo="$(echo "${fields[0]}" | cut -d/ -f2)" + add_repo "${org}" "${repo}" + else + org="${fields[0]}" + repos=$(get_org_repos "$org") + if [[ "${#fields[@]}" -ge 2 ]] && [[ -n "${fields[1]}" ]]; then + repos="$( echo "${repos[@]}" | grep "${fields[1]}" )" + fi + if [[ "${#fields[@]}" -eq 3 ]] && [[ -n "${fields[2]}" ]]; then + repos="$( echo "${repos[@]}" | grep -v "${fields[2]}" )" + fi + repos="$( echo "${repos[@]}" | sort )" -# add the repos that live outside of terraform-providers -add_repo tweag terraform-provider-nixos + for repo in $repos; do + add_repo "$org" "$repo" + done + fi +done < <(grep -v '^#\|^$' providers.txt) cat <<FOOTER >> data.nix } |