Merge pull request #466 from nikita-bykov/bazel-support

Add Bazel support to Linux and Windows
This commit is contained in:
Alejandro Pauly
2020-02-27 10:06:24 -05:00
committed by GitHub
7 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/bash
################################################################################
## File: bazel.sh
## Desc: Installs bazel
################################################################################
# Source the helpers for use with the script
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
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))"

View File

@@ -123,6 +123,7 @@
"{{template_dir}}/scripts/installers/azcopy.sh", "{{template_dir}}/scripts/installers/azcopy.sh",
"{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-cli.sh",
"{{template_dir}}/scripts/installers/azure-devops-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/1604/basic.sh",
"{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/aws.sh",
"{{template_dir}}/scripts/installers/build-essential.sh", "{{template_dir}}/scripts/installers/build-essential.sh",

View File

@@ -126,6 +126,7 @@
"{{template_dir}}/scripts/installers/azcopy.sh", "{{template_dir}}/scripts/installers/azcopy.sh",
"{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-cli.sh",
"{{template_dir}}/scripts/installers/azure-devops-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/1804/basic.sh",
"{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/aws.sh",
"{{template_dir}}/scripts/installers/build-essential.sh", "{{template_dir}}/scripts/installers/build-essential.sh",

View File

@@ -564,6 +564,12 @@
"{{ template_dir }}/scripts/Installers/Install-Kind.ps1" "{{ template_dir }}/scripts/Installers/Install-Kind.ps1"
] ]
}, },
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-Bazel.ps1"
]
},
{ {
"type": "windows-restart", "type": "windows-restart",
"restart_timeout": "30m" "restart_timeout": "30m"
@@ -831,6 +837,12 @@
"{{ template_dir }}/scripts/Installers/Validate-Kind.ps1" "{{ template_dir }}/scripts/Installers/Validate-Kind.ps1"
] ]
}, },
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1"
]
},
{ {
"type": "file", "type": "file",
"source": "C:\\InstalledSoftware.md", "source": "C:\\InstalledSoftware.md",

View File

@@ -533,6 +533,12 @@
"{{ template_dir }}/scripts/Installers/Install-Kind.ps1" "{{ template_dir }}/scripts/Installers/Install-Kind.ps1"
] ]
}, },
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-Bazel.ps1"
]
},
{ {
"type": "windows-restart", "type": "windows-restart",
"restart_timeout": "10m" "restart_timeout": "10m"
@@ -800,6 +806,12 @@
"{{ template_dir }}/scripts/Installers/Validate-Kind.ps1" "{{ template_dir }}/scripts/Installers/Validate-Kind.ps1"
] ]
}, },
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1"
]
},
{ {
"type": "file", "type": "file",
"source": "C:\\InstalledSoftware.md", "source": "C:\\InstalledSoftware.md",

View File

@@ -0,0 +1,6 @@
################################################################################
## File: Install-Bazel.ps1
## Desc: Install Bazel
################################################################################
choco install bazel -y

View File

@@ -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)<br/>
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description