mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Merge pull request #466 from nikita-bykov/bazel-support
Add Bazel support to Linux and Windows
This commit is contained in:
25
images/linux/scripts/installers/bazel.sh
Normal file
25
images/linux/scripts/installers/bazel.sh
Normal 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))"
|
||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
6
images/win/scripts/Installers/Install-Bazel.ps1
Normal file
6
images/win/scripts/Installers/Install-Bazel.ps1
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-Bazel.ps1
|
||||||
|
## Desc: Install Bazel
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
choco install bazel -y
|
||||||
23
images/win/scripts/Installers/Validate-Bazel.ps1
Normal file
23
images/win/scripts/Installers/Validate-Bazel.ps1
Normal 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
|
||||||
Reference in New Issue
Block a user