From 3145274036ed557302946c720511dfc49abb4b33 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:13:53 +0300 Subject: [PATCH] Update PATH environment variable to add .dotnet and php composer default folder (#477) * Add environment variables for .dotnet and php comopser * update rust.sh comments --- images/linux/scripts/installers/rust.sh | 3 +-- images/linux/scripts/installers/updatepath.sh | 6 ++++++ images/linux/ubuntu1604.json | 1 + images/linux/ubuntu1804.json | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 images/linux/scripts/installers/updatepath.sh diff --git a/images/linux/scripts/installers/rust.sh b/images/linux/scripts/installers/rust.sh index d690f380..571538a3 100644 --- a/images/linux/scripts/installers/rust.sh +++ b/images/linux/scripts/installers/rust.sh @@ -14,8 +14,7 @@ export CARGO_HOME=/usr/share/rust/.cargo curl https://sh.rustup.rs -sSf | sh -s -- -y -# Add Cargo and Rust binaries to the machine path -echo "PATH=${CARGO_HOME}/bin:$PATH" | tee -a /etc/environment +# Initialize environment variables source $CARGO_HOME/env # Install common tools diff --git a/images/linux/scripts/installers/updatepath.sh b/images/linux/scripts/installers/updatepath.sh new file mode 100644 index 00000000..7d63ceb1 --- /dev/null +++ b/images/linux/scripts/installers/updatepath.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +CARGO_HOME=/usr/share/rust/.cargo +DOTNET_TOOLS_HOME=/home/runner/.dotnet/tools +PHP_COMPOSER_HOME=/home/runner/.config/composer/vendor/bin +echo "PATH=${CARGO_HOME}/bin:${PATH}:${DOTNET_TOOLS_HOME}:${PHP_COMPOSER_HOME}" | tee -a /etc/environment \ No newline at end of file diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 675b8934..9002370a 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -167,6 +167,7 @@ "{{template_dir}}/scripts/installers/terraform.sh", "{{template_dir}}/scripts/installers/vcpkg.sh", "{{template_dir}}/scripts/installers/zeit-now.sh", + "{{template_dir}}/scripts/installers/updatepath.sh", "{{template_dir}}/scripts/installers/dpkg-config.sh" ], diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 2d540af5..2d612510 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -170,6 +170,7 @@ "{{template_dir}}/scripts/installers/terraform.sh", "{{template_dir}}/scripts/installers/vcpkg.sh", "{{template_dir}}/scripts/installers/zeit-now.sh", + "{{template_dir}}/scripts/installers/updatepath.sh", "{{template_dir}}/scripts/installers/dpkg-config.sh" ], "environment_vars": [