Skip to content

Commit

Permalink
fix(ubuntu) prefer asdf tools over system tools in default PATHes (
Browse files Browse the repository at this point in the history
…#1061)

feat(path): revert order for asdf, first asdf version
  • Loading branch information
smerle33 authored Feb 20, 2024
1 parent 3a28057 commit 33c3b28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion provisioning/ubuntu-provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function install_asdf() {

## append to the system wide path variable, need to be seconded for docker in packer sources.pkr.hcl
## https://backreference.org/2010/02/20/using-different-delimiters-in-sed/index.html
sed --in-place --regexp-extended "s|^PATH=(.*)\"$|PATH=\1:${asdf_install_dir}/shims:${asdf_install_dir}/bin\"|" /etc/environment
sed --in-place --regexp-extended "s|^PATH=\"(.*)\"$|PATH=\"${asdf_install_dir}/shims:${asdf_install_dir}/bin:\1\"|" /etc/environment
}

## Install the ASDF Plugin passed as argument ($1 is the name and $2 the URL)
Expand Down
2 changes: 1 addition & 1 deletion sources.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ source "docker" "base" {
"ENV LANGUAGE=${element(split(".", var.locale), 0)}:${element(split("_", var.locale), 0)}",
"ENV LC_ALL=${var.locale}",
"ENV AGENT_WORKDIR=/home/jenkins/agent",
"ENV PATH=$${PATH}:/usr/local/go/bin:/home/jenkins/.asdf/shims:/home/jenkins/.asdf/bin",
"ENV PATH=/usr/local/go/bin:/home/jenkins/.asdf/shims:/home/jenkins/.asdf/bin:$${PATH}",
"WORKDIR /home/jenkins",
"ENTRYPOINT [\"/usr/local/bin/jenkins-agent\"]",
"USER jenkins",
Expand Down

0 comments on commit 33c3b28

Please sign in to comment.