2019-10-31 16:05:06 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-09-24 14:02:12 +00:00
|
|
|
# Bash 3 compatible for Darwin
|
2019-10-31 16:05:06 +00:00
|
|
|
|
2020-09-24 14:02:12 +00:00
|
|
|
# Version of Pulumi from
|
|
|
|
# https://www.pulumi.com/docs/get-started/install/versions/
|
2021-04-11 14:51:06 +00:00
|
|
|
VERSION="2.24.1"
|
2019-10-31 16:05:06 +00:00
|
|
|
|
2020-09-24 14:02:12 +00:00
|
|
|
# Grab latest release ${VERSION} from
|
|
|
|
# https://github.com/pulumi/pulumi-${NAME}/releases
|
2019-10-31 16:05:06 +00:00
|
|
|
plugins=(
|
2021-04-11 14:51:06 +00:00
|
|
|
"auth0=1.10.0"
|
|
|
|
"aws=3.36.0"
|
2021-03-20 20:58:20 +00:00
|
|
|
"cloudflare=2.14.2"
|
|
|
|
"consul=2.9.1"
|
|
|
|
"datadog=2.17.1"
|
2021-04-11 14:51:06 +00:00
|
|
|
"digitalocean=3.7.0"
|
2021-03-20 20:58:20 +00:00
|
|
|
"docker=2.9.1"
|
2021-04-11 14:51:06 +00:00
|
|
|
"gcp=4.19.0"
|
|
|
|
"github=3.4.0"
|
2021-03-20 20:58:20 +00:00
|
|
|
"gitlab=3.8.1"
|
|
|
|
"hcloud=0.7.1"
|
|
|
|
"kubernetes=2.8.3"
|
|
|
|
"mailgun=2.5.1"
|
|
|
|
"mysql=2.5.1"
|
|
|
|
"openstack=2.17.1"
|
2020-12-04 19:45:53 +00:00
|
|
|
"packet=3.2.2"
|
2021-04-11 14:51:06 +00:00
|
|
|
"postgresql=2.9.0"
|
2021-03-20 20:58:20 +00:00
|
|
|
"random=3.1.1"
|
|
|
|
"vault=3.5.1"
|
|
|
|
"vsphere=2.13.1"
|
2021-01-18 14:51:36 +00:00
|
|
|
)
|
2019-10-31 16:05:06 +00:00
|
|
|
|
|
|
|
function genMainSrc() {
|
|
|
|
local url="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-$1-x64.tar.gz"
|
|
|
|
local sha256
|
|
|
|
sha256=$(nix-prefetch-url "$url")
|
|
|
|
echo " {"
|
|
|
|
echo " url = \"${url}\";"
|
|
|
|
echo " sha256 = \"$sha256\";"
|
|
|
|
echo " }"
|
|
|
|
}
|
|
|
|
|
|
|
|
function genSrcs() {
|
2020-07-13 22:16:00 +00:00
|
|
|
for plugVers in "${plugins[@]}"; do
|
|
|
|
local plug=${plugVers%=*}
|
|
|
|
local version=${plugVers#*=}
|
2019-10-31 16:05:06 +00:00
|
|
|
# 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-amd64.tar.gz"
|
|
|
|
local sha256
|
|
|
|
sha256=$(nix-prefetch-url "$url")
|
|
|
|
echo " {"
|
|
|
|
echo " url = \"${url}\";"
|
|
|
|
echo " sha256 = \"$sha256\";"
|
|
|
|
echo " }"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-02-27 12:27:31 +00:00
|
|
|
{
|
|
|
|
cat <<EOF
|
2019-10-31 16:05:06 +00:00
|
|
|
# DO NOT EDIT! This file is generated automatically by update.sh
|
|
|
|
{ }:
|
|
|
|
{
|
|
|
|
version = "${VERSION}";
|
|
|
|
pulumiPkgs = {
|
|
|
|
x86_64-linux = [
|
|
|
|
EOF
|
2021-02-27 12:27:31 +00:00
|
|
|
genMainSrc "linux"
|
|
|
|
genSrcs "linux"
|
|
|
|
echo " ];"
|
|
|
|
echo " x86_64-darwin = ["
|
2019-10-31 16:05:06 +00:00
|
|
|
|
2021-02-27 12:27:31 +00:00
|
|
|
genMainSrc "darwin"
|
|
|
|
genSrcs "darwin"
|
|
|
|
echo " ];"
|
|
|
|
echo " };"
|
|
|
|
echo "}"
|
|
|
|
} > data.nix
|