Skip to content

Commit

Permalink
Merge pull request #158 from screwdriver-cd/revert-155-alwaysrun
Browse files Browse the repository at this point in the history
Revert "feat(473): Add alwaysRun flag to steps in builds"
  • Loading branch information
d2lam authored Apr 26, 2017
2 parents 85d7bf2 + 75d3673 commit 4bdcdd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
5 changes: 2 additions & 3 deletions lib/buildFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ class BuildFactory extends BaseFactory {
modelConfig.environment = permutation.environment;
modelConfig.steps = permutation.commands.map(command => ({
name: command.name,
command: command.command,
alwaysRun: command.alwaysRun || false
command: command.command
}));

const bookendConfig = { pipeline, job, build: modelConfig };
Expand All @@ -169,7 +168,7 @@ class BuildFactory extends BaseFactory {
]).then(([setup, teardown]) => {
modelConfig.steps = setup.concat(modelConfig.steps, teardown);
// Launcher is hardcoded to do some business in sd-setup-launcher
modelConfig.steps.unshift({ name: 'sd-setup-launcher', alwaysRun: true });
modelConfig.steps.unshift({ name: 'sd-setup-launcher' });

return super.create(modelConfig);
});
Expand Down
20 changes: 10 additions & 10 deletions test/lib/buildFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,30 +134,30 @@ describe('Build Factory', () => {
const isoTime = (new Date(dateNow)).toISOString();
const container = 'node:4';
const steps = [
{ name: 'sd-setup-launcher', alwaysRun: true },
{ name: 'sd-setup-scm', command: 'git clone', alwaysRun: true },
{ command: 'npm install', name: 'init', alwaysRun: false },
{ command: 'npm test', name: 'test', alwaysRun: false }
{ name: 'sd-setup-launcher' },
{ name: 'sd-setup-scm', command: 'git clone' },
{ command: 'npm install', name: 'init' },
{ command: 'npm test', name: 'test' }
];
const environment = { NODE_ENV: 'test', NODE_VERSION: '4' };
const permutations = [{
commands: [
{ command: 'npm install', name: 'init', alwaysRun: false },
{ command: 'npm test', name: 'test', alwaysRun: false }
{ command: 'npm install', name: 'init' },
{ command: 'npm test', name: 'test' }
],
environment: { NODE_ENV: 'test', NODE_VERSION: '4' },
image: 'node:4'
}, {
commands: [
{ command: 'npm install', name: 'init', alwaysRun: false },
{ command: 'npm test', name: 'test', alwaysRun: false }
{ command: 'npm install', name: 'init' },
{ command: 'npm test', name: 'test' }
],
environment: { NODE_ENV: 'test', NODE_VERSION: '5' },
image: 'node:5'
}, {
commands: [
{ command: 'npm install', name: 'init', alwaysRun: false },
{ command: 'npm test', name: 'test', alwaysRun: false }
{ command: 'npm install', name: 'init' },
{ command: 'npm test', name: 'test' }
],
environment: { NODE_ENV: 'test', NODE_VERSION: '6' },
image: 'node:6'
Expand Down

0 comments on commit 4bdcdd6

Please sign in to comment.