Skip to content

Commit

Permalink
Add option to upload only a single platform
Browse files Browse the repository at this point in the history
  • Loading branch information
nmburgan committed Dec 18, 2024
1 parent 9500443 commit 2d17e76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tasks/upload.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ require 'open3'

namespace :overlookinfra do
desc "Upload artifacts from the output directory to S3. Requires the AWS CLI to be installed and configured appropriately."
task :upload, [:tag] do |t, args|
task :upload, [:tag, :platform] do |t, args|
endpoint = ENV['ENDPOINT_URL']
bucket = ENV['BUCKET_NAME']
platform = args[:platform] || ''

if endpoint.nil? || endpoint.empty?
abort "You must set the ENDPOINT_URL environment variable to the S3 server you want to upload to."
Expand All @@ -21,7 +22,7 @@ namespace :overlookinfra do
# Ensure the AWS CLI isn't going to fail with the given parameters
run_command("#{s3} ls s3://#{bucket}/")

files = Dir.glob("#{__dir__}/../output/*#{munged_tag}*")
files = Dir.glob("#{__dir__}/../output/*#{munged_tag}*#{platform}*")
if files.empty?
puts "No files for the given tag found in the output directory."
end
Expand Down

0 comments on commit 2d17e76

Please sign in to comment.