updated generate script to find specs in new location

This commit is contained in:
Spencer Alger
2015-06-22 07:34:03 -07:00
parent 64fe534cf1
commit 96429a262a
2 changed files with 23 additions and 3 deletions

View File

@ -59,6 +59,9 @@ var paths = {
},
getArchiveTarball: function (branch) {
return fromRoot('src/_elasticsearch_' + _.snakeCase(branch) + '.tar');
},
getSpecPathInRepo: function (branch) {
return /^(master|2\.)/.test(branch) ? 'rest-api-spec/src/main/resources/rest-api-spec' : 'rest-api-spec';
}
};
@ -153,7 +156,7 @@ function findGeneratedApiFiles() {
function clearGeneratedFiles() {
var esArchives = /^_elasticsearch_(master|[\d_]+|\.tar)$/;
var esArchives = /^_elasticsearch_(master|[\dx_]+|\.tar)$/;
var generatedFiles = [];
if (argv.api) {
@ -190,6 +193,8 @@ function createArchive(branch) {
return function (done) {
var dir = paths.getArchiveDir(branch);
var tarball = paths.getArchiveTarball(branch);
var specPathInRepo = paths.getSpecPathInRepo(branch);
var subDirCount = _.countBy(specPathInRepo, _.partial(_.eq, '/')).true || 0;
if (isDirectory(dir)) {
console.log(branch + ' archive already exists');
@ -198,8 +203,8 @@ function createArchive(branch) {
async.series([
spawnStep('mkdir', [dir], paths.root),
spawnStep('git', ['archive', '--format', 'tar', '--output', tarball, branch, 'rest-api-spec'], paths.esSrc),
spawnStep('tar', ['-x', '-f', tarball, '-C', dir]),
spawnStep('git', ['archive', '--format', 'tar', '--output', tarball, branch, specPathInRepo], paths.esSrc),
spawnStep('tar', ['-x', '-f', tarball, '-C', dir, '--strip-components', subDirCount]),
spawnStep('rm', [tarball])
], done);
};

View File

@ -2596,6 +2596,8 @@ api.indices.prototype.flushSynced = ca({
* @param {Boolean} params.ignoreUnavailable - Ignore unavailable indexes (default: false)
* @param {Boolean} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false)
* @param {String} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open)
* @param {Boolean} params.flatSettings - Return settings in flat format (default: false)
* @param {Boolean} params.human - Whether to return version and creation date values in human-readable format.
* @param {String, String[], Boolean} params.index - A comma-separated list of index names
* @param {String, String[], Boolean} params.feature - A comma-separated list of features
*/
@ -2622,6 +2624,14 @@ api.indices.prototype.get = ca({
'all'
],
name: 'expand_wildcards'
},
flatSettings: {
type: 'boolean',
name: 'flat_settings'
},
human: {
type: 'boolean',
'default': false
}
},
urls: [
@ -2938,6 +2948,7 @@ api.indices.prototype.getMapping = ca({
* @param {String} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {Boolean} params.flatSettings - Return settings in flat format (default: false)
* @param {Boolean} params.local - Return local information, do not retrieve the state from master node (default: false)
* @param {Boolean} params.human - Whether to return version and creation date values in human-readable format.
* @param {String, String[], Boolean} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
* @param {String, String[], Boolean} params.name - The name of the settings that should be included
*/
@ -2971,6 +2982,10 @@ api.indices.prototype.getSettings = ca({
},
local: {
type: 'boolean'
},
human: {
type: 'boolean',
'default': false
}
},
urls: [