Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify signatures on official plugins #30800

Merged
merged 16 commits into from
May 25, 2018
4 changes: 3 additions & 1 deletion distribution/archives/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ task createPluginsDir(type: EmptyDirTask) {
CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, boolean oss) {
return copySpec {
into("elasticsearch-${version}") {
with libFiles
into('lib') {
with libFiles
}
into('config') {
dirMode 0750
fileMode 0660
Expand Down
18 changes: 8 additions & 10 deletions distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,14 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
* Common files in all distributions *
*****************************************************************************/
libFiles = copySpec {
into('lib') {
// delay by using closures, since they have not yet been configured, so no jar task exists yet
from { project(':server').jar }
from { project(':server').configurations.runtime }
from { project(':libs:plugin-classloader').jar }
from { project(':distribution:tools:launchers').jar }
into('tools/plugin-cli') {
from { project(':distribution:tools:plugin-cli').jar }
from { project(':distribution:tools:plugin-cli').configurations.runtime }
}
// delay by using closures, since they have not yet been configured, so no jar task exists yet
from { project(':server').jar }
from { project(':server').configurations.runtime }
from { project(':libs:plugin-classloader').jar }
from { project(':distribution:tools:launchers').jar }
into('tools/plugin-cli') {
from { project(':distribution:tools:plugin-cli').jar }
from { project(':distribution:tools:plugin-cli').configurations.runtime }
}
}

Expand Down
24 changes: 17 additions & 7 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,27 @@ Closure commonPackageConfig(String type, boolean oss) {
from(rootProject.projectDir) {
include 'README.textile'
}
into('lib') {
with copySpec {
with libFiles
// we need to specify every intermediate directory so we iterate through the parents; duplicate calls with the same part are fine
eachFile { FileCopyDetails fcp ->
String[] segments = fcp.relativePath.segments
for (int i = segments.length - 2; i > 0 && segments[i] != 'lib'; --i) {
System.out.println(segments[0..i])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover println

directory('/' + segments[0..i].join('/'), 0755)
}
}
}
}
into('modules') {
with copySpec {
with modulesFiles(oss)
// we need to specify every intermediate directory, but modules could have sub directories
// and there might not be any files as direct children of intermediates (eg platform)
// so we must iterate through the parents, but duplicate calls with the same path
// are ok (they don't show up in the built packages)
// we need to specify every intermediate directory so we iterate through the parents; duplicate calls with the same part are fine
eachFile { FileCopyDetails fcp ->
String[] segments = fcp.relativePath.segments
for (int i = segments.length - 2; i > 0 && segments[i] != 'modules'; --i) {
System.out.println(segments[0..i])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover println

directory('/' + segments[0..i].join('/'), 0755)
}
}
Expand Down Expand Up @@ -241,8 +252,8 @@ ospackage {
signingKeyId = project.hasProperty('signing.keyId') ? project.property('signing.keyId') : 'D88E42B4'
signingKeyPassphrase = project.property('signing.password')
signingKeyRingFile = project.hasProperty('signing.secretKeyRingFile') ?
project.file(project.property('signing.secretKeyRingFile')) :
new File(new File(System.getProperty('user.home'), '.gnupg'), 'secring.gpg')
project.file(project.property('signing.secretKeyRingFile')) :
new File(new File(System.getProperty('user.home'), '.gnupg'), 'secring.gpg')
}

requires('coreutils')
Expand All @@ -253,7 +264,6 @@ ospackage {
permissionGroup 'root'

into '/usr/share/elasticsearch'
with libFiles
with noticeFile
}

Expand Down