From 7dcfbe46b8114702c74b354792213280ad6a9d0d Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 26 Feb 2020 10:44:10 +0300 Subject: [PATCH 1/5] Added Bazel for Windows --- .../win/scripts/Installers/Install-Bazel.ps1 | 6 +++++ .../win/scripts/Installers/Validate-Bazel.ps1 | 23 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 images/win/scripts/Installers/Install-Bazel.ps1 create mode 100644 images/win/scripts/Installers/Validate-Bazel.ps1 diff --git a/images/win/scripts/Installers/Install-Bazel.ps1 b/images/win/scripts/Installers/Install-Bazel.ps1 new file mode 100644 index 000000000..1973c06f6 --- /dev/null +++ b/images/win/scripts/Installers/Install-Bazel.ps1 @@ -0,0 +1,6 @@ +################################################################################ +## File: Install-Bazel.ps1 +## Desc: Install Bazel +################################################################################ + +choco install bazel -y \ No newline at end of file diff --git a/images/win/scripts/Installers/Validate-Bazel.ps1 b/images/win/scripts/Installers/Validate-Bazel.ps1 new file mode 100644 index 000000000..71af7df72 --- /dev/null +++ b/images/win/scripts/Installers/Validate-Bazel.ps1 @@ -0,0 +1,23 @@ +################################################################################ +## File: Validate-Bazel.ps1 +## Desc: Validate Bazel +################################################################################ + +if (Get-Command -Name 'bazel') +{ + Write-Host "bazel on path" +} +else +{ + Write-Host 'bazel is not on path' + exit 1 +} + +# Adding description of the software to Markdown +$SoftwareName = "bazel" + +$Description = @" +_Version:_ $(bazel --version)
+"@ + +Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description \ No newline at end of file From ce5225acf89575f77ac6d462c7d4bd786d6b0c5f Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 26 Feb 2020 10:53:26 +0300 Subject: [PATCH 2/5] Added Bazel for Linux --- images/linux/scripts/installers/bazel.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 images/linux/scripts/installers/bazel.sh diff --git a/images/linux/scripts/installers/bazel.sh b/images/linux/scripts/installers/bazel.sh new file mode 100644 index 000000000..718557453 --- /dev/null +++ b/images/linux/scripts/installers/bazel.sh @@ -0,0 +1,23 @@ +#!/bin/bash +################################################################################ +## File: bazel.sh +## Desc: Installs bazel +################################################################################ + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/document.sh + +# Install bazel +apt-get update -y +apt-get install -y bazel + +# 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 bazel; then + echo "Bazel was not installed" + exit 1 +fi + +# Document what was added to the image +echo "Lastly, documenting what we added to the metadata file" +DocumentInstalledItem "Bazel ($(bazel version))" From f585d8019ed150441136126d0764163683f3a651 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 26 Feb 2020 11:08:18 +0300 Subject: [PATCH 3/5] Updated JSON files --- images/linux/ubuntu1604.json | 1 + images/win/Windows2016-Azure.json | 12 ++++++++++++ images/win/Windows2019-Azure.json | 12 ++++++++++++ 3 files changed, 25 insertions(+) diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index ae2ac159e..d35f36241 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -123,6 +123,7 @@ "{{template_dir}}/scripts/installers/azcopy.sh", "{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-devops-cli.sh", + "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/1604/basic.sh", "{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/build-essential.sh", diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 60d72a9d3..fd0ff6108 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -564,6 +564,12 @@ "{{ template_dir }}/scripts/Installers/Install-Kind.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Bazel.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "30m" @@ -831,6 +837,12 @@ "{{ template_dir }}/scripts/Installers/Validate-Kind.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1" + ] + }, { "type": "file", "source": "C:\\InstalledSoftware.md", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 15ed7cb83..5ded226e6 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -533,6 +533,12 @@ "{{ template_dir }}/scripts/Installers/Install-Kind.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Bazel.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "10m" @@ -800,6 +806,12 @@ "{{ template_dir }}/scripts/Installers/Validate-Kind.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1" + ] + }, { "type": "file", "source": "C:\\InstalledSoftware.md", From a10ed67087d683bd454278b7454bbb3825221b5c Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 26 Feb 2020 11:16:49 +0300 Subject: [PATCH 4/5] Fixed script for linux and updated ubuntu1804.json file --- images/linux/scripts/installers/bazel.sh | 1 - images/linux/ubuntu1804.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/bazel.sh b/images/linux/scripts/installers/bazel.sh index 718557453..a3bc027e2 100644 --- a/images/linux/scripts/installers/bazel.sh +++ b/images/linux/scripts/installers/bazel.sh @@ -8,7 +8,6 @@ source $HELPER_SCRIPTS/document.sh # Install bazel -apt-get update -y apt-get install -y bazel # Run tests to determine that the software installed as expected diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 3c7ce3279..a75a92b2c 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -126,6 +126,7 @@ "{{template_dir}}/scripts/installers/azcopy.sh", "{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-devops-cli.sh", + "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/1804/basic.sh", "{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/build-essential.sh", From fd86f55d9fa325c8b7520757c1a76f9620fa812f Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Thu, 27 Feb 2020 11:23:42 +0300 Subject: [PATCH 5/5] Fixed script --- images/linux/scripts/installers/bazel.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images/linux/scripts/installers/bazel.sh b/images/linux/scripts/installers/bazel.sh index a3bc027e2..fcc8f03dd 100644 --- a/images/linux/scripts/installers/bazel.sh +++ b/images/linux/scripts/installers/bazel.sh @@ -8,6 +8,9 @@ source $HELPER_SCRIPTS/document.sh # Install bazel +curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - +echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list +apt-get update -y apt-get install -y bazel # Run tests to determine that the software installed as expected