Skip to content

Commit 7e23d67

Browse files
authored
Merge pull request #102 from shelfio/feature/support-v8
Add ES 8.x support
2 parents 98d1e16 + 52536f2 commit 7e23d67

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
lines changed

.DS_Store

8 KB
Binary file not shown.

.circleci/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
version: 2.1
22

33
orbs:
4-
node: circleci/node@1.1.6
4+
node: circleci/node@5.0.2
55

66
parameters:
77
node_version:
88
type: string
9-
default: '14-browsers'
9+
default: '16.15.0'
1010

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

2222
jobs:
2323
build:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/
2+
.DS_Store
23
node_modules/
34
yarn.lock
45
lib/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $ yarn add @shelf/elasticsearch-local --dev
1616
import {start} from '@shelf/elasticsearch-local';
1717

1818
await start({
19-
esVersion: '7.3.0',
19+
esVersion: '8.2.2',
2020
port: 9000, // optional
2121
clusterName: 'test', // optional
2222
nodeName: 'test', // optional
@@ -47,7 +47,7 @@ await start({
4747
```js
4848
import {stop} from '@shelf/elasticsearch-local';
4949

50-
await stop();
50+
stop();
5151
```
5252
5353
## Publish

src/index.test.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1+
jest.setTimeout(10 * 60 * 1000);
2+
13
import {execSync} from 'child_process';
24
import {start, stop} from '.';
35

4-
it('should start ElasticSearch v7x locally', async () => {
5-
jest.setTimeout(80000);
6-
7-
await start({esVersion: '7.12.1', port: 9230});
6+
it('should start ElasticSearch v8x locally', async () => {
7+
await start({esVersion: '8.2.2', port: 9230});
88
const response = await execSync('curl -s -X GET "localhost:9230/?pretty"');
9+
stop();
910

1011
expect(JSON.parse(response.toString())).toEqual({
1112
name: 'es-local',
1213
cluster_name: 'es-local',
1314
cluster_uuid: expect.any(String),
1415
version: {
15-
number: '7.12.1',
16+
number: '8.2.2',
1617
build_flavor: 'default',
1718
build_type: 'tar',
1819
build_hash: expect.any(String),
1920
build_date: expect.any(String),
2021
build_snapshot: false,
21-
lucene_version: '8.8.0',
22-
minimum_wire_compatibility_version: '6.8.0',
23-
minimum_index_compatibility_version: '6.0.0-beta1',
22+
lucene_version: '9.1.0',
23+
minimum_index_compatibility_version: '7.0.0',
24+
minimum_wire_compatibility_version: '7.17.0',
2425
},
2526
tagline: 'You Know, for Search',
2627
});
27-
28-
await stop();
2928
});

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export async function start(options: StartESOptions): Promise<void> {
7171
spawnedProcess = execa(
7272
esBinaryFilepath,
7373
[
74-
`-d`,
7574
`-p`,
7675
`${FILEPATH_PREFIX}/elasticsearch-${esVersion}/es-pid`,
7776
`-Ecluster.name=${clusterName}`,
@@ -213,6 +212,9 @@ function upsertYAMLConfig(ymlConfigPath: string): void {
213212
yaml.dump({
214213
...parsedYaml,
215214
xpack: {
215+
security: {
216+
enabled: false,
217+
},
216218
ml: {
217219
enabled: false,
218220
},

0 commit comments

Comments
 (0)