diff --git a/images/ubuntu/scripts/build/install-copilot-cli.sh b/images/ubuntu/scripts/build/install-copilot-cli.sh new file mode 100644 index 0000000000..7b0093a700 --- /dev/null +++ b/images/ubuntu/scripts/build/install-copilot-cli.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e +################################################################################ +## File: install-copilot-cli.sh +## Desc: Install the GitHub Copilot CLI +## Supply chain security: GitHub Copilot CLI - checksum validation (implemented inside installation script) +################################################################################ + +# Install GitHub Copilot CLI (Instruction taken from https://github.com/github/copilot-cli) +curl -fsSL https://gh.io/copilot-install | bash + +invoke_tests "CLI.Tools" "Github Copilot CLI" diff --git a/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 b/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 index 4f4be1bee3..f1037d6f3a 100644 --- a/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 +++ b/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 @@ -166,6 +166,7 @@ if (Test-IsUbuntu22) { $cliTools.AddToolVersion("ORAS CLI", $(Get-ORASCliVersion)) $cliTools.AddToolVersion("Vercel CLI", $(Get-VerselCliversion)) } +$cliTools.AddToolVersion("Github Copilot CLI", $(Get-GithubCopilotCliVersion)) # Java $installedSoftware.AddHeader("Java").AddTable($(Get-JavaVersionsTable)) diff --git a/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 b/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 index 9ea6c1f24b..a68c154447 100644 --- a/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 +++ b/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 @@ -271,3 +271,8 @@ function Get-YqVersion { $yqVersion = $(yq -V) | Get-StringPart -Part 3 return $yqVersion.TrimStart("v").Trim() } + +function Get-GithubCopilotCliVersion { + $copilotVersion = copilot --version | Get-StringPart -Part 3 + return "$copilotVersion".TrimEnd(".") +} diff --git a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 index 9eb749d6fd..8c306d443a 100644 --- a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 +++ b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 @@ -53,3 +53,9 @@ Describe "Oras CLI" -Skip:((-not (Test-IsUbuntu22))) { "oras version" | Should -ReturnZeroExitCode } } + +Describe "Github Copilot CLI" { + It "Github Copilot CLI" { + "copilot --version" | Should -ReturnZeroExitCode + } +} diff --git a/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl b/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl index 135af613f1..6a1a4aa1cb 100644 --- a/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl +++ b/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl @@ -157,7 +157,8 @@ build { "${path.root}/../scripts/build/install-pypy.sh", "${path.root}/../scripts/build/install-python.sh", "${path.root}/../scripts/build/install-zstd.sh", - "${path.root}/../scripts/build/install-ninja.sh" + "${path.root}/../scripts/build/install-ninja.sh", + "${path.root}/../scripts/build/install-copilot-cli.sh" ] } diff --git a/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl b/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl index 04dd1114eb..ae9b1fcff5 100644 --- a/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl +++ b/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl @@ -146,7 +146,8 @@ provisioner "shell" { "${path.root}/../scripts/build/install-pypy.sh", "${path.root}/../scripts/build/install-python.sh", "${path.root}/../scripts/build/install-zstd.sh", - "${path.root}/../scripts/build/install-ninja.sh" + "${path.root}/../scripts/build/install-ninja.sh", + "${path.root}/../scripts/build/install-copilot-cli.sh" ] }