Plugins: Changing staging property to be the hash instead of a boolean

With the unified release, we will have staged releases based on a
unified hash (hash of all the hashes), so using the elasticsearch hash
for plugins staging will no longer work. This change makes the
`es.plugins.staging` property take the staging hash it should use.
This commit is contained in:
Ryan Ernst 2016-05-25 12:36:31 -07:00
parent edfbdf2748
commit 478877edf7
1 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,6 @@ import org.apache.lucene.util.IOUtils;
import org.elasticsearch.Build;
import org.elasticsearch.Version;
import org.elasticsearch.bootstrap.JarHell;
import org.elasticsearch.cli.Command;
import org.elasticsearch.cli.ExitCodes;
import org.elasticsearch.cli.SettingCommand;
import org.elasticsearch.cli.Terminal;
@ -101,7 +100,7 @@ import static org.elasticsearch.common.util.set.Sets.newHashSet;
*/
class InstallPluginCommand extends SettingCommand {
private static final String PROPERTY_SUPPORT_STAGING_URLS = "es.plugins.staging";
private static final String PROPERTY_STAGING_ID = "es.plugins.staging";
// TODO: make this a resource file generated by gradle
static final Set<String> MODULES = unmodifiableSet(newHashSet(
@ -209,12 +208,13 @@ class InstallPluginCommand extends SettingCommand {
if (OFFICIAL_PLUGINS.contains(pluginId)) {
final String version = Version.CURRENT.toString();
final String url;
if (System.getProperty(PROPERTY_SUPPORT_STAGING_URLS, "false").equals("true")) {
final String stagingHash = System.getProperty(PROPERTY_STAGING_ID);
if (stagingHash != null) {
url = String.format(
Locale.ROOT,
"https://download.elastic.co/elasticsearch/staging/%1$s-%2$s/org/elasticsearch/plugin/%3$s/%1$s/%3$s-%1$s.zip",
version,
Build.CURRENT.shortHash(),
stagingHash,
pluginId);
} else {
url = String.format(