diff --git a/lib/job.js b/lib/job.js index 3cb20d5..1364a46 100644 --- a/lib/job.js +++ b/lib/job.js @@ -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 + }); if (this.config.pty) { debug('PTY has been disabled due to a bug in node core');