aboutsummaryrefslogtreecommitdiff
path: root/app/services/govuk_guix
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/govuk_guix')
-rw-r--r--app/services/govuk_guix/build_mini_environment.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/services/govuk_guix/build_mini_environment.rb b/app/services/govuk_guix/build_mini_environment.rb
index 9cada20..a87c4da 100644
--- a/app/services/govuk_guix/build_mini_environment.rb
+++ b/app/services/govuk_guix/build_mini_environment.rb
@@ -72,12 +72,16 @@ module GovukGuix::BuildMiniEnvironment
run_remotely_on_host: remote_host
)
- build_output = output.last.strip
-
- raise 'InvalidOutput' unless build_output.starts_with? '/gnu/store'
-
+ last_non_empty_line = output.reverse.find do |line|
+ !line.strip.empty?
+ end
+ build_output = last_non_empty_line.strip
logger.debug(self.class) { "build_output: #{build_output}" }
+ unless options[:arguments][:type] == 'aws-packer-ami'
+ raise 'InvalidOutput' unless build_output.starts_with? '/gnu/store'
+ end
+
mini_environment.update(
backend_data: {
build_output: build_output