From 9f855a0bcfa0b7f83435d1029d4d7967bdefcff9 Mon Sep 17 00:00:00 2001 From: Ramakrishnan G Date: Fri, 19 Sep 2014 10:43:25 +0530 Subject: [PATCH] Preserve environment variables when doing sudo This commit adds the '-E' option for all the sudo commands in build script of agent which causes it to preserve environment variables. Change-Id: Ic3fbc4ee8189cc82ef99359bf61eef33dae40a5a Closes-Bug: 1371418 --- imagebuild/coreos/build_coreos_image.sh | 8 ++++---- imagebuild/coreos/full_trusty_build.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imagebuild/coreos/build_coreos_image.sh b/imagebuild/coreos/build_coreos_image.sh index aa4c52023..d911667ce 100755 --- a/imagebuild/coreos/build_coreos_image.sh +++ b/imagebuild/coreos/build_coreos_image.sh @@ -16,9 +16,9 @@ # all requirements then perform the build. if [[ -x /usr/bin/docker.io ]]; then - sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker + sudo -E ln -sf /usr/bin/docker.io /usr/local/bin/docker fi cd imagebuild/coreos -sudo pip install -r requirements.txt -sudo make clean -sudo make +sudo -E pip install -r requirements.txt +sudo -E make clean +sudo -E make diff --git a/imagebuild/coreos/full_trusty_build.sh b/imagebuild/coreos/full_trusty_build.sh index 5610b68c4..94bfb5b56 100755 --- a/imagebuild/coreos/full_trusty_build.sh +++ b/imagebuild/coreos/full_trusty_build.sh @@ -3,8 +3,8 @@ # From a base-trusty node, this should build a CoreOS IPA image # suitable for use in testing or production. # -sudo apt-get update -sudo apt-get install -y docker.io +sudo -E apt-get update +sudo -E apt-get install -y docker.io imagebuild/coreos/build_coreos_image.sh