From 7eed5ae558c26af23a8cd0d238a672af7b1cb82e Mon Sep 17 00:00:00 2001 From: Leonid Lapshin Date: Fri, 28 Aug 2020 10:35:11 +0300 Subject: [PATCH] Add Pulumi to Ubuntu images (#1428) * Add Pulumi to ubuntu images * remove Pulumi from docs because it is auto-documented * change Pulumi installation script * removed legacy install, use /tmp, change auto-documentation, use download function instead of curl * include install.sh to Pulumi's installation script Co-authored-by: Leonid Lapshin --- images/linux/scripts/installers/pulumi.sh | 26 +++++++++++++++++++++++ images/linux/ubuntu1604.json | 1 + images/linux/ubuntu1804.json | 1 + images/linux/ubuntu2004.json | 1 + 4 files changed, 29 insertions(+) create mode 100644 images/linux/scripts/installers/pulumi.sh diff --git a/images/linux/scripts/installers/pulumi.sh b/images/linux/scripts/installers/pulumi.sh new file mode 100644 index 00000000..e041c2b7 --- /dev/null +++ b/images/linux/scripts/installers/pulumi.sh @@ -0,0 +1,26 @@ +#!/bin/bash +################################################################################ +## File: pulumi.sh +## Desc: Installs Pulumi +################################################################################ + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/document.sh +source $HELPER_SCRIPTS/install.sh + +# Install Pulumi +VERSION=$(curl --fail --silent -L "https://www.pulumi.com/latest-version") +TARBALL_URL="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-linux-x64.tar.gz" +download_with_retries ${TARBALL_URL} "/tmp" pulumi-v${VERSION}.tar.gz +tar --strip=1 -xvf /tmp/pulumi-v${VERSION}.tar.gz -C /usr/local/bin + +# Run tests to determine that the software installed as expected +echo "Testing to make sure that script performed as expected, and basic scenarios work" +if ! command -v pulumi ; then + echo "Pulumi was not installed" + exit 1 +fi + +# Document what was added to the image +echo "Lastly, documenting what we added to the metadata file" +DocumentInstalledItem "Pulumi $(pulumi version)" diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 4a5c5be1..3625b7ed 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -181,6 +181,7 @@ "{{template_dir}}/scripts/installers/pollinate.sh", "{{template_dir}}/scripts/installers/postgresql.sh", "{{template_dir}}/scripts/installers/powershellcore.sh", + "{{template_dir}}/scripts/installers/pulumi.sh", "{{template_dir}}/scripts/installers/ruby.sh", "{{template_dir}}/scripts/installers/r.sh", "{{template_dir}}/scripts/installers/rust.sh", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 91f468f3..b5037520 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -185,6 +185,7 @@ "{{template_dir}}/scripts/installers/pollinate.sh", "{{template_dir}}/scripts/installers/postgresql.sh", "{{template_dir}}/scripts/installers/powershellcore.sh", + "{{template_dir}}/scripts/installers/pulumi.sh", "{{template_dir}}/scripts/installers/ruby.sh", "{{template_dir}}/scripts/installers/r.sh", "{{template_dir}}/scripts/installers/rust.sh", diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index f3b7a68a..48d309b1 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -187,6 +187,7 @@ "{{template_dir}}/scripts/installers/pollinate.sh", "{{template_dir}}/scripts/installers/postgresql.sh", "{{template_dir}}/scripts/installers/powershellcore.sh", + "{{template_dir}}/scripts/installers/pulumi.sh", "{{template_dir}}/scripts/installers/ruby.sh", "{{template_dir}}/scripts/installers/r.sh", "{{template_dir}}/scripts/installers/rust.sh",