Skip to content

Commit

Permalink
Implemented default:before_script and default:after_script
Browse files Browse the repository at this point in the history
  • Loading branch information
firecow committed Jan 11, 2020
1 parent 73e518e commit 08d864f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export class Job {
this.stage = jobData.stage || ".pre";
this.scripts = [].concat(jobData.script || []);

this.beforeScripts = [].concat(jobData.before_script || globals.before_script || []);
this.afterScripts = [].concat(jobData.after_script || globals.after_script || []);
const ciDefault = globals.default || {};
this.beforeScripts = [].concat(jobData.before_script || ciDefault.before_script || globals.before_script || []);
this.afterScripts = [].concat(jobData.after_script || ciDefault.after_script || globals.after_script || []);
this.allowFailure = jobData.allow_failure || false;
this.variables = jobData.variables || {};
}
Expand Down

0 comments on commit 08d864f

Please sign in to comment.