albacore 2.0.0.rc.17 → 2.0.0.rc.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +37 -0
- data/albacore.gemspec +1 -4
- data/lib/albacore/app_spec.rb +2 -0
- data/lib/albacore/cpack_app_spec.rb +155 -0
- data/lib/albacore/cross_platform_cmd.rb +0 -10
- data/lib/albacore/dsl.rb +15 -6
- data/lib/albacore/errors/invalid_app_spec_error.rb +4 -0
- data/lib/albacore/fpm_app_spec.rb +54 -15
- data/lib/albacore/tools/fluent_migrator.rb +0 -1
- data/lib/albacore/version.rb +1 -1
- data/resources/chocolateyInstall.ps1 +120 -0
- data/spec/dsl_spec.rb +1 -1
- data/spec/test_appspecs/.gitignore +6 -0
- data/spec/test_appspecs/corp.service/.gitignore +1 -0
- data/spec/test_appspecs/corp.service/Gemfile +3 -0
- data/spec/test_appspecs/corp.service/Rakefile +18 -0
- data/spec/test_appspecs/corp.service/corp.service.svc.sln +20 -0
- data/spec/test_appspecs/corp.service/corp.service.svc/.appspec +3 -0
- data/spec/test_appspecs/corp.service/corp.service.svc/App.config +17 -0
- data/spec/test_appspecs/corp.service/corp.service.svc/Program.fs +7 -0
- data/spec/test_appspecs/corp.service/corp.service.svc/corp.service.svc.fsproj +62 -0
- data/spec/test_appspecs/corp.service/corp.service.svc/corp.service.svc.sln +20 -0
- metadata +26 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3adb7ca26eb58c83011c056ec55d4fe3022225d7
|
4
|
+
data.tar.gz: 9d32ba36a45484bc4b9d3f4266c8fed4a69abb62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac4d76af91d85c459b9acb7d8f5c705e0d65604ae805c770db33109436b67a80548c83e9f6e704760a6eb9837571392b614258894a8366187b5e38be2227efc
|
7
|
+
data.tar.gz: 1d23c2bb643d2381d1d981e9b9ed1949a7e201ecfe15802526e9244f84339e59f21da71e7448507f69ae5a1a1b5515a75f3ba9fcba5874b7b211c91ad135683b
|
data/README.md
CHANGED
@@ -263,6 +263,43 @@ end
|
|
263
263
|
|
264
264
|
TBD
|
265
265
|
|
266
|
+
### Docs: appspecs
|
267
|
+
|
268
|
+
Example rakefile (see spec/test_appspecs/corp.service in albacore source).
|
269
|
+
|
270
|
+
```
|
271
|
+
require 'bundler/setup'
|
272
|
+
require 'albacore'
|
273
|
+
|
274
|
+
Configuration = ENV['CONFIGURATION'] || 'Release'
|
275
|
+
|
276
|
+
desc 'build example project'
|
277
|
+
build :compile do |b|
|
278
|
+
b.sln = 'corp.service.svc.sln'
|
279
|
+
b.prop 'Configuration', Configuration
|
280
|
+
end
|
281
|
+
|
282
|
+
desc 'build service packages from all the appspecs'
|
283
|
+
appspecs :services => :compile do |as|
|
284
|
+
as.files = Dir.glob '**/.appspec', File::FNM_DOTMATCH
|
285
|
+
as.out = 'build'
|
286
|
+
end
|
287
|
+
|
288
|
+
task :default => :services
|
289
|
+
```
|
290
|
+
|
291
|
+
This example Rakefile will create RPMs on RHEL-derivative systems, DEBs on
|
292
|
+
Debian-derivative systems and Chocolatey packages on Windows, as well as publish
|
293
|
+
those packages to the CI server.
|
294
|
+
|
295
|
+
As usual you can use Albacore.subscribe to jack into the output of this
|
296
|
+
task-type, if you e.g. want to publish your packages to your package server -
|
297
|
+
DAB or YUM. If you include the TeamCity extension, your TeamCity server will
|
298
|
+
automatically become a chocolatey package server that you can use
|
299
|
+
[puppet-chocolatey](git@github.com:karaaie/puppet-chocolatey.git) to install the
|
300
|
+
packages of on your Windows boxen. Or you can use puppet proper with a yum repo
|
301
|
+
on your linux boxen.
|
302
|
+
|
266
303
|
## Tasks
|
267
304
|
|
268
305
|
Tasks are things you can include that create singleton ruby tasks that are
|
data/albacore.gemspec
CHANGED
@@ -24,15 +24,12 @@ EOF
|
|
24
24
|
s.add_dependency 'rake', '>10' # this gem builds on rake
|
25
25
|
s.add_dependency 'map', '~>6.5' # https://github.com/ahoward/map for options handling
|
26
26
|
s.add_dependency 'nokogiri', '~> 1.5' # used to manipulate and read *proj files
|
27
|
-
s.add_dependency 'facter', '~> 1.7' # used to gather system data
|
28
27
|
s.add_dependency 'semver2', '~> 3.3'
|
29
|
-
s.add_dependency 'ProcessPilot', '~> 2.0'
|
30
|
-
s.add_dependency 'highline', '~> 1.6'
|
31
28
|
|
32
29
|
s.add_development_dependency 'rubygems-tasks', '~>0.2'
|
33
30
|
s.add_development_dependency 'rspec', '>= 2.13'
|
34
31
|
|
35
|
-
s.files = `git ls-files`.split("\n")
|
32
|
+
s.files = `git ls-files`.split("\n").concat(Dir.glob('./resources/**'))
|
36
33
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
37
34
|
# s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
38
35
|
s.require_paths = ['lib']
|
data/lib/albacore/app_spec.rb
CHANGED
@@ -0,0 +1,155 @@
|
|
1
|
+
require 'albacore/app_spec'
|
2
|
+
require 'albacore/errors/invalid_app_spec_error'
|
3
|
+
require 'map'
|
4
|
+
|
5
|
+
module Albacore
|
6
|
+
class CpackAppSpec
|
7
|
+
end
|
8
|
+
|
9
|
+
class CpackAppSpec::Config
|
10
|
+
# create a new configuration for multiple xxproj-s to be packed with fpm into .deb/.rpm
|
11
|
+
def initialize
|
12
|
+
@files = []
|
13
|
+
@out = '.'
|
14
|
+
@configuration = 'Release'
|
15
|
+
end
|
16
|
+
|
17
|
+
# set the output path, defaults to '.'
|
18
|
+
def out= out
|
19
|
+
@out = out
|
20
|
+
end
|
21
|
+
|
22
|
+
# give the configuration a list of files to match
|
23
|
+
def files= files
|
24
|
+
@files = files
|
25
|
+
end
|
26
|
+
|
27
|
+
def configuration= conf
|
28
|
+
@configuration = conf
|
29
|
+
end
|
30
|
+
|
31
|
+
def opts
|
32
|
+
Map.new bundler: @bundler,
|
33
|
+
files: @files,
|
34
|
+
out: @out,
|
35
|
+
configuration: @configuration
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class CpackAppSpec::Task
|
40
|
+
include ::Albacore::Logging
|
41
|
+
include ::Albacore::CrossPlatformCmd
|
42
|
+
|
43
|
+
# create a new task instance with the given opts
|
44
|
+
def initialize opts
|
45
|
+
raise ArgumentError, 'opts is nil' if opts.nil?
|
46
|
+
@opts = opts
|
47
|
+
end
|
48
|
+
|
49
|
+
def execute
|
50
|
+
warn 'executing cpack app spec task, but there are no input files [cpack_app_spec::task#execute]' if
|
51
|
+
@opts.get(:files).empty?
|
52
|
+
|
53
|
+
cpack_package @opts.get(:out),
|
54
|
+
@opts.get(:files),
|
55
|
+
@opts.get(:configuration)
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
def cpack_package out, appspecs, configuration
|
60
|
+
appspecs.
|
61
|
+
map { |path| Albacore::AppSpec.load path }.
|
62
|
+
each do |spec|
|
63
|
+
nuspec = create_nuspec spec
|
64
|
+
debug { nuspec }
|
65
|
+
create_cpack out, spec, nuspec, configuration
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def git_release_notes
|
70
|
+
tags = `git tag`.split(/\n/)
|
71
|
+
last_tag = tags[-1]
|
72
|
+
second_last_tag = tags[-2] || `git rev-list --max-parents=0 HEAD`
|
73
|
+
logs = `git log --pretty=format:%s #{second_last_tag}..`.split(/\n/)
|
74
|
+
"Release Notes for #{last_tag}:
|
75
|
+
#{logs.inject('') { |state, line| state + "\n * #{line}" }}"
|
76
|
+
end
|
77
|
+
|
78
|
+
def create_nuspec app_spec
|
79
|
+
require 'albacore/nuget_model'
|
80
|
+
p = Albacore::NugetModel::Package.new
|
81
|
+
p.with_metadata do |m|
|
82
|
+
m.id = app_spec.id
|
83
|
+
m.title = app_spec.title_raw
|
84
|
+
m.version = app_spec.version
|
85
|
+
m.authors = app_spec.authors
|
86
|
+
m.owners = app_spec.owners
|
87
|
+
m.description = app_spec.description || app_spec.title
|
88
|
+
m.release_notes = git_release_notes
|
89
|
+
m.summary = app_spec.summary
|
90
|
+
m.language = app_spec.language
|
91
|
+
m.project_url = app_spec.project_url || 'https://haf.se'
|
92
|
+
m.icon_url = app_spec.icon_url || 'https://haf.se/spacer.gif'
|
93
|
+
m.license_url = app_spec.license_url || 'https://haf.se'
|
94
|
+
m.copyright = app_spec.copyright || 'See Authors'
|
95
|
+
m.tags = app_spec.tags
|
96
|
+
end
|
97
|
+
p.to_xml
|
98
|
+
end
|
99
|
+
|
100
|
+
# create a chocolatey install script for a topshelf service on windows
|
101
|
+
def create_chocolatey_install out, service_dir, exe, app_spec
|
102
|
+
tools = "#{out}/#{app_spec.id}/tools"
|
103
|
+
|
104
|
+
FileUtils.mkdir tools unless Dir.exists? tools
|
105
|
+
File.open(File.join(tools, 'chocolateyInstall.ps1'), 'w+') do |io|
|
106
|
+
contents = embedded_resource '../../resources/chocolateyInstall.ps1'
|
107
|
+
io.write contents
|
108
|
+
io.write %{
|
109
|
+
Install-Service `
|
110
|
+
-ServiceExeName "#{exe}" -ServiceDir "#{service_dir}" `
|
111
|
+
-CurrentPath (Split-Path $MyInvocation.MyCommand.Path)
|
112
|
+
}
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def create_cpack out, app_spec, nuspec_xml, configuration
|
117
|
+
target = "#{out}/#{app_spec.id}"
|
118
|
+
bin = "#{target}/bin"
|
119
|
+
|
120
|
+
# create target
|
121
|
+
FileUtils.mkdir_p target
|
122
|
+
|
123
|
+
# write nuspec
|
124
|
+
File.open("#{target}/#{app_spec.id}.nuspec", 'w+') { |io| io.write nuspec_xml }
|
125
|
+
|
126
|
+
# write tools
|
127
|
+
create_chocolatey_install out,
|
128
|
+
app_spec.exe,
|
129
|
+
"#{app_spec.target_root_dir}\\#{app_spec.id}",
|
130
|
+
app_spec
|
131
|
+
|
132
|
+
# copy contents of package
|
133
|
+
proj_path = File.join(app_spec.proj.proj_path_base,
|
134
|
+
app_spec.proj.output_path(configuration), '.').
|
135
|
+
gsub(/\//, '\\')
|
136
|
+
FileUtils.cp_r proj_path, bin, :verbose => true
|
137
|
+
|
138
|
+
# package it
|
139
|
+
Dir.chdir target do
|
140
|
+
system 'cpack'
|
141
|
+
end
|
142
|
+
|
143
|
+
# publish it
|
144
|
+
Albacore.publish :artifact, OpenStruct.new(:location => "#{target}/*.nupkg")
|
145
|
+
end
|
146
|
+
|
147
|
+
def embedded_resource relative_path
|
148
|
+
File.open(embedded_resource_path(relative_path), 'r') { |io| io.read }
|
149
|
+
end
|
150
|
+
|
151
|
+
def embedded_resource_path relative_path
|
152
|
+
File.join(File.dirname(File.expand_path(__FILE__)), relative_path)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
@@ -3,7 +3,6 @@ require 'map'
|
|
3
3
|
require 'open3'
|
4
4
|
require 'timeout'
|
5
5
|
require 'stringio'
|
6
|
-
require 'processpilot/processpilot'
|
7
6
|
require 'albacore/paths'
|
8
7
|
require 'albacore/logging'
|
9
8
|
require 'albacore/errors/command_not_found_error'
|
@@ -173,15 +172,6 @@ module Albacore
|
|
173
172
|
block = lambda { |ok, status, output| ok } unless block_given?
|
174
173
|
sh *cmd, &block
|
175
174
|
end
|
176
|
-
|
177
|
-
def system_control cmd, *opts, &block
|
178
|
-
cmd = opts[0]
|
179
|
-
opts = Map.options((Hash === cmd.last) ? cmd.pop : {}) # same arg parsing as rake
|
180
|
-
chdir opts[:work_dir] do
|
181
|
-
puts cmd
|
182
|
-
ProcessPilot::pilot cmd, opts, &block
|
183
|
-
end
|
184
|
-
end
|
185
175
|
|
186
176
|
def normalise_slashes path
|
187
177
|
::Albacore::Paths.normalise_slashes path
|
data/lib/albacore/dsl.rb
CHANGED
@@ -96,12 +96,21 @@ module Albacore
|
|
96
96
|
end
|
97
97
|
|
98
98
|
# Generate .rpm or .deb files from .appspec files
|
99
|
-
def
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
99
|
+
def appspecs *args, &block
|
100
|
+
if Albacore.windows?
|
101
|
+
require 'albacore/cpack_app_spec'
|
102
|
+
Albacore.define_task *args do
|
103
|
+
c = ::Albacore::CpackAppSpec::Config.new
|
104
|
+
yield c
|
105
|
+
::Albacore::CpackAppSpec::Task.new(c.opts).execute
|
106
|
+
end
|
107
|
+
else
|
108
|
+
require 'albacore/fpm_app_spec'
|
109
|
+
Albacore.define_task *args do
|
110
|
+
c = ::Albacore::FpmAppSpec::Config.new
|
111
|
+
yield c
|
112
|
+
::Albacore::FpmAppSpec::Task.new(c.opts).execute
|
113
|
+
end
|
105
114
|
end
|
106
115
|
end
|
107
116
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'albacore/app_spec'
|
2
|
+
require 'albacore/errors/invalid_app_spec_error'
|
2
3
|
require 'map'
|
3
4
|
|
4
5
|
module Albacore
|
5
|
-
class InvalidAppSpecError < ::StandardError
|
6
|
-
end
|
7
|
-
|
8
6
|
# An object that is capable of generating FPM commands - use by giving it a
|
9
7
|
# spec and then calling #execute or #generate_flags. You may use this object
|
10
8
|
# to package a directory.
|
@@ -68,6 +66,8 @@ module Albacore
|
|
68
66
|
# create a new configuration for multiple xxproj-s to be packed with fpm into .deb/.rpm
|
69
67
|
def initialize
|
70
68
|
@bundler = true
|
69
|
+
@files = []
|
70
|
+
@out = '.'
|
71
71
|
end
|
72
72
|
|
73
73
|
# turn off the using of bundler; bundler will be used by default
|
@@ -76,20 +76,25 @@ module Albacore
|
|
76
76
|
end
|
77
77
|
|
78
78
|
# set the output path, defaults to '.'
|
79
|
-
def out=
|
79
|
+
def out= out
|
80
|
+
@out = out
|
80
81
|
end
|
81
82
|
|
82
83
|
# give the configuration a list of files to match
|
83
|
-
def files=
|
84
|
+
def files= files
|
85
|
+
@files = files
|
84
86
|
end
|
85
87
|
|
86
88
|
def opts
|
87
|
-
Map.new bundler: @bundler
|
89
|
+
Map.new bundler: @bundler,
|
90
|
+
files: @files,
|
91
|
+
out: @out
|
88
92
|
end
|
89
93
|
end
|
90
94
|
|
91
95
|
# task implementation that can be #execute'd
|
92
96
|
class FpmAppSpec::Task
|
97
|
+
include ::Albacore::Logging
|
93
98
|
include ::Albacore::CrossPlatformCmd
|
94
99
|
|
95
100
|
# create a new task instance with the given opts
|
@@ -100,19 +105,53 @@ module Albacore
|
|
100
105
|
|
101
106
|
# this runs fpm and does some file copying
|
102
107
|
def execute
|
103
|
-
|
108
|
+
warn 'executing fpm app spec task, but there are no input files [fpm_app_spec::task#execute]' if
|
109
|
+
@opts.get(:files).empty?
|
104
110
|
|
105
|
-
|
106
|
-
system 'bundle', %w|exec fpm|.concat(opts.get(:fpm_spec).generate_flags_flat)
|
107
|
-
else
|
108
|
-
system 'fpm', opts.get(:fpm_spec).generate_flags_flat
|
109
|
-
end
|
111
|
+
fpm_package @opts.get(:out), @opts.get(:files)
|
110
112
|
end
|
111
113
|
|
112
114
|
private
|
113
|
-
|
114
|
-
|
115
|
-
|
115
|
+
def fpm_package out, appspecs
|
116
|
+
pkg = File.join out, 'pkg'
|
117
|
+
|
118
|
+
appspecs.
|
119
|
+
map { |path| Albacore::AppSpec.load path }.
|
120
|
+
map { |spec| [spec, Albacore::FpmAppSpec.new(spec, pkg)] }.
|
121
|
+
each do |spec, fpm|
|
122
|
+
targ = "#{out}/#{spec.title}/tmp-dest/"
|
123
|
+
FileUtils.mkdir_p targ
|
124
|
+
|
125
|
+
bin = File.join targ, "opt/#{spec.title}/bin"
|
126
|
+
FileUtils.mkdir_p bin
|
127
|
+
FileUtils.cp_r Dir.glob(File.join(fpm_rel(spec, spec.bin_folder), '*')),
|
128
|
+
bin, verbose: true
|
129
|
+
|
130
|
+
etc = File.join targ, "etc/#{spec.title}"
|
131
|
+
FileUtils.mkdir_p etc, verbose: true
|
132
|
+
# FileUtils.cp_r Dir.glob(File.join(fpm_rel(spec, spec.conf_folder), '*')),
|
133
|
+
# etc, verbose: true
|
134
|
+
|
135
|
+
spec.contents.each do |con|
|
136
|
+
FileUtils.cp_r fpm_rel(spec, con), File.join(targ, con), verbose: true
|
137
|
+
end
|
138
|
+
|
139
|
+
run fpm.generate_flags_flat({ '-C' => targ })
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
def fpm_rel spec, path
|
145
|
+
File.join spec.dir_path, path
|
146
|
+
end
|
147
|
+
|
148
|
+
def run pars
|
149
|
+
if @opts.get :bundle
|
150
|
+
system 'bundle', %w|exec fpm|.concat(pars)
|
151
|
+
else
|
152
|
+
system 'fpm', pars
|
153
|
+
end
|
154
|
+
Albacore.publish :artifact, OpenStruct.new({ :location => "#{pkg}/#{fpm.filename}" })
|
116
155
|
end
|
117
156
|
end
|
118
157
|
end
|
data/lib/albacore/version.rb
CHANGED
@@ -0,0 +1,120 @@
|
|
1
|
+
$ErrorActionPreference = "Stop"
|
2
|
+
|
3
|
+
Function Resolve-Error($ErrorRecord = $Error[0]) {
|
4
|
+
$ErrorRecord | Format-List * -Force
|
5
|
+
$ErrorRecord.InvocationInfo | Format-List *
|
6
|
+
$Exception = $ErrorRecord.Exception
|
7
|
+
for ($i = 0; $Exception; $i++, ($Exception = $Exception.InnerException))
|
8
|
+
{ "$i" * 80
|
9
|
+
$Exception | Format-List * -Force
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
Function Check-Exit($Output) {
|
14
|
+
if (-not $?) {
|
15
|
+
throw "Last command exited with $($LASTEXITCODE)"
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
Function System([string] $Command, [Switch] $Silent) {
|
20
|
+
if ($Silent) {
|
21
|
+
Invoke-Expression $Command | Tee-Object -Variable scriptOutput | Out-Null
|
22
|
+
} else {
|
23
|
+
Invoke-Expression $Command | Tee-Object -Variable scriptOutput
|
24
|
+
}
|
25
|
+
Check-Exit $scriptOutput
|
26
|
+
}
|
27
|
+
|
28
|
+
Function Get-ServiceVersion([string] $ServiceExePath) {
|
29
|
+
(ls $ServiceExePath | Select-Object -First 1).VersionInfo.FileVersion.ToString()
|
30
|
+
}
|
31
|
+
|
32
|
+
Function Copy-WithBackup([string] $Source, [string] $Target, [string] $ServiceExePath) {
|
33
|
+
if ([string]::IsNullOrWhiteSpace($Source)) {
|
34
|
+
throw (New-Object System.ArgumentNullException "Source - Copy-WithBackup")
|
35
|
+
}
|
36
|
+
if ([string]::IsNullOrWhiteSpace($Target)) {
|
37
|
+
throw (New-Object System.ArgumentNullException "Target - Copy-WithBackup")
|
38
|
+
}
|
39
|
+
if ([string]::IsNullOrWhiteSpace($ServiceExePath)) {
|
40
|
+
throw (New-Object System.ArgumentNullException "ServiceExePath - Copy-WithBackup")
|
41
|
+
}
|
42
|
+
#Start-Transaction -Timeout 2
|
43
|
+
try {
|
44
|
+
# don't have to -UseTransaction, as tx equiv. to FS state here
|
45
|
+
if (Test-Path -Path $Target) {
|
46
|
+
$oldVersion = Get-ServiceVersion $ServiceExePath
|
47
|
+
$backup = "$Target-$oldVersion"
|
48
|
+
|
49
|
+
Write-Host -ForegroundColor Green "Using backup folder '$backup'"
|
50
|
+
if (Test-Path $backup) {
|
51
|
+
Remove-Item -Path $backup -Force -Recurse
|
52
|
+
}
|
53
|
+
Move-Item $Target $backup -Force #-UseTransaction
|
54
|
+
}
|
55
|
+
|
56
|
+
Write-Host -ForegroundColor Green "Copy-Item -Recurse $Source $Target"
|
57
|
+
New-Item -ItemType Directory -Path $Target | Out-Null
|
58
|
+
Copy-Item -Recurse $Source $Target #-UseTransaction
|
59
|
+
#Complete-Transaction
|
60
|
+
} catch {
|
61
|
+
#Undo-Transaction
|
62
|
+
throw
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
Function Invoke-WithStoppedTopshelf([string] $ServiceExePath, [scriptblock] $WhileStopped) {
|
67
|
+
if ([string]::IsNullOrWhiteSpace($ServiceExePath)) {
|
68
|
+
throw (New-Object System.ArgumentNullException "ServiceExePath - Invoke-WithStoppedTopshelf")
|
69
|
+
}
|
70
|
+
|
71
|
+
if (Test-Path -Path $ServiceExePath) {
|
72
|
+
Write-Host -ForegroundColor Green "$ServiceExePath uninstall"
|
73
|
+
System "$ServiceExePath uninstall" -Silent
|
74
|
+
}
|
75
|
+
try {
|
76
|
+
Invoke-Command -ScriptBlock $WhileStopped
|
77
|
+
} finally {
|
78
|
+
if (Test-Path -Path $ServiceExePath) {
|
79
|
+
Write-Host -ForegroundColor Green "$ServiceExePath install"
|
80
|
+
System "$ServiceExePath install" -Silent
|
81
|
+
|
82
|
+
Write-Host -ForegroundColor Green "$ServiceExePath start"
|
83
|
+
System "$ServiceExePath start" -Silent
|
84
|
+
} else {
|
85
|
+
Write-Host -ForegroundColor Yellow "Path $ServiceExePath doesn't exist"
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
Function Install-Service([string] $ServiceExeName,
|
91
|
+
[string] $ServiceDir,
|
92
|
+
[string] $CurrentPath = $(Get-Location).Path) {
|
93
|
+
if ([string]::IsNullOrWhiteSpace($ServiceExeName)) {
|
94
|
+
throw (New-Object System.ArgumentNullException "ServiceExeName - Install-Service")
|
95
|
+
}
|
96
|
+
if ([string]::IsNullOrWhiteSpace($ServiceDir)) {
|
97
|
+
throw (New-Object System.ArgumentNullException "ServiceDir - Install-Service")
|
98
|
+
}
|
99
|
+
if ([string]::IsNullOrWhiteSpace($CurrentPath)) {
|
100
|
+
throw (New-Object System.ArgumentNullException "CurrentPath - Install-Service")
|
101
|
+
}
|
102
|
+
|
103
|
+
# relative to chocolatey
|
104
|
+
$parentDir = Split-Path -Parent $CurrentPath
|
105
|
+
# get binaries' dir's contents
|
106
|
+
$bin = Join-Path $parentDir "bin\*"
|
107
|
+
|
108
|
+
try {
|
109
|
+
$serviceExePath = Join-Path $ServiceDir $ServiceExeName
|
110
|
+
Invoke-WithStoppedTopshelf -ServiceExePath $serviceExePath {
|
111
|
+
Copy-WithBackup -Source $bin -Target $ServiceDir -ServiceExePath $serviceExePath
|
112
|
+
}
|
113
|
+
# Write-Host -ForegroundColor Green "Successfully installed $ServiceExeName" # OR:
|
114
|
+
Write-ChocolateySuccess "The service was succesfully installed"
|
115
|
+
} catch {
|
116
|
+
Resolve-Error $_.Exception
|
117
|
+
Write-ChocolateyFailure 'Failed to install service'
|
118
|
+
throw
|
119
|
+
}
|
120
|
+
}
|
data/spec/dsl_spec.rb
CHANGED
@@ -14,7 +14,7 @@ end
|
|
14
14
|
|
15
15
|
#puts "X has methods: #{X.new.private_methods.inspect}"
|
16
16
|
|
17
|
-
%w[nugets_restore nugets_pack asmver build test_runner restore_hint_paths
|
17
|
+
%w[nugets_restore nugets_pack asmver build test_runner restore_hint_paths appspecs].each do |sym|
|
18
18
|
method = :"#{sym}"
|
19
19
|
describe "that #{method}(*args, &block) is included when doing `require 'albacore'`" do
|
20
20
|
subject do
|
@@ -0,0 +1 @@
|
|
1
|
+
build/
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'albacore'
|
3
|
+
|
4
|
+
Configuration = ENV['CONFIGURATION'] || 'Release'
|
5
|
+
|
6
|
+
desc 'build example project'
|
7
|
+
build :compile do |b|
|
8
|
+
b.sln = 'corp.service.svc.sln'
|
9
|
+
b.prop 'Configuration', Configuration
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'build service packages from all the appspecs'
|
13
|
+
appspecs :services => :compile do |as|
|
14
|
+
as.files = Dir.glob '**/.appspec', File::FNM_DOTMATCH
|
15
|
+
as.out = 'build'
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => :services
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
3
|
+
# Visual Studio 2012
|
4
|
+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "corp.service.svc", "corp.service.svc/corp.service.svc.fsproj", "{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}"
|
5
|
+
EndProject
|
6
|
+
Global
|
7
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
8
|
+
Debug|Any CPU = Debug|Any CPU
|
9
|
+
Release|Any CPU = Release|Any CPU
|
10
|
+
EndGlobalSection
|
11
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
12
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
13
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
14
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
15
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Release|Any CPU.Build.0 = Release|Any CPU
|
16
|
+
EndGlobalSection
|
17
|
+
GlobalSection(SolutionProperties) = preSolution
|
18
|
+
HideSolutionNode = FALSE
|
19
|
+
EndGlobalSection
|
20
|
+
EndGlobal
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
2
|
+
<configuration>
|
3
|
+
<startup>
|
4
|
+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
|
5
|
+
</startup>
|
6
|
+
<runtime>
|
7
|
+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
8
|
+
<dependentAssembly>
|
9
|
+
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
10
|
+
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0"/>
|
11
|
+
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.3.0.0"/>
|
12
|
+
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.3.0.0"/>
|
13
|
+
|
14
|
+
</dependentAssembly>
|
15
|
+
</assemblyBinding>
|
16
|
+
</runtime>
|
17
|
+
</configuration>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
4
|
+
<PropertyGroup>
|
5
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
6
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
7
|
+
<SchemaVersion>2.0</SchemaVersion>
|
8
|
+
<ProjectGuid>d433c9fd-bfb9-48b5-834e-e53bb89d9e13</ProjectGuid>
|
9
|
+
<OutputType>Exe</OutputType>
|
10
|
+
<RootNamespace>corp.service.svc</RootNamespace>
|
11
|
+
<AssemblyName>corp.service.svc</AssemblyName>
|
12
|
+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
13
|
+
<Name>corp.service.svc</Name>
|
14
|
+
</PropertyGroup>
|
15
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
16
|
+
<DebugSymbols>true</DebugSymbols>
|
17
|
+
<DebugType>full</DebugType>
|
18
|
+
<Optimize>false</Optimize>
|
19
|
+
<Tailcalls>false</Tailcalls>
|
20
|
+
<OutputPath>bin\Debug\</OutputPath>
|
21
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
22
|
+
<WarningLevel>3</WarningLevel>
|
23
|
+
<PlatformTarget>AnyCPU</PlatformTarget>
|
24
|
+
<DocumentationFile>bin\Debug\corp.service.svc.XML</DocumentationFile>
|
25
|
+
<Prefer32Bit>true</Prefer32Bit>
|
26
|
+
</PropertyGroup>
|
27
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
28
|
+
<DebugType>pdbonly</DebugType>
|
29
|
+
<Optimize>true</Optimize>
|
30
|
+
<Tailcalls>true</Tailcalls>
|
31
|
+
<OutputPath>bin\Release\</OutputPath>
|
32
|
+
<DefineConstants>TRACE</DefineConstants>
|
33
|
+
<WarningLevel>3</WarningLevel>
|
34
|
+
<PlatformTarget>AnyCPU</PlatformTarget>
|
35
|
+
<DocumentationFile>bin\Release\corp.service.svc.XML</DocumentationFile>
|
36
|
+
<Prefer32Bit>true</Prefer32Bit>
|
37
|
+
</PropertyGroup>
|
38
|
+
<ItemGroup>
|
39
|
+
<Reference Include="mscorlib" />
|
40
|
+
<Reference Include="FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
41
|
+
<Private>True</Private>
|
42
|
+
</Reference>
|
43
|
+
<Reference Include="System" />
|
44
|
+
<Reference Include="System.Core" />
|
45
|
+
<Reference Include="System.Numerics" />
|
46
|
+
</ItemGroup>
|
47
|
+
<ItemGroup>
|
48
|
+
<Compile Include="Program.fs" />
|
49
|
+
<None Include="App.config" />
|
50
|
+
</ItemGroup>
|
51
|
+
<PropertyGroup>
|
52
|
+
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
|
53
|
+
</PropertyGroup>
|
54
|
+
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" />
|
55
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
56
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
57
|
+
<Target Name="BeforeBuild">
|
58
|
+
</Target>
|
59
|
+
<Target Name="AfterBuild">
|
60
|
+
</Target>
|
61
|
+
-->
|
62
|
+
</Project>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
3
|
+
# Visual Studio 2012
|
4
|
+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "corp.service.svc", "corp.service.svc.fsproj", "{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}"
|
5
|
+
EndProject
|
6
|
+
Global
|
7
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
8
|
+
Debug|Any CPU = Debug|Any CPU
|
9
|
+
Release|Any CPU = Release|Any CPU
|
10
|
+
EndGlobalSection
|
11
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
12
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
13
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
14
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
15
|
+
{D433C9FD-BFB9-48B5-834E-E53BB89D9E13}.Release|Any CPU.Build.0 = Release|Any CPU
|
16
|
+
EndGlobalSection
|
17
|
+
GlobalSection(SolutionProperties) = preSolution
|
18
|
+
HideSolutionNode = FALSE
|
19
|
+
EndGlobalSection
|
20
|
+
EndGlobal
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: albacore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.rc.
|
4
|
+
version: 2.0.0.rc.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrik Feldt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -53,20 +53,6 @@ dependencies:
|
|
53
53
|
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '1.5'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: facter
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '1.7'
|
63
|
-
type: :runtime
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '1.7'
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
57
|
name: semver2
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,34 +67,6 @@ dependencies:
|
|
81
67
|
- - ~>
|
82
68
|
- !ruby/object:Gem::Version
|
83
69
|
version: '3.3'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: ProcessPilot
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '2.0'
|
91
|
-
type: :runtime
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ~>
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '2.0'
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: highline
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - ~>
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '1.6'
|
105
|
-
type: :runtime
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - ~>
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '1.6'
|
112
70
|
- !ruby/object:Gem::Dependency
|
113
71
|
name: rubygems-tasks
|
114
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,10 +119,12 @@ files:
|
|
161
119
|
- lib/albacore/application.rb
|
162
120
|
- lib/albacore/cmd_config.rb
|
163
121
|
- lib/albacore/config_dsl.rb
|
122
|
+
- lib/albacore/cpack_app_spec.rb
|
164
123
|
- lib/albacore/cross_platform_cmd.rb
|
165
124
|
- lib/albacore/dsl.rb
|
166
125
|
- lib/albacore/errors/command_failed_error.rb
|
167
126
|
- lib/albacore/errors/command_not_found_error.rb
|
127
|
+
- lib/albacore/errors/invalid_app_spec_error.rb
|
168
128
|
- lib/albacore/errors/unfilled_property_error.rb
|
169
129
|
- lib/albacore/ext/README.md
|
170
130
|
- lib/albacore/ext/teamcity.rb
|
@@ -199,6 +159,7 @@ files:
|
|
199
159
|
- lib/albacore/tools/restore_hint_paths.rb
|
200
160
|
- lib/albacore/tools/zippy.rb
|
201
161
|
- lib/albacore/version.rb
|
162
|
+
- resources/chocolateyInstall.ps1
|
202
163
|
- spec/Rakefile
|
203
164
|
- spec/albacore_spec.rb
|
204
165
|
- spec/app_spec_spec.rb
|
@@ -249,6 +210,16 @@ files:
|
|
249
210
|
- spec/support/returnstatus/returnstatus.pdb
|
250
211
|
- spec/support/sh_interceptor.rb
|
251
212
|
- spec/tasks/versionizer_spec.rb
|
213
|
+
- spec/test_appspecs/.gitignore
|
214
|
+
- spec/test_appspecs/corp.service/.gitignore
|
215
|
+
- spec/test_appspecs/corp.service/Gemfile
|
216
|
+
- spec/test_appspecs/corp.service/Rakefile
|
217
|
+
- spec/test_appspecs/corp.service/corp.service.svc.sln
|
218
|
+
- spec/test_appspecs/corp.service/corp.service.svc/.appspec
|
219
|
+
- spec/test_appspecs/corp.service/corp.service.svc/App.config
|
220
|
+
- spec/test_appspecs/corp.service/corp.service.svc/Program.fs
|
221
|
+
- spec/test_appspecs/corp.service/corp.service.svc/corp.service.svc.fsproj
|
222
|
+
- spec/test_appspecs/corp.service/corp.service.svc/corp.service.svc.sln
|
252
223
|
- spec/test_runner_spec.rb
|
253
224
|
- spec/testdata/.gitignore
|
254
225
|
- spec/testdata/DebugProject/.gitignore
|
@@ -288,6 +259,7 @@ files:
|
|
288
259
|
- spec/testdata/example.nuspec
|
289
260
|
- spec/testdata/example.symbols.nuspec
|
290
261
|
- spec/tools/fluent_migrator_spec.rb
|
262
|
+
- ./resources/chocolateyInstall.ps1
|
291
263
|
homepage: http://albacorebuild.net
|
292
264
|
licenses:
|
293
265
|
- MIT
|
@@ -363,6 +335,16 @@ test_files:
|
|
363
335
|
- spec/support/returnstatus/returnstatus.pdb
|
364
336
|
- spec/support/sh_interceptor.rb
|
365
337
|
- spec/tasks/versionizer_spec.rb
|
338
|
+
- spec/test_appspecs/.gitignore
|
339
|
+
- spec/test_appspecs/corp.service/.gitignore
|
340
|
+
- spec/test_appspecs/corp.service/Gemfile
|
341
|
+
- spec/test_appspecs/corp.service/Rakefile
|
342
|
+
- spec/test_appspecs/corp.service/corp.service.svc.sln
|
343
|
+
- spec/test_appspecs/corp.service/corp.service.svc/.appspec
|
344
|
+
- spec/test_appspecs/corp.service/corp.service.svc/App.config
|
345
|
+
- spec/test_appspecs/corp.service/corp.service.svc/Program.fs
|
346
|
+
- spec/test_appspecs/corp.service/corp.service.svc/corp.service.svc.fsproj
|
347
|
+
- spec/test_appspecs/corp.service/corp.service.svc/corp.service.svc.sln
|
366
348
|
- spec/test_runner_spec.rb
|
367
349
|
- spec/testdata/.gitignore
|
368
350
|
- spec/testdata/DebugProject/.gitignore
|