From 985a3d0ce748bd079fa056b5cf6f421aaa5d0918 Mon Sep 17 00:00:00 2001 From: AdamSimpson Date: Sun, 18 Feb 2018 08:04:39 -0500 Subject: [PATCH] Source variables instead of preserve environment with sudo --- Builder/scripts/docker-builder-backend.sh | 2 ++ Builder/scripts/singularity-builder-backend.sh | 2 ++ Builder/src/main.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Builder/scripts/docker-builder-backend.sh b/Builder/scripts/docker-builder-backend.sh index 6507fa3..0822b7b 100755 --- a/Builder/scripts/docker-builder-backend.sh +++ b/Builder/scripts/docker-builder-backend.sh @@ -1,5 +1,7 @@ #!/bin/bash +source /home/builder/environment.sh + # Test for any arguments, such as --debug for i in "$@" do diff --git a/Builder/scripts/singularity-builder-backend.sh b/Builder/scripts/singularity-builder-backend.sh index 304f22d..a796524 100755 --- a/Builder/scripts/singularity-builder-backend.sh +++ b/Builder/scripts/singularity-builder-backend.sh @@ -1,5 +1,7 @@ #!/bin/bash +source /home/builder/environment.sh + # Test for any arguments, such as --debug for i in "$@" do diff --git a/Builder/src/main.cpp b/Builder/src/main.cpp index 790977d..f107d15 100644 --- a/Builder/src/main.cpp +++ b/Builder/src/main.cpp @@ -80,9 +80,9 @@ std::string build_command(const ClientData &client_data) { // Basic build command if (client_data.backend == BackendType::singularity) { - build_command = "/usr/bin/sudo -E /usr/local/bin/singularity-builder-backend.sh"; + build_command = "/usr/bin/sudo /usr/local/bin/singularity-builder-backend.sh"; } else if (client_data.backend == BackendType::docker) { - build_command = "/usr/bin/sudo -E /usr/local/bin/docker-builder-backend.sh"; + build_command = "/usr/bin/sudo /usr/local/bin/docker-builder-backend.sh"; } else { throw std::runtime_error("Invalid builder backend"); }