Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Have to pass in the environment variables into the build script

  • Loading branch information...
commit 2e039acd3fef98091284738fa8a487749c088e73 1 parent f42ba80
@gja gja authored
View
5 app/models/build.rb
@@ -46,9 +46,8 @@ def <=>(other)
def run
before_build
Bundler.with_clean_env do
- build_command = "script/goldberg-build '#{project.name}' '#{ruby}' '#{project.code_path}' '#{build_log_path}' '#{artefacts_path}' '#{project.nice}' #{project.build_command}"
- full_command = "#{environment_string} #{build_command}"
- execute_async(full_command)
+ build_command = "script/goldberg-build '#{project.name}' '#{ruby}' '#{project.code_path}' '#{build_log_path}' '#{artefacts_path}' '#{project.nice}' '#{environment_string}' #{project.build_command}"
+ execute_async(build_command)
end
end
View
4 script/goldberg-build
@@ -2,7 +2,7 @@
if [ $# == 0 ]; then
echo "This script is meant to be run by goldberg"
- echo "goldberg-build project ruby code_path build_log_path artefacts_path nice_value build_command"
+ echo "goldberg-build project ruby code_path build_log_path artefacts_path nice_value environment_variables build_command"
exit 1
fi
@@ -12,6 +12,7 @@ code_path="$1" && shift
build_log_path="$1" && shift
artifacts_path="$1" && shift
nice_value="$1" && shift
+environment_variables="$1" && shift
build_command="$@"
# echo $project, $ruby, $code_path, $build_log_path, $artifacts_path, $nice_value, $build_command >> $build_log_path
@@ -50,4 +51,5 @@ fi
cd $code_path
update_bundle >> $build_log_path 2>&1 || exit -1
mkdir -p "$artifacts_path"
+if [ -n "$environment_variables" ]; then export $environment_variables; fi
exec nice -n $nice_value $build_command >> $build_log_path 2>&1
View
2  spec/models/build_spec.rb
@@ -107,7 +107,7 @@
project.stub(:config).and_return(config)
build.environment_string = "FOO=bar"
config.nice = 5
- expect_command("FOO=bar script/goldberg-build '#{project.name}' '1.9.2' '#{ENV['HOME']}/.goldberg/projects/#{project.name}/code' '#{ENV['HOME']}/.goldberg/projects/#{project.name}/builds/1/build_log' '#{ENV['HOME']}/.goldberg/projects/#{project.name}/builds/1/artefacts' '5' rake default",
+ expect_command("script/goldberg-build '#{project.name}' '1.9.2' '#{ENV['HOME']}/.goldberg/projects/#{project.name}/code' '#{ENV['HOME']}/.goldberg/projects/#{project.name}/builds/1/build_log' '#{ENV['HOME']}/.goldberg/projects/#{project.name}/builds/1/artefacts' '5' 'FOO=bar' rake default",
:running? => false, :fork => nil, :success? => true
)
build.run
Please sign in to comment.
Something went wrong with that request. Please try again.