lib/vx/builder/script/env.rb in vx-builder-0.0.29 vs lib/vx/builder/script/env.rb in vx-builder-0.1.0

- old
+ new

@@ -8,19 +8,30 @@ def call(env) env.init << "set -e" env.init << "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" env.init << 'export LC_ALL=en_US.UTF8' + env.init << 'export DEBIAN_FRONTEND=noninteractive' - if b = env.task.branch - env.init << "export CI_BRANCH=#{b}" - end + export_vars(env, env.init) + export_vars(env, env.after_script_init) env.source.env.global.each do |e| env.init << trace_sh_command("export #{e}") end app.call(env) end + + private + + def export_vars(env, collection) + collection << "export CI_JOB_ID=#{env.task.job_id}" + collection << "export CI_BUILD_ID=#{env.task.build_id}" + + if b = env.task.branch + collection << "export CI_BRANCH=#{b}" + end + end end end end end