Skip to content

Commit

Permalink
fix: Pass jobName to postBuildEvent (#42)
Browse files Browse the repository at this point in the history
* fix: Pass jobName to postBuildEvent

* fix: Minor edit
  • Loading branch information
Pranav Ravichandran authored Feb 14, 2019
1 parent d26e7b3 commit f1d196f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,15 @@ class ExecutorQueue extends Executor {
* @return {Promise}
*/
async _startFrozen(config) {
return this.postBuildEvent(config)
const newConfig = {
job: {
name: config.jobName
}
};

Object.assign(newConfig, config);

return this.postBuildEvent(newConfig)
.catch(() => Promise.resolve());
}

Expand Down Expand Up @@ -350,6 +358,7 @@ class ExecutorQueue extends Executor {
* @param {Array} config.freezeWindows Array of cron expressions that this job cannot run during
* @param {String} config.apiUri Screwdriver's API
* @param {String} config.jobId JobID that this build belongs to
* @param {String} config.jobName Name of job that this build belongs to
* @param {String} config.buildId Unique ID for a build
* @param {Object} config.pipeline Pipeline of the job
* @param {Fn} config.tokenGen Function to generate JWT from username, scope and scmContext
Expand Down
1 change: 1 addition & 0 deletions test/data/fullConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"beta.screwdriver.cd/executor": "screwdriver-executor-k8s"
},
"jobId": 777,
"jobName": "main",
"buildId": 8609,
"container": "node:4",
"apiUri": "http://api.com",
Expand Down

0 comments on commit f1d196f

Please sign in to comment.