Skip to content

Commit

Permalink
Merge pull request #681 from Fryguy/release_check
Browse files Browse the repository at this point in the history
Add a check that the release version matches the deployment yml
  • Loading branch information
bdunne committed May 7, 2024
2 parents cc7e2b3 + 1470b7b commit 8f631bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/tasks/production.rake
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ task :release, [:version, :remote] => "production:set_context" do |_t, args|

remote = args[:remote] || "upstream"

puts "Ensuring version number..."
unless File.readlines("templates/bot.yaml").grep(/image: .+miq_bot:v/).all? { |l| l.include?("miq_bot:#{version}") }
$stderr.puts "ERROR: images in templates/bot.yaml have not been updated to the expected version"
exit 1
end

puts "Deploying version #{version}..."

puts
Expand All @@ -140,7 +146,7 @@ task :release, [:version, :remote] => "production:set_context" do |_t, args|

puts
puts "Building docker image..."
exit 1 unless system("docker build . --no-cache -t #{image}")
exit 1 unless system("docker build . --no-cache --build-arg REF=#{version} -t #{image}")
puts
puts "Pushing docker image..."
exit 1 unless system("docker login") && system("docker push #{image}")
Expand Down

0 comments on commit 8f631bf

Please sign in to comment.