Skip to content

Commit

Permalink
Source variables instead of preserve environment with sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSimpson committed Feb 18, 2018
1 parent 2f04b49 commit 985a3d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Builder/scripts/docker-builder-backend.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

source /home/builder/environment.sh

# Test for any arguments, such as --debug
for i in "$@"
do
Expand Down
2 changes: 2 additions & 0 deletions Builder/scripts/singularity-builder-backend.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

source /home/builder/environment.sh

# Test for any arguments, such as --debug
for i in "$@"
do
Expand Down
4 changes: 2 additions & 2 deletions Builder/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 985a3d0

Please sign in to comment.