From e7e7e53fadf84dc4cee1b97ea490089193ee6a5f Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 20 Mar 2018 22:06:05 -0700 Subject: [PATCH] Build: Remove public license key and inject it during release builds (elastic/x-pack-elasticsearch#3916) This commit moves the dev key into core and renames to make it clear it is for snapshots, and makes the production key a required parameter of release builds. Original commit: elastic/x-pack-elasticsearch@ea299bd5a2b11934889fc484ced7b8a2c993c0f7 --- plugin/core/build.gradle | 12 +++++++++--- plugin/{keys/dev/public.key => core/snapshot.key} | 0 plugin/keys/prod/public.key | 3 --- 3 files changed, 9 insertions(+), 6 deletions(-) rename plugin/{keys/dev/public.key => core/snapshot.key} (100%) delete mode 100644 plugin/keys/prod/public.key diff --git a/plugin/core/build.gradle b/plugin/core/build.gradle index c5d616b34ee..ffdd3303531 100644 --- a/plugin/core/build.gradle +++ b/plugin/core/build.gradle @@ -58,10 +58,16 @@ processResources { MavenFilteringHack.filter(it, expansions) } boolean snapshot = "true".equals(System.getProperty("build.snapshot", "true")) - if (snapshot) { - from '../keys/dev/public.key' + String licenseKey = System.getProperty("license.key") + if (licenseKey != null) { + println "Using provided license key from ${licenseKey}" + } else if (snapshot) { + licenseKey = 'snapshot.key' } else { - from '../keys/prod/public.key' + throw new IllegalArgumentException('Property license.key must be set for release build') + } + from(licenseKey) { + rename { String filename -> 'public.key' } } } diff --git a/plugin/keys/dev/public.key b/plugin/core/snapshot.key similarity index 100% rename from plugin/keys/dev/public.key rename to plugin/core/snapshot.key diff --git a/plugin/keys/prod/public.key b/plugin/keys/prod/public.key deleted file mode 100644 index cf62043826c..00000000000 --- a/plugin/keys/prod/public.key +++ /dev/null @@ -1,3 +0,0 @@ -qngwM}UiK0b2![Cצ4O9 0'Q]b0qI0H7aTul05&jvХ[]%Q'/Q;Q` [1X^sAvl