Master should use the latest version of ES (#780)
The `master` branch should work with the latest snapshot of Elasticsearch. - Use `8.0.0-SNAPSHOT` - Code generation - Updated scripts and CI conf
This commit is contained in:
committed by
GitHub
parent
f260549a4f
commit
fb73b4b08d
@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Images are cached locally, it may be needed
|
||||
# to delete an old image and download again
|
||||
# the latest snapshot.
|
||||
|
||||
repo=$(pwd)
|
||||
testnodecrt="/.ci/certs/testnode.crt"
|
||||
testnodekey="/.ci/certs/testnode.key"
|
||||
@ -28,5 +32,4 @@ exec docker run \
|
||||
-v "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
|
||||
-v "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
|
||||
-p 9200:9200 \
|
||||
docker.elastic.co/elasticsearch/elasticsearch:7.0.0-beta1
|
||||
# docker.elastic.co/elasticsearch/elasticsearch:6.6.0
|
||||
docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Images are cached locally, it may be needed
|
||||
# to delete an old image and download again
|
||||
# the latest snapshot.
|
||||
|
||||
exec docker run \
|
||||
--rm \
|
||||
-e "node.attr.testattr=test" \
|
||||
@ -9,5 +13,4 @@ exec docker run \
|
||||
-p 9200:9200 \
|
||||
--network=elastic \
|
||||
--name=elasticsearch \
|
||||
docker.elastic.co/elasticsearch/elasticsearch:7.0.0-beta1
|
||||
# docker.elastic.co/elasticsearch/elasticsearch:6.6.0
|
||||
docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
|
||||
|
||||
@ -35,12 +35,12 @@ const {
|
||||
} = require('./utils')
|
||||
|
||||
start(minimist(process.argv.slice(2), {
|
||||
string: ['tag']
|
||||
string: ['tag', 'branch']
|
||||
}))
|
||||
|
||||
function start (opts) {
|
||||
const log = ora('Loading Elasticsearch Repository').start()
|
||||
if (semver.valid(opts.tag) === null) {
|
||||
if (opts.branch == null && semver.valid(opts.tag) === null) {
|
||||
log.fail(`Missing or invalid tag: ${opts.tag}`)
|
||||
return
|
||||
}
|
||||
@ -55,7 +55,7 @@ function start (opts) {
|
||||
log.text = 'Cleaning API folder...'
|
||||
rimraf.sync(join(apiOutputFolder, '*.js'))
|
||||
|
||||
cloneAndCheckout({ log, tag: opts.tag }, (err, { apiFolder, xPackFolder }) => {
|
||||
cloneAndCheckout({ log, tag: opts.tag, branch: opts.branch }, (err, { apiFolder, xPackFolder }) => {
|
||||
if (err) {
|
||||
log.fail(err.message)
|
||||
return
|
||||
|
||||
@ -29,7 +29,7 @@ const apiFolder = join(esFolder, 'rest-api-spec', 'src', 'main', 'resources', 'r
|
||||
const xPackFolder = join(esFolder, 'x-pack', 'plugin', 'src', 'test', 'resources', 'rest-api-spec', 'api')
|
||||
|
||||
function cloneAndCheckout (opts, callback) {
|
||||
const { log, tag } = opts
|
||||
const { log, tag, branch } = opts
|
||||
withTag(tag, callback)
|
||||
|
||||
/**
|
||||
@ -57,13 +57,19 @@ function cloneAndCheckout (opts, callback) {
|
||||
|
||||
if (fresh) {
|
||||
clone(checkout)
|
||||
} else if (opts.branch) {
|
||||
checkout(true)
|
||||
} else {
|
||||
checkout()
|
||||
}
|
||||
|
||||
function checkout () {
|
||||
log.text = `Checking out tag '${tag}'`
|
||||
git.checkout(tag, err => {
|
||||
function checkout (alsoPull = false) {
|
||||
if (branch) {
|
||||
log.text = `Checking out branch '${branch}'`
|
||||
} else {
|
||||
log.text = `Checking out tag '${tag}'`
|
||||
}
|
||||
git.checkout(branch || tag, err => {
|
||||
if (err) {
|
||||
if (retry++ > 0) {
|
||||
callback(new Error(`Cannot checkout tag '${tag}'`), { apiFolder, xPackFolder })
|
||||
@ -71,6 +77,9 @@ function cloneAndCheckout (opts, callback) {
|
||||
}
|
||||
return pull(checkout)
|
||||
}
|
||||
if (alsoPull) {
|
||||
return pull(checkout)
|
||||
}
|
||||
callback(null, { apiFolder, xPackFolder })
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user