packaging script and rake task

This commit is contained in:
Jon Ruskin 2018-06-20 16:14:26 -07:00
Родитель bd0a0e00c1
Коммит 5406e8d986
2 изменённых файлов: 33 добавлений и 0 удалений

Просмотреть файл

@ -52,6 +52,24 @@ namespace :test do
end
end
task :package, [:target] do |task, args|
target = args[:target]
target = "*" if target.nil? || target.empty?
Dir["script/packages/#{target}"].each do |script|
puts "Building #{script}"
if Bundler.with_original_env { system(script) }
# green
puts "\033[32mCompleted #{script}.\e[0m"
else
# red
puts "\033[31mEncountered an error running #{script}.\e[0m"
end
puts
end
end
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"

15
script/package Executable file
Просмотреть файл

@ -0,0 +1,15 @@
#!/bin/bash
#/ Usage: script/package [PLATFORM] [VERSION]
#/
#/ Builds distributable packages for licensed.
#/ Packages are of the form licensed-$VERSION-$PLATFORM-x64.tar.gz and contain a `./licensed` executable
#/ Built packages are placed in the <root>/pkg directory.
#/
#/ OPTIONS:
#/ [PLATFORM] (optional, default to all platforms) platform to build exe for
#/ [VERSION] (optional, default to current git branch or SHA1) version of licensed to build exe at
#/
set -e
bundle exec rake package["$1"]