From eb8027139162976d65b6e2f595911a35de64959d Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 14 Jul 2022 15:24:54 +0200 Subject: [PATCH] feat: add yq on all platforms Signed-off-by: Damien Duportal --- provisioning/tools-versions.yml | 1 + provisioning/ubuntu-provision.sh | 13 ++++++++++++- provisioning/windows-provision.ps1 | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/provisioning/tools-versions.yml b/provisioning/tools-versions.yml index ae03cde0c..3b37ff94f 100644 --- a/provisioning/tools-versions.yml +++ b/provisioning/tools-versions.yml @@ -18,3 +18,4 @@ maven_version: "3.8.6" openssh_authorized_keys_url: "https://raw.githubusercontent.com/jenkins-infra/aws/main/ec2_agents_authorized_keys" ruby_version: "2.6.10" vagrant_version: "2.2.19" +yq_version: "4.25.3" diff --git a/provisioning/ubuntu-provision.sh b/provisioning/ubuntu-provision.sh index 85aab4c79..35b9e8541 100755 --- a/provisioning/ubuntu-provision.sh +++ b/provisioning/ubuntu-provision.sh @@ -334,7 +334,6 @@ function install_vagrant() { fi } - ## Install Ruby with asdf function install_ruby() { # Ensure that ASDF is installed @@ -347,6 +346,16 @@ function install_ruby() { install_asdf_package ruby "${RUBY_VERSION}" } +## Install Yq with asdf +function install_yq() { + # Ensure that ASDF is installed + install_asdf + + # Install Yq with ASDF and set it as default installation + install_asdf_plugin yq https://github.com/sudermanjr/asdf-yq.git + install_asdf_package yq "${YQ_VERSION}" +} + ## Ensure that the VM is cleaned up function cleanup() { export HISTSIZE=0 @@ -377,6 +386,7 @@ function sanity_check() { && ruby -v \ && unzip -v \ && vagrant -v \ + && yq --version \ && zip -v \ " echo "== End of sanity check" @@ -405,6 +415,7 @@ function main() { install_gh install_vagrant install_ruby + install_yq cleanup } diff --git a/provisioning/windows-provision.ps1 b/provisioning/windows-provision.ps1 index 7adbf66e9..ea30724a9 100644 --- a/provisioning/windows-provision.ps1 +++ b/provisioning/windows-provision.ps1 @@ -349,6 +349,11 @@ Write-Host '- Sanity check for ruby tooling' & C:\tools\ruby26\bin\ruby -v & C:\tools\ruby26\bin\bundle -v +Write-Output "= Installing Yq..." +Invoke-Command {& "choco.exe" install yq --yes --no-progress --limit-output --fail-on-error-output --version "${env:YQ_VERSION}";} +Write-Host '- Sanity check for yq CLI' +& yq --version + ## Add a set of pre-defined SSH keys to allow faster agent startups $temp_authorized_keys_file = 'C:\custom_auth_keys' DownloadFile "$env:OPENSSH_AUTHORIZED_KEYS_URL" "$temp_authorized_keys_file"