Method: Exec#make_env

Defined in:
lib/oxidized/hook/exec.rb

#make_env(ctx) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oxidized/hook/exec.rb', line 62

def make_env ctx
  env = {
    "OX_EVENT" => ctx.event.to_s
  }
  if ctx.node
    env.merge!(
      "OX_NODE_NAME" => ctx.node.name.to_s,
      "OX_NODE_IP" => ctx.node.ip.to_s,
      "OX_NODE_FROM" => ctx.node.from.to_s,
      "OX_NODE_MSG" => ctx.node.msg.to_s,
      "OX_NODE_GROUP" => ctx.node.group.to_s,
      "OX_NODE_MODEL" => ctx.node.model.class.name,
      "OX_REPO_COMMITREF" => ctx.commitref.to_s,
      "OX_REPO_NAME" => ctx.node.repo.to_s,
    )
  end
  if ctx.job
    env.merge!(
      "OX_JOB_STATUS" => ctx.job.status.to_s,
      "OX_JOB_TIME" => ctx.job.time.to_s,
    )
  end
  env
end