2020-04-24 23:36:52 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-09-25 04:45:31 +00:00
|
|
|
# Bash 3 compatible for Darwin
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Version of Pulumi from
|
|
|
|
# https://www.pulumi.com/docs/get-started/install/versions/
|
2020-12-07 07:45:13 +00:00
|
|
|
VERSION="2.15.0"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Grab latest release ${VERSION} from
|
|
|
|
# https://github.com/pulumi/pulumi-${NAME}/releases
|
2020-04-24 23:36:52 +00:00
|
|
|
plugins=(
|
2020-12-07 07:45:13 +00:00
|
|
|
"auth0=1.3.0"
|
|
|
|
"aws=3.19.0"
|
|
|
|
"cloudflare=2.8.0"
|
|
|
|
"consul=2.6.2"
|
|
|
|
"datadog=2.11.0"
|
|
|
|
"digitalocean=3.1.1"
|
|
|
|
"docker=2.4.1"
|
|
|
|
"gcp=4.4.0"
|
|
|
|
"github=2.3.0"
|
|
|
|
"gitlab=3.3.0"
|
|
|
|
"hcloud=0.4.0"
|
|
|
|
"kubernetes=2.7.3"
|
|
|
|
"mailgun=2.3.1"
|
|
|
|
"mysql=2.3.2"
|
|
|
|
"openstack=2.9.0"
|
|
|
|
"packet=3.2.2"
|
|
|
|
"postgresql=2.5.2"
|
|
|
|
"random=2.4.2"
|
|
|
|
"vault=3.1.0"
|
|
|
|
"vsphere=2.11.2"
|
2020-09-25 04:45:31 +00:00
|
|
|
);
|
2020-04-24 23:36:52 +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-18 16:06:22 +00:00
|
|
|
for plugVers in "${plugins[@]}"; do
|
|
|
|
local plug=${plugVers%=*}
|
|
|
|
local version=${plugVers#*=}
|
2020-04-24 23:36:52 +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
|
|
|
|
}
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
cat <<EOF > data.nix
|
2020-04-24 23:36:52 +00:00
|
|
|
# DO NOT EDIT! This file is generated automatically by update.sh
|
|
|
|
{ }:
|
|
|
|
{
|
|
|
|
version = "${VERSION}";
|
|
|
|
pulumiPkgs = {
|
|
|
|
x86_64-linux = [
|
|
|
|
EOF
|
2020-07-18 16:06:22 +00:00
|
|
|
genMainSrc "linux" >> data.nix
|
|
|
|
genSrcs "linux" >> data.nix
|
|
|
|
echo " ];" >> data.nix
|
|
|
|
|
|
|
|
echo " x86_64-darwin = [" >> data.nix
|
|
|
|
genMainSrc "darwin" >> data.nix
|
|
|
|
genSrcs "darwin" >> data.nix
|
|
|
|
echo " ];" >> data.nix
|
|
|
|
echo " };" >> data.nix
|
|
|
|
echo "}" >> data.nix
|
2020-04-24 23:36:52 +00:00
|
|
|
|