3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/admin/pulumi/update.sh

98 lines
2.3 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2020-09-24 15:02:12 +01:00
# Bash 3 compatible for Darwin
2020-09-24 15:02:12 +01:00
# Version of Pulumi from
# https://www.pulumi.com/docs/get-started/install/versions/
2021-09-09 10:40:39 +01:00
VERSION="3.12.0"
2020-09-24 15:02:12 +01:00
# Grab latest release ${VERSION} from
# https://github.com/pulumi/pulumi-${NAME}/releases
plugins=(
2021-06-01 18:48:12 +01:00
"auth0=2.2.0"
2021-09-09 10:40:39 +01:00
"aws=4.19.0"
"cloudflare=3.5.0"
"consul=3.3.0"
"datadog=4.1.0"
"digitalocean=4.6.1"
"docker=3.1.0"
2021-05-24 03:01:22 +01:00
"equinix-metal=2.0.0"
2021-09-09 10:40:39 +01:00
"gcp=5.18.0"
"github=4.3.0"
"gitlab=4.2.0"
"hcloud=1.4.0"
"kubernetes=3.7.0"
"linode=3.3.2"
2021-05-24 03:01:22 +01:00
"mailgun=3.1.0"
2021-04-21 18:27:50 +01:00
"mysql=3.0.0"
2021-08-12 21:40:27 +01:00
"openstack=3.3.0"
2020-12-04 19:45:53 +00:00
"packet=3.2.2"
2021-09-09 10:40:39 +01:00
"postgresql=3.2.0"
2021-06-01 18:48:12 +01:00
"random=4.2.0"
2021-09-09 10:40:39 +01:00
"vault=4.4.0"
2021-07-29 17:33:49 +01:00
"vsphere=4.0.1"
2021-01-18 14:51:36 +00:00
)
function genMainSrc() {
local url="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-${1}-${2}.tar.gz"
local sha256
sha256=$(nix-prefetch-url "$url")
echo " {"
echo " url = \"${url}\";"
echo " sha256 = \"$sha256\";"
echo " }"
}
function genSrcs() {
2020-07-13 23:16:00 +01:00
for plugVers in "${plugins[@]}"; do
local plug=${plugVers%=*}
local version=${plugVers#*=}
# url as defined here
# https://github.com/pulumi/pulumi/blob/06d4dde8898b2a0de2c3c7ff8e45f97495b89d82/pkg/workspace/plugins.go#L197
local url="https://api.pulumi.com/releases/plugins/pulumi-resource-${plug}-v${version}-${1}-${2}.tar.gz"
local sha256
sha256=$(nix-prefetch-url "$url")
if [ "$sha256" ]; then # file exists
echo " {"
echo " url = \"${url}\";"
echo " sha256 = \"$sha256\";"
echo " }"
else
echo " # pulumi-resource-${plug} skipped (does not exist on remote)"
fi
done
}
2021-02-27 12:27:31 +00:00
{
cat <<EOF
# DO NOT EDIT! This file is generated automatically by update.sh
{ }:
{
version = "${VERSION}";
pulumiPkgs = {
EOF
echo " x86_64-linux = ["
genMainSrc "linux" "x64"
genSrcs "linux" "amd64"
2021-02-27 12:27:31 +00:00
echo " ];"
2021-02-27 12:27:31 +00:00
echo " x86_64-darwin = ["
genMainSrc "darwin" "x64"
genSrcs "darwin" "amd64"
echo " ];"
echo " aarch64-linux = ["
genMainSrc "linux" "arm64"
genSrcs "linux" "arm64"
2021-02-27 12:27:31 +00:00
echo " ];"
echo " aarch64-darwin = ["
genMainSrc "darwin" "arm64"
genSrcs "darwin" "arm64"
echo " ];"
2021-02-27 12:27:31 +00:00
echo " };"
echo "}"
2021-02-27 12:27:31 +00:00
} > data.nix