Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detailed steps for development for OpenSearch Dashboards #277

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 55 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,38 +210,70 @@ Thanks for their great work !

## Development

To run enhanced-table plugin in development mode (that enables hot code reload), follow these instructions:
- execute these commands :
``` bash
git clone https://github.com/opensearch-project/OpenSearch-Dashboards
You can run the enhanced-table plugin in development mode that supports hot code reload.

Follow those steps:

### Clone OpenSearch-Dashboards & kibina-enhanced-table
```bash
git clone https://github.com/opensearch-project/OpenSearch-Dashboards -b 1.0.0
cd OpenSearch-Dashboards
git reset --hard vX.Y.Z # replace 'X.Y.Z' by desired OpenSearch-Dashboards version
cd plugins
git clone https://github.com/fbaligand/kibana-enhanced-table.git enhancedTable
git checkout opensearch-dashboards
git clone https://github.com/fbaligand/kibana-enhanced-table.git -b osd plugins/enhancedTable
```
- install the version of Node.js listed in the OpenSearch-Dashboards/.node-version file
- ensure that node binary is both in PATH environment variable and in OpenSearch-Dashboards/node folder
- install the latest version of yarn: `npm install -g yarn`
- execute these commands :
``` bash
cd OpenSearch-Dashboards
yarn osd bootstrap
### Update OpenSearch-Dashboards config

Update `OpenSearch-Dashboards/config/opensearch_dashboards.yml` with opensearch hosts and user credentials.

```yaml
opensearch.hosts: [""]
opensearch.username: ""
opensearch.password: ""
```

- - -

If you do not have opensearch server running yet,
you can use the `opensearchproject/opensearch` docker image

```bash
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:latest
```
and update config with the following settings:

```yaml
opensearch.hosts: ["https://localhost:9200"]
opensearch.username: "admin" # Default username on the docker image
opensearch.password: "admin" # Default password on the docker image
opensearch.ssl.verificationMode: none
```
### Install Node.js and yarn
install the version of Node.js listed in the .node-version file.
```bash
volta install node@$(<.node-version)
npm install -g yarn
```

### Build with Hot Reload
```bash
cd plugins/enhancedTable
yarn osd bootstrap
yarn install
yarn start
```
- in your browser, call `http://localhost:5601` and enjoy!


To build a distributable archive, execute this command :
``` bash
Now, you can open your browser,

- In your browser, open the generated URL displayed in the console. It is something like: `http://localhost:5601/abc`
- Now, each time you change the code, the plugin will be reloaded with the changes.
- Happy coding :-)

### Build a distributable archive
```bash
yarn build
```
A prompt will ask you what is Opensearch-Dashboards version.
Give the version (example: 1.2.0), and type ENTER.
Then, the result archive is generated into `build` directory.

The result artifact located at `build/enhancedTable-X.Y.Z_osd-A.B.C.zip` where:
- X.Y.Z is the `${npm_package_version}`
- A.B.C is the OpenSearch-Dashboards version

## Donation

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
"lint": "../../node_modules/.bin/eslint .",
"start": "cd ../.. && node scripts/opensearch_dashboards --dev",
"debug": "node --nolazy --inspect ../../scripts/opensearch_dashboards --dev",
"build": "../../node_modules/.bin/plugin-helpers build",
"compile-and-build": "node ../../scripts/plugin_helpers.js build",
"compile": "rm -rf ./target && node ../../scripts/build_opensearch_dashboards_platform_plugins.js --scan-dir ."
"build": "yarn plugin-helpers build",
"compile": "rm -rf ./target && node ../../scripts/build_opensearch_dashboards_platform_plugins.js --scan-dir .",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"postbuild": "old=(build/*.zip) && new=\"$(echo $old | cut -f 1 -d '-')-${npm_package_version}_osd-$(echo $old | cut -f 2 -d '-')\" && echo renaming build artifact to $new && mv $old $new"
},
"dependencies": {
"expr-eval": "2.0.2"
},
"devDependencies": {
}
}
}