Skip to content

Commit

Permalink
Merge pull request #102 from shelfio/feature/support-v8
Browse files Browse the repository at this point in the history
Add ES 8.x support
  • Loading branch information
Siloss authored Jun 21, 2022
2 parents 98d1e16 + 52536f2 commit 7e23d67
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
Binary file added .DS_Store
Binary file not shown.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
version: 2.1

orbs:
node: circleci/node@1.1.6
node: circleci/node@5.0.2

parameters:
node_version:
type: string
default: '14-browsers'
default: '16.15.0'

commands:
install_deps:
steps:
- node/with-cache:
- node/install-packages:
pkg-manager: yarn
cache-version: v1-all
cache-key: package.json
dir: ~/repo/node_modules
use-strict-cache: true
steps:
- run: yarn install --pure-lockfile --no-progress
cache-only-lockfile: true
app-dir: ~/repo
override-ci-command: yarn install --pure-lockfile --no-progress
- run: sudo apt-get -q update && sudo apt-get -y install openjdk-17-jdk

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
.DS_Store
node_modules/
yarn.lock
lib/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ yarn add @shelf/elasticsearch-local --dev
import {start} from '@shelf/elasticsearch-local';

await start({
esVersion: '7.3.0',
esVersion: '8.2.2',
port: 9000, // optional
clusterName: 'test', // optional
nodeName: 'test', // optional
Expand Down Expand Up @@ -47,7 +47,7 @@ await start({
```js
import {stop} from '@shelf/elasticsearch-local';

await stop();
stop();
```
## Publish
Expand Down
19 changes: 9 additions & 10 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
jest.setTimeout(10 * 60 * 1000);

import {execSync} from 'child_process';
import {start, stop} from '.';

it('should start ElasticSearch v7x locally', async () => {
jest.setTimeout(80000);

await start({esVersion: '7.12.1', port: 9230});
it('should start ElasticSearch v8x locally', async () => {
await start({esVersion: '8.2.2', port: 9230});
const response = await execSync('curl -s -X GET "localhost:9230/?pretty"');
stop();

expect(JSON.parse(response.toString())).toEqual({
name: 'es-local',
cluster_name: 'es-local',
cluster_uuid: expect.any(String),
version: {
number: '7.12.1',
number: '8.2.2',
build_flavor: 'default',
build_type: 'tar',
build_hash: expect.any(String),
build_date: expect.any(String),
build_snapshot: false,
lucene_version: '8.8.0',
minimum_wire_compatibility_version: '6.8.0',
minimum_index_compatibility_version: '6.0.0-beta1',
lucene_version: '9.1.0',
minimum_index_compatibility_version: '7.0.0',
minimum_wire_compatibility_version: '7.17.0',
},
tagline: 'You Know, for Search',
});

await stop();
});
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export async function start(options: StartESOptions): Promise<void> {
spawnedProcess = execa(
esBinaryFilepath,
[
`-d`,
`-p`,
`${FILEPATH_PREFIX}/elasticsearch-${esVersion}/es-pid`,
`-Ecluster.name=${clusterName}`,
Expand Down Expand Up @@ -213,6 +212,9 @@ function upsertYAMLConfig(ymlConfigPath: string): void {
yaml.dump({
...parsedYaml,
xpack: {
security: {
enabled: false,
},
ml: {
enabled: false,
},
Expand Down

0 comments on commit 7e23d67

Please sign in to comment.