mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-04 13:52:06 +08:00
Adds `setup-vhost-block-backend` and accompanying library. These download and install Ubiblk to `/opt/vhost-block-backend/$version`. Usage: ``` /path/to/setup-vhost-block-backend verb version ``` - `verb`: currently only supported verb is `install`. - `version`: Ubiblk version
26 lines
476 B
Ruby
Executable file
26 lines
476 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require_relative "../../common/lib/util"
|
|
require_relative "../lib/vhost_block_backend"
|
|
require "fileutils"
|
|
|
|
unless (verb = ARGV.shift)
|
|
puts "expected verb as argument"
|
|
exit 1
|
|
end
|
|
|
|
unless (version = ARGV.shift)
|
|
puts "expected version as argument"
|
|
exit 1
|
|
end
|
|
|
|
vhost_block_backend = VhostBlockBackend.new(version)
|
|
|
|
case verb
|
|
when "install"
|
|
vhost_block_backend.download
|
|
else
|
|
puts "Unknown verb: #{verb}"
|
|
exit 1
|
|
end
|