From 5932ca3b1bfed2ff555032610814fbd957610e54 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 28 Mar 2014 18:35:10 +0100 Subject: [PATCH 1/4] Create branches according to elasticsearch versions We create branches: * es-0.90 for elasticsearch 0.90 * es-1.0 for elasticsearch 1.0 * es-1.1 for elasticsearch 1.1 * master for elasticsearch master We also check that before releasing we don't have a dependency to an elasticsearch SNAPSHOT version. Add links to each version in documentation (cherry picked from commit 22465d2) --- README.md | 11 +++++-- dev-tools/build_release.py | 29 +++++++++++++++++++ pom.xml | 2 +- .../JavaScriptScriptSearchTests.java | 3 -- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a5120e6..8d12b6f 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,21 @@ The JavaScript language plugin allows to have `javascript` (or `js`) as the lang In order to install the plugin, simply run: `bin/plugin -install elasticsearch/elasticsearch-lang-javascript/2.0.0.RC1`. -* For 1.0.x elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/master). -* For 0.90.x elasticsearch versions, look at [1.x branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/1.x). +* For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/master). +* For 1.1.x elasticsearch versions, look at [es-1.1 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-1.1). +* For 1.0.x elasticsearch versions, look at [es-1.0 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-1.0). +* For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-0.90). | JavaScript Lang Plugin | elasticsearch | rhino | Release date | |-----------------------------|---------------------|----------|:------------:| | 2.0.0-SNAPSHOT | 1.0.0.RC1 -> master | 1.7R4 | XXXX-XX-XX | | 2.0.0.RC1 | 1.0.0.RC1 -> master | 1.7R4 | 2014-01-15 | +Please read documentation relative to the version you are using: + +* [2.0.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/es-1.0/README.md) +* [2.0.0.RC1](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/v2.0.0.RC1/README.md) + Using javascript with function_score ------------------------------------ diff --git a/dev-tools/build_release.py b/dev-tools/build_release.py index 74acd8c..db83454 100755 --- a/dev-tools/build_release.py +++ b/dev-tools/build_release.py @@ -208,6 +208,29 @@ def callback(line): return line process_file(readme_file, callback) +# Moves the README.md file from a snapshot to a release (documentation link) +def remove_documentation_snapshot(readme_file, repo_url, release, branch): + pattern = '* [%s-SNAPSHOT](%sblob/%s/README.md)' % (release, repo_url, branch) + replacement = '* [%s](%sblob/v%s/README.md)' % (release, repo_url, release) + def callback(line): + # If we find pattern, we replace its content + if line.find(pattern) >= 0: + return line.replace(pattern, replacement) + else: + return line + process_file(readme_file, callback) + +# Add in README.markdown file the documentation for the next version +def add_documentation_snapshot(readme_file, repo_url, release, snapshot, branch): + pattern = '* [%s](%sblob/v%s/README.md)' % (release, repo_url, release) + replacement = '* [%s-SNAPSHOT](%sblob/%s/README.md)' % (snapshot, repo_url, branch) + def callback(line): + # If we find pattern, we copy the line and replace its content + if line.find(pattern) >= 0: + return line.replace(pattern, replacement)+line + else: + return line + process_file(readme_file, callback) # Set release date in README.md file def set_date(readme_file): @@ -603,8 +626,12 @@ def check_email_settings(): artifact_name = find_from_pom('name') artifact_description = find_from_pom('description') project_url = find_from_pom('url') + elasticsearch_version = find_from_pom('elasticsearch.version') print(' Artifact Id: [%s]' % artifact_id) print(' Release version: [%s]' % release_version) + print(' Elasticsearch: [%s]' % elasticsearch_version) + if elasticsearch_version.find('-SNAPSHOT') != -1: + raise RuntimeError('Can not release with a SNAPSHOT elasticsearch dependency: %s' % elasticsearch_version) # extract snapshot default_snapshot_version = guess_snapshot(release_version) @@ -626,6 +653,7 @@ def check_email_settings(): try: pending_files = [POM_FILE, README_FILE] remove_maven_snapshot(POM_FILE, release_version) + remove_documentation_snapshot(README_FILE, project_url, release_version, src_branch) remove_version_snapshot(README_FILE, release_version) set_date(README_FILE) set_install_instructions(README_FILE, artifact_id, release_version) @@ -657,6 +685,7 @@ def check_email_settings(): add_maven_snapshot(POM_FILE, release_version, snapshot_version) add_version_snapshot(README_FILE, release_version, snapshot_version) + add_documentation_snapshot(README_FILE, project_url, release_version, snapshot_version, src_branch) add_pending_files(*pending_files) commit_snapshot() diff --git a/pom.xml b/pom.xml index 0491010..b1056cf 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 1.0.1 - 4.7.0 + 4.6.1 1 true onerror diff --git a/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptSearchTests.java b/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptSearchTests.java index f8918d4..d8eebd7 100644 --- a/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptSearchTests.java +++ b/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptSearchTests.java @@ -44,7 +44,6 @@ public class JavaScriptScriptSearchTests extends ElasticsearchIntegrationTest { @Test public void testJavaScriptFilter() throws Exception { - wipeIndices("test"); createIndex("test"); index("test", "type1", "1", jsonBuilder().startObject().field("test", "value beck").field("num1", 1.0f).endObject()); flush(); @@ -95,7 +94,6 @@ public void testJavaScriptFilter() throws Exception { @Test public void testScriptFieldUsingSource() throws Exception { - wipeIndices("test"); createIndex("test"); index("test", "type1", "1", jsonBuilder().startObject() @@ -130,7 +128,6 @@ public void testScriptFieldUsingSource() throws Exception { @Test public void testCustomScriptBoost() throws Exception { - wipeIndices("test"); createIndex("test"); index("test", "type1", "1", jsonBuilder().startObject().field("test", "value beck").field("num1", 1.0f).endObject()); index("test", "type1", "2", jsonBuilder().startObject().field("test", "value beck").field("num1", 2.0f).endObject()); From 6d6aa6e8122e08641e85a65a11ed28ea4fb73eb3 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 28 Mar 2014 18:35:10 +0100 Subject: [PATCH 2/4] Update to elasticsearch 1.1.0 Closes #18. --- README.md | 6 ++---- pom.xml | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8d12b6f..3cb3dcc 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,11 @@ In order to install the plugin, simply run: `bin/plugin -install elasticsearch/e | JavaScript Lang Plugin | elasticsearch | rhino | Release date | |-----------------------------|---------------------|----------|:------------:| -| 2.0.0-SNAPSHOT | 1.0.0.RC1 -> master | 1.7R4 | XXXX-XX-XX | -| 2.0.0.RC1 | 1.0.0.RC1 -> master | 1.7R4 | 2014-01-15 | +| 2.1.0-SNAPSHOT | 1.1.0 -> 1.1 | 1.7R4 | XXXX-XX-XX | Please read documentation relative to the version you are using: -* [2.0.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/es-1.0/README.md) -* [2.0.0.RC1](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/v2.0.0.RC1/README.md) +* [2.1.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/es-1.1/README.md) Using javascript with function_score ------------------------------------ diff --git a/pom.xml b/pom.xml index b1056cf..d9b7335 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.elasticsearch elasticsearch-lang-javascript - 2.0.0-SNAPSHOT + 2.1.0-SNAPSHOT jar Elasticsearch JavaScript language plugin The JavaScript language plugin allows to have javascript as the language of scripts to execute. @@ -32,8 +32,8 @@ - 1.0.1 - 4.6.1 + 1.1.0 + 4.7.0 1 true onerror From 7cc97efd30a14e4f16a3764df5efdf933fb6e07f Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 28 Mar 2014 19:19:23 +0100 Subject: [PATCH 3/4] prepare release elasticsearch-lang-javascript-2.1.0 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3cb3dcc..79908f6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ JavaScript lang Plugin for Elasticsearch The JavaScript language plugin allows to have `javascript` (or `js`) as the language of scripts to execute. -In order to install the plugin, simply run: `bin/plugin -install elasticsearch/elasticsearch-lang-javascript/2.0.0.RC1`. +In order to install the plugin, simply run: `bin/plugin -install elasticsearch/elasticsearch-lang-javascript/2.1.0`. * For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/master). * For 1.1.x elasticsearch versions, look at [es-1.1 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-1.1). @@ -12,11 +12,11 @@ In order to install the plugin, simply run: `bin/plugin -install elasticsearch/e | JavaScript Lang Plugin | elasticsearch | rhino | Release date | |-----------------------------|---------------------|----------|:------------:| -| 2.1.0-SNAPSHOT | 1.1.0 -> 1.1 | 1.7R4 | XXXX-XX-XX | +| 2.1.0 | 1.1.0 -> 1.1 | 1.7R4 | 2014-03-28 | Please read documentation relative to the version you are using: -* [2.1.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/es-1.1/README.md) +* [2.1.0](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/v2.1.0/README.md) Using javascript with function_score ------------------------------------ diff --git a/pom.xml b/pom.xml index d9b7335..89787a2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.elasticsearch elasticsearch-lang-javascript - 2.1.0-SNAPSHOT + 2.1.0 jar Elasticsearch JavaScript language plugin The JavaScript language plugin allows to have javascript as the language of scripts to execute. From e81654a49671c1d428c39109ea973bf95521299a Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 28 Mar 2014 19:20:54 +0100 Subject: [PATCH 4/4] prepare for next development iteration --- README.md | 2 ++ pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 79908f6..e50120a 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,12 @@ In order to install the plugin, simply run: `bin/plugin -install elasticsearch/e | JavaScript Lang Plugin | elasticsearch | rhino | Release date | |-----------------------------|---------------------|----------|:------------:| +| 2.1.1-SNAPSHOT | 1.1.0 -> 1.1 | 1.7R4 | XXXX-XX-XX | | 2.1.0 | 1.1.0 -> 1.1 | 1.7R4 | 2014-03-28 | Please read documentation relative to the version you are using: +* [2.1.1-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/es-1.1/README.md) * [2.1.0](https://github.com/elasticsearch/elasticsearch-lang-javascript/blob/v2.1.0/README.md) Using javascript with function_score diff --git a/pom.xml b/pom.xml index 89787a2..4f525c3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.elasticsearch elasticsearch-lang-javascript - 2.1.0 + 2.1.1-SNAPSHOT jar Elasticsearch JavaScript language plugin The JavaScript language plugin allows to have javascript as the language of scripts to execute.