-
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.
Merge branch 'master' of https://github.com/elastic/kibana into actio…
…ns/allowed-hosts
- Loading branch information
Showing
974 changed files
with
18,723 additions
and
9,684 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -25,90 +25,92 @@ def PROMOTE_WITHOUT_VERIFY = !!params.PROMOTE_WITHOUT_VERIFICATION | |
timeout(time: 120, unit: 'MINUTES') { | ||
timestamps { | ||
ansiColor('xterm') { | ||
node(workers.label('l')) { | ||
catchErrors { | ||
def VERSION | ||
def SNAPSHOT_ID | ||
def DESTINATION | ||
|
||
def scmVars = checkoutEs(ES_BRANCH) | ||
def GIT_COMMIT = scmVars.GIT_COMMIT | ||
def GIT_COMMIT_SHORT = sh(script: "git rev-parse --short ${GIT_COMMIT}", returnStdout: true).trim() | ||
|
||
buildArchives('to-archive') | ||
|
||
dir('to-archive') { | ||
def now = new Date() | ||
def date = now.format("yyyyMMdd-HHmmss") | ||
|
||
def filesRaw = sh(script: "ls -1", returnStdout: true).trim() | ||
def files = filesRaw | ||
.split("\n") | ||
.collect { filename -> | ||
// Filename examples | ||
// elasticsearch-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz | ||
// elasticsearch-8.0.0-SNAPSHOT-linux-x86_64.tar.gz | ||
def parts = filename.replace("elasticsearch-oss", "oss").split("-") | ||
|
||
VERSION = VERSION ?: parts[1] | ||
SNAPSHOT_ID = SNAPSHOT_ID ?: "${date}_${GIT_COMMIT_SHORT}" | ||
DESTINATION = DESTINATION ?: "${VERSION}/archives/${SNAPSHOT_ID}" | ||
|
||
return [ | ||
filename: filename, | ||
checksum: filename + '.sha512', | ||
url: "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${DESTINATION}/${filename}".toString(), | ||
version: parts[1], | ||
platform: parts[3], | ||
architecture: parts[4].split('\\.')[0], | ||
license: parts[0] == 'oss' ? 'oss' : 'default', | ||
slackNotifications.onFailure { | ||
node(workers.label('l')) { | ||
catchErrors { | ||
def VERSION | ||
def SNAPSHOT_ID | ||
def DESTINATION | ||
|
||
def scmVars = checkoutEs(ES_BRANCH) | ||
def GIT_COMMIT = scmVars.GIT_COMMIT | ||
def GIT_COMMIT_SHORT = sh(script: "git rev-parse --short ${GIT_COMMIT}", returnStdout: true).trim() | ||
|
||
buildArchives('to-archive') | ||
|
||
dir('to-archive') { | ||
def now = new Date() | ||
def date = now.format("yyyyMMdd-HHmmss") | ||
|
||
def filesRaw = sh(script: "ls -1", returnStdout: true).trim() | ||
def files = filesRaw | ||
.split("\n") | ||
.collect { filename -> | ||
// Filename examples | ||
// elasticsearch-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz | ||
// elasticsearch-8.0.0-SNAPSHOT-linux-x86_64.tar.gz | ||
def parts = filename.replace("elasticsearch-oss", "oss").split("-") | ||
|
||
VERSION = VERSION ?: parts[1] | ||
SNAPSHOT_ID = SNAPSHOT_ID ?: "${date}_${GIT_COMMIT_SHORT}" | ||
DESTINATION = DESTINATION ?: "${VERSION}/archives/${SNAPSHOT_ID}" | ||
|
||
return [ | ||
filename: filename, | ||
checksum: filename + '.sha512', | ||
url: "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${DESTINATION}/${filename}".toString(), | ||
version: parts[1], | ||
platform: parts[3], | ||
architecture: parts[4].split('\\.')[0], | ||
license: parts[0] == 'oss' ? 'oss' : 'default', | ||
] | ||
} | ||
|
||
sh 'find * -exec bash -c "shasum -a 512 {} > {}.sha512" \\;' | ||
|
||
def manifest = [ | ||
bucket: "kibana-ci-es-snapshots-daily/${DESTINATION}".toString(), | ||
branch: ES_BRANCH, | ||
sha: GIT_COMMIT, | ||
sha_short: GIT_COMMIT_SHORT, | ||
version: VERSION, | ||
generated: now.format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC")), | ||
archives: files, | ||
] | ||
def manifestJson = toJSON(manifest).toString() | ||
writeFile file: 'manifest.json', text: manifestJson | ||
|
||
upload(DESTINATION, '*.*') | ||
|
||
sh "cp manifest.json manifest-latest.json" | ||
upload(VERSION, 'manifest-latest.json') | ||
} | ||
|
||
if (PROMOTE_WITHOUT_VERIFY) { | ||
esSnapshots.promote(VERSION, SNAPSHOT_ID) | ||
|
||
emailext( | ||
to: '[email protected]', | ||
subject: "ES snapshot promoted without verification: ${params.ES_BRANCH}", | ||
body: '${SCRIPT,template="groovy-html.template"}', | ||
mimeType: 'text/html', | ||
) | ||
} else { | ||
build( | ||
propagate: false, | ||
wait: false, | ||
job: 'elasticsearch+snapshots+verify', | ||
parameters: [ | ||
string(name: 'branch_specifier', value: branch_specifier), | ||
string(name: 'SNAPSHOT_VERSION', value: VERSION), | ||
string(name: 'SNAPSHOT_ID', value: SNAPSHOT_ID), | ||
] | ||
} | ||
|
||
sh 'find * -exec bash -c "shasum -a 512 {} > {}.sha512" \\;' | ||
|
||
def manifest = [ | ||
bucket: "kibana-ci-es-snapshots-daily/${DESTINATION}".toString(), | ||
branch: ES_BRANCH, | ||
sha: GIT_COMMIT, | ||
sha_short: GIT_COMMIT_SHORT, | ||
version: VERSION, | ||
generated: now.format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC")), | ||
archives: files, | ||
] | ||
def manifestJson = toJSON(manifest).toString() | ||
writeFile file: 'manifest.json', text: manifestJson | ||
|
||
upload(DESTINATION, '*.*') | ||
|
||
sh "cp manifest.json manifest-latest.json" | ||
upload(VERSION, 'manifest-latest.json') | ||
) | ||
} | ||
} | ||
|
||
if (PROMOTE_WITHOUT_VERIFY) { | ||
esSnapshots.promote(VERSION, SNAPSHOT_ID) | ||
|
||
emailext( | ||
to: '[email protected]', | ||
subject: "ES snapshot promoted without verification: ${params.ES_BRANCH}", | ||
body: '${SCRIPT,template="groovy-html.template"}', | ||
mimeType: 'text/html', | ||
) | ||
} else { | ||
build( | ||
propagate: false, | ||
wait: false, | ||
job: 'elasticsearch+snapshots+verify', | ||
parameters: [ | ||
string(name: 'branch_specifier', value: branch_specifier), | ||
string(name: 'SNAPSHOT_VERSION', value: VERSION), | ||
string(name: 'SNAPSHOT_ID', value: SNAPSHOT_ID), | ||
] | ||
) | ||
} | ||
kibanaPipeline.sendMail() | ||
} | ||
|
||
kibanaPipeline.sendMail() | ||
} | ||
} | ||
} | ||
|
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.