From 911d4415add890332ac24dfef837638b93d1b328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Duarte?= Date: Wed, 30 Oct 2024 18:25:37 +0000 Subject: [PATCH] reduce effort during build of docker images there's no need to build jdk-less and windows tarballs for docker images so this change simplifies the build process. It should reduce the time spent needed to build docker images. --- rakelib/artifacts.rake | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/rakelib/artifacts.rake b/rakelib/artifacts.rake index f4a8657c4e4..d8563012a47 100644 --- a/rakelib/artifacts.rake +++ b/rakelib/artifacts.rake @@ -156,6 +156,14 @@ namespace "artifact" do build_zip(*license_details, platform: '-no-jdk') end + desc "Build jdk bundled tar.gz of default logstash plugins with all dependencies for docker" + task "archives_docker" => ["prepare", "generate_build_metadata"] do + license_details = ['ELASTIC-LICENSE'] + @bundles_jdk = true + create_archive_pack(license_details, "x86_64", "linux", "darwin") + create_archive_pack(license_details, "arm64", "linux", "darwin") + end + def create_archive_pack(license_details, arch, *oses) oses.each do |os_name| puts("[artifact:archives] Building tar.gz/zip of default plugins for OS: #{os_name}, arch: #{arch}") @@ -212,6 +220,15 @@ namespace "artifact" do build_zip(*license_details, platform: '-no-jdk') end + desc "Build jdk bundled OSS tar.gz of default logstash plugins with all dependencies for docker" + task "archives_docker_oss" => ["prepare-oss", "generate_build_metadata"] do + #with bundled JDKs + @bundles_jdk = true + license_details = ['APACHE-LICENSE-2.0', "-oss", oss_exclude_paths] + create_archive_pack(license_details, "x86_64", "linux", "darwin") + create_archive_pack(license_details, "arm64", "linux", "darwin") + end + desc "Build an RPM of logstash with all dependencies" task "rpm" => ["prepare", "generate_build_metadata"] do #with bundled JDKs @@ -299,25 +316,25 @@ namespace "artifact" do end desc "Build docker image" - task "docker" => ["prepare", "generate_build_metadata", "archives"] do + task "docker" => ["prepare", "generate_build_metadata", "archives_docker"] do puts("[docker] Building docker image") build_docker('full') end desc "Build OSS docker image" - task "docker_oss" => ["prepare-oss", "generate_build_metadata", "archives_oss"] do + task "docker_oss" => ["prepare-oss", "generate_build_metadata", "archives_docker_oss"] do puts("[docker_oss] Building OSS docker image") build_docker('oss') end desc "Build UBI8 docker image" - task "docker_ubi8" => %w(prepare generate_build_metadata archives) do + task "docker_ubi8" => %w(prepare generate_build_metadata archives_docker) do puts("[docker_ubi8] Building UBI docker image") build_docker('ubi8') end desc "Build wolfi docker image" - task "docker_wolfi" => %w(prepare generate_build_metadata archives) do + task "docker_wolfi" => %w(prepare generate_build_metadata archives_docker) do puts("[docker_wolfi] Building Wolfi docker image") build_docker('wolfi') end