Skip to content

Commit

Permalink
Merge pull request #6695 from elastic/jasper/backport/6692/4.x
Browse files Browse the repository at this point in the history
[backport] PR #6692 to 4.x
  • Loading branch information
epixa committed Mar 29, 2016
2 parents 6985ba4 + e94c04f commit fdacfc4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions tasks/jenkins.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = function (grunt) {
grunt.option('os-packages', true);

grunt.task.run(compact([
'rejectRejFiles',
'test',
process.env.JOB_NAME === 'kibana_core' ? 'build' : null
]));
Expand Down
30 changes: 30 additions & 0 deletions tasks/reject_rej_files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { startsWith } from 'lodash';

// Fails if any .rej files are found
// .rej files are an artifact from a failed git-apply or a jasper backport

// This check is intentionally performed on the files in the repo rather than
// on the files that are to be committed.

export default grunt => {
grunt.registerTask('rejectRejFiles', 'Reject any git-apply .rej files', () => {
const ignoredTopLevelDirs = [
'esvm',
'installedPlugins',
'node_modules',
'optimize'
];

const matchBase = true;
const filter = file => (
ignoredTopLevelDirs.every(dir => !startsWith(file, dir))
);

const files = grunt.file.expand({ filter, matchBase }, '*.rej');
if (files.length > 0) {
const err = `.rej files are not allowed:\n${files.join('\n')}`;
grunt.log.error(err);
return false;
}
});
};

0 comments on commit fdacfc4

Please sign in to comment.