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

reduce effort during build of docker images #16619

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions rakelib/artifacts.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down