-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile.rb
More file actions
55 lines (47 loc) · 1.45 KB
/
Rakefile.rb
File metadata and controls
55 lines (47 loc) · 1.45 KB
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
require 'rake'
require 'albacore'
load 'RakeShared.rb'
$projectSolution = 'src/Accountability.sln'
$artifactsPath = "build"
$nugetFeedPath = ENV["NuGetDevFeed"]
$srcPath = File.expand_path('src')
$webZip = 'Web.zip'
$environment = 'dev'
task :teamcity => [:build_release]
desc "Build and package the project"
task :build => [:build_release, :package_web]
msbuild :build_release => [:clean, :dep] do |msb|
msb.properties :configuration => :Release
msb.targets :Build
msb.solution = $projectSolution
end
task :clean do
puts "Cleaning"
FileUtils.rm_rf $artifactsPath
bins = FileList[File.join($srcPath, "**/bin")].map{|f| File.expand_path(f)}
bins.each do |file|
sh %Q{rmdir /S /Q "#{file}"}
end
end
desc "Setup dependencies for nuget packages"
task :dep do
package_folder = File.expand_path('src/Packages')
packages = FileList["**/packages.config"].map{|f| File.expand_path(f)}
packages.each do |file|
sh %Q{nuget install #{file} /OutputDirectory #{package_folder}}
end
end
desc "Backup mongo database"
task :mongobackup do
sh "mongodump -d Accountability -o mongobackup"
end
task :package_web do
package = PackageManager.new()
package.sourcePath = 'src/Web/'
package.configFileName = 'Web.config'
package.artifactsPath = $artifactsPath
package.environment = $environment
package.zip.exclusions = [/Web\/Web.config/, /\.cs$/, /\.log$/, /obj/, /Properties/, /\.csproj/, /bin\/.*\.xml$/]
package.zipFile = $webZip
package.BuildZip()
end