зеркало из https://github.com/github/licensed.git
packaging script and rake task
This commit is contained in:
Родитель
bd0a0e00c1
Коммит
5406e8d986
18
Rakefile
18
Rakefile
|
@ -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"
|
||||
|
|
|
@ -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"]
|
Загрузка…
Ссылка в новой задаче