forked from noam-io/host
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
78 lines (62 loc) · 2.46 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#Copyright (c) 2014, IDEO
require 'rubygems'
require 'bundler'
Bundler.setup(:default, :release)
require 'releasy'
$LOAD_PATH << "./lib"
require 'releasy/noam_osx_app'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :all_tests
task :all_tests => ['spec', 'jasmine:ci'] do
end
begin
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
rescue LoadError
task :jasmine do
abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
end
end
NOAM_VERSION = "0.2.1"
NOAM_OSX_ID = "noam.io.host"
NOAM_OSX_APP_NAME = "Noam"
Releasy::Project.new do
name NOAM_OSX_APP_NAME
version NOAM_VERSION
verbose
executable "bin/noamweb"
files ["bin/noamweb", "config/**/*", "lib/**/*.rb", "web/**/*.*"]
exposed_files []
add_link "https://github.com/ideo/noam", "Noam Server code"
exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this.
add_build :noam_osx_app do
gemspecs Bundler.definition.specs_for([:default, :mongo]).to_a
url NOAM_OSX_ID
icon "Noam.icns"
# After cloning & building https://github.com/trptcolin/ruby_app we expect
# this wrapper to be the output of `tar -zcvf ruby-mac-wrapper-YYYY-MM-DD.tar.gz ./Ruby.app`
# in that directory. The .tar.gz filename is flexible as long as it matches
# between the actual file and this wrapper specification.
wrapper "wrappers/ruby-mac-wrapper-2014-02-11.tar.gz"
add_package :tar_gz
end
add_deploy :local # Only deploy locally (no rsync).
end
namespace :installer do
desc "Create OSX Installer for Noam"
task :osx => ["build:noam:osx:app"] do
version = NOAM_VERSION
folder_containing_app = "./pkg/noam_#{version.gsub(".", "_")}_OSX"
# NOTE: Once we need to run scripts, the --scripts flag lets us specify a
# scripts directory for bash scripts named things like preflight,
# postflight, etc. to run at those times.
FileUtils.mkdir_p('./pkg/Noam')
system %[pkgbuild --root "#{folder_containing_app}/#{NOAM_OSX_APP_NAME}.app" \\
--install-location "/Applications/#{NOAM_OSX_APP_NAME}.app" \\
--version #{version} \\
--identifier #{NOAM_OSX_ID} \\
./pkg/Noam/Install#{NOAM_OSX_APP_NAME}.pkg]
system %[hdiutil create -volname Noam ./pkg/#{NOAM_OSX_APP_NAME}-v#{NOAM_VERSION}.dmg -srcfolder ./pkg/Noam -format UDZO -imagekey zlib-level=9]
end
end