Skip to content

Commit

Permalink
feat: add yq on all platforms
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal committed Jul 14, 2022
1 parent c110d8f commit eb80271
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions provisioning/tools-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
13 changes: 12 additions & 1 deletion provisioning/ubuntu-provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ function install_vagrant() {
fi
}


## Install Ruby with asdf
function install_ruby() {
# Ensure that ASDF is installed
Expand All @@ -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
Expand Down Expand Up @@ -377,6 +386,7 @@ function sanity_check() {
&& ruby -v \
&& unzip -v \
&& vagrant -v \
&& yq --version \
&& zip -v \
"
echo "== End of sanity check"
Expand Down Expand Up @@ -405,6 +415,7 @@ function main() {
install_gh
install_vagrant
install_ruby
install_yq
cleanup
}

Expand Down
5 changes: 5 additions & 0 deletions provisioning/windows-provision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit eb80271

Please sign in to comment.