From 116d08303e73b250d854ad0f66d37fe7e98a4d62 Mon Sep 17 00:00:00 2001 From: Andy Bristol Date: Tue, 29 May 2018 17:32:06 -0700 Subject: [PATCH] stable filemode for zip distributions (#30854) Applies default file and directory permissions to zip distributions similar to how they're set for the tar distributions. Previously zip distributions would retain permissions they had on the build host's working tree, which could vary depending on its umask For #30799 --- distribution/archives/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index ae4e6a431c977..c1097b68b898f 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -106,15 +106,23 @@ tasks.withType(AbstractArchiveTask) { baseName = "elasticsearch${ subdir.contains('oss') ? '-oss' : ''}" } +Closure commonZipConfig = { + dirMode 0755 + fileMode 0644 +} + task buildIntegTestZip(type: Zip) { + configure(commonZipConfig) with archiveFiles(transportModulesFiles, 'zip', false) } task buildZip(type: Zip) { + configure(commonZipConfig) with archiveFiles(modulesFiles(false), 'zip', false) } task buildOssZip(type: Zip) { + configure(commonZipConfig) with archiveFiles(modulesFiles(true), 'zip', true) }