harrison 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/harrison/base.rb +2 -0
- data/lib/harrison/deploy.rb +0 -2
- data/lib/harrison/package.rb +20 -1
- data/lib/harrison/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 760f8c56d329abf35ed7cd9c77796ec77dc783d5
|
4
|
+
data.tar.gz: 30481788ad2ea5bf4220e55cf5b88aa61537550f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a518dc8a366adcf5c6ef5136d4d259f1b83a0fe1ea3894cc3e5ffd8696e996d9c34a237654fd0f43b7f769b5e291748d90af086ecebcf419aab734c4e7f1e445
|
7
|
+
data.tar.gz: e2eab336ca70464544ebf239f8d48796aab72bbb4c13a342b5cb609ba12cee4ebcb61e32ca80b7722ce6a5582704ac32f53b195f1dfd03c39733ab83fed3338e
|
data/CHANGELOG
CHANGED
data/lib/harrison/base.rb
CHANGED
@@ -6,9 +6,11 @@ module Harrison
|
|
6
6
|
def initialize(arg_opts=[], opts={})
|
7
7
|
# Config helpers for Harrisonfile.
|
8
8
|
self.class.option_helper(:user)
|
9
|
+
self.class.option_helper(:env)
|
9
10
|
|
10
11
|
@arg_opts = arg_opts
|
11
12
|
@arg_opts << [ :debug, "Output debug messages.", :type => :boolean, :default => false ]
|
13
|
+
@arg_opts << [ :env, "Environment to package for or deploy to. This can be examined in your Harrisonfile to calculate target hosts.", :type => :string ]
|
12
14
|
|
13
15
|
@options = opts
|
14
16
|
end
|
data/lib/harrison/deploy.rb
CHANGED
@@ -15,7 +15,6 @@ module Harrison
|
|
15
15
|
def initialize(opts={})
|
16
16
|
# Config helpers for Harrisonfile.
|
17
17
|
self.class.option_helper(:hosts)
|
18
|
-
self.class.option_helper(:env)
|
19
18
|
self.class.option_helper(:base_dir)
|
20
19
|
self.class.option_helper(:deploy_via)
|
21
20
|
self.class.option_helper(:keep)
|
@@ -24,7 +23,6 @@ module Harrison
|
|
24
23
|
# Command line opts for this action. Will be merged with common opts.
|
25
24
|
arg_opts = [
|
26
25
|
[ :hosts, "List of remote hosts to deploy to. Can also be specified in Harrisonfile.", :type => :strings ],
|
27
|
-
[ :env, "Environment to deploy to. This can be examined in your Harrisonfile to calculate target hosts.", :type => :string ],
|
28
26
|
[ :keep, "Number of recent deploys to keep after a successful deploy. (Including the most recent deploy.) Defaults to keeping all deploys forever.", :type => :integer ],
|
29
27
|
[ :confirm, "Whether to interactively confirm the list of target hosts for deployment.", :type => :flag, :default => true ],
|
30
28
|
]
|
data/lib/harrison/package.rb
CHANGED
@@ -39,6 +39,16 @@ module Harrison
|
|
39
39
|
# Resolve commit ref to an actual short SHA.
|
40
40
|
resolve_commit!
|
41
41
|
|
42
|
+
if self.host.respond_to?(:call)
|
43
|
+
resolved_host = self.host.call(self)
|
44
|
+
self.host = resolved_host
|
45
|
+
end
|
46
|
+
|
47
|
+
# Require at least one host.
|
48
|
+
if !self.host || self.host.empty?
|
49
|
+
abort("ERROR: Unable to resolve build host.")
|
50
|
+
end
|
51
|
+
|
42
52
|
puts "Packaging #{commit} from #{remote_url} for \"#{project}\" on #{host}..."
|
43
53
|
|
44
54
|
# Make sure the folder to save the artifact to locally exists.
|
@@ -69,7 +79,16 @@ module Harrison
|
|
69
79
|
remote_exec("rm -rf #{build_dir} && mkdir -p #{build_dir}")
|
70
80
|
|
71
81
|
# Check out target commit into the build_dir.
|
72
|
-
|
82
|
+
checkout_failure = catch :failure do
|
83
|
+
remote_exec("cd cached && GIT_WORK_TREE=../#{build_dir} git checkout --detach -f #{commit} && git checkout -f -") # TODO: When git is upgraded: --ignore-other-worktrees
|
84
|
+
|
85
|
+
# We want "checkout_failure" to be false if nothing was caught.
|
86
|
+
false
|
87
|
+
end
|
88
|
+
|
89
|
+
if checkout_failure
|
90
|
+
abort("ERROR: Unable to checkout requested git reference '#{commit}' on build server, ensure you have pushed the requested branch or tag to the remote repo.")
|
91
|
+
end
|
73
92
|
|
74
93
|
# Run user supplied build code in the context of the checked out code.
|
75
94
|
begin
|
data/lib/harrison/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harrison
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trollop
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
209
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.
|
210
|
+
rubygems_version: 2.6.8
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Simple artifact-based deployment for web applications.
|