Skip to content

Commit

Permalink
Add default ENVs that persist to plugin context
Browse files Browse the repository at this point in the history
See Strider-CD/strider#892

Commit  and PR still need to be implemented.
  • Loading branch information
Ilya Radchenko authored Jul 21, 2016
1 parent cdc916b commit 1387673
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ function Job(job, provider, plugins, config) {
pty: false,
env: {}
}, config);

// Setup default ENVs to be used in plugin contexts
this.config.env = _.extend(this.config.env, {
STRIDER: true,
STRIDER_TRIGGER: job.trigger.type || 'manual',
STRIDER_COMMIT: '',
STRIDER_PR: '',
STRIDER_BRANCH: job.ref.branch,
STRIDER_SLUG: job.project.name,
STRIDER_BUILD: jobId,
STRIDER_BUILD_URL: job.project.display_url + '/job/' + jobId

This comment has been minimized.

Copy link
@knownasilya

knownasilya Jul 21, 2016

Member

This is wrong, since it's the repo url..

});

if (this.config.pty) {
debug('PTY has been disabled due to a bug in node core');
Expand Down

0 comments on commit 1387673

Please sign in to comment.