-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- **Commit 1:** [build] Add data directory that plugins can write to. Closes #7157 * Original sha: 5b19534 * Authored by Jonathan Budzenski <[email protected]> on 2016-06-14T16:50:40Z **Commit 2:** [config] Add path.conf, path.data * Original sha: 16e8975 * Authored by Jonathan Budzenski <[email protected]> on 2016-06-16T16:17:51Z
- Loading branch information
Showing
11 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import expect from 'expect.js'; | ||
import path from '../'; | ||
import { accessSync, R_OK} from 'fs'; | ||
|
||
describe('Default path finder', function () { | ||
it('should find a kibana.yml', () => { | ||
const configPath = path.getConfig(); | ||
expect(() => accessSync(configPath, R_OK)).to.not.throwError(); | ||
}); | ||
|
||
it('should find a data directory', () => { | ||
const dataPath = path.getData(); | ||
expect(() => accessSync(dataPath, R_OK)).to.not.throwError(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { accessSync, R_OK} from 'fs'; | ||
import { find } from 'lodash'; | ||
import fromRoot from '../../utils/fromRoot'; | ||
|
||
const CONFIG_PATHS = [ | ||
process.env.CONFIG_PATH, | ||
fromRoot('config/kibana.yml') | ||
].filter(Boolean); | ||
|
||
const DATA_PATHS = [ | ||
process.env.DATA_PATH, | ||
fromRoot('installedPlugins/.data'), | ||
'/var/lib/kibana' | ||
].filter(Boolean); | ||
|
||
function findFile(paths) { | ||
const availablePath = find(paths, configPath => { | ||
try { | ||
accessSync(configPath, R_OK); | ||
return true; | ||
} catch (e) { | ||
//Check the next path | ||
} | ||
}); | ||
return availablePath || paths[0]; | ||
} | ||
|
||
export default { | ||
getConfig: () => findFile(CONFIG_PATHS), | ||
getData: () => findFile(DATA_PATHS) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = function (grunt) { | ||
grunt.registerTask('_build:installedPlugins', function () { | ||
grunt.file.mkdir('build/kibana/installedPlugins'); | ||
grunt.file.mkdir('build/kibana/installedPlugins/.data'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters