Skip to content

Commit

Permalink
build: Rewrite dev container tasks to more idiomatic Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisklein committed Feb 3, 2025
1 parent 4412a8a commit 7d44436
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ task default: %i[rubocop spec integration]

desc 'Build the ONA development container with podman'
task :build_onadev_container do
unless system('podman image exists localhost/ona-dev:latest')
system('podman login docker.io')
`git clone https://github.com/opennetadmin/ona onadev`
`podman build --build-arg UBUNTU_VERSION=24.04 -t ona-dev:latest onadev`
`rm -rf onadev`
require 'fileutils'
require 'tmpdir'
sh 'podman login docker.io'
dir = Dir.mktmpdir
begin
sh "git clone --depth 1 https://github.com/opennetadmin/ona #{dir}"
sh "podman build --build-arg UBUNTU_VERSION=24.04 -t ona-dev:latest #{dir}"
ensure
FileUtils.remove_entry dir
end
end

desc 'Publish ONA development container to ghcr.io'
task publish_onadev_container_to_ghcr: :build_onadev_container do
system('podman login ghcr.io')
`podman image push localhost/ona-dev:latest docker://ghcr.io/gsi-hpc/ona-dev:latest`
sh 'podman login ghcr.io'
sh 'podman image push localhost/ona-dev:latest docker://ghcr.io/gsi-hpc/ona-dev:latest'
end

RSpec::Core::RakeTask.new(:integration) do |task|
Expand Down

0 comments on commit 7d44436

Please sign in to comment.