pushwagner 0.0.1.1 → 0.0.1.2
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.
- data/.travis.yml +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -0
- data/TODO.md +20 -17
- data/lib/pushwagner/environment.rb +2 -1
- data/lib/pushwagner/maven.rb +6 -1
- data/lib/pushwagner/version.rb +1 -1
- data/spec/configs/full.yml +1 -1
- data/spec/configs/static.yml +1 -1
- data/spec/environment_spec.rb +24 -24
- data/spec/maven_spec.rb +11 -10
- metadata +3 -2
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/TODO.md
CHANGED
@@ -1,24 +1,27 @@
|
|
1
1
|
Static-file provision:
|
2
2
|
|
3
3
|
[ ] Support hooks, i.e.:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
|
5
|
+
hooks:
|
6
|
+
before:
|
7
|
+
- cmd: mvn package
|
8
|
+
cwd: anyone-web
|
9
|
+
scope: local
|
10
|
+
after:
|
11
|
+
- cmd: unzip anyone-web.zip
|
12
|
+
cwd: /srv/www/gethubble.com
|
13
|
+
scope: remote
|
14
|
+
|
13
15
|
[ ] Add another wrapper for files:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
|
17
|
+
static:
|
18
|
+
name:
|
19
|
+
files: # files to upload
|
20
|
+
- ...
|
21
|
+
hooks: # before and after deploy hooks
|
22
|
+
- ...
|
23
|
+
services: # assumes service with same name
|
24
|
+
- restart
|
22
25
|
|
23
26
|
|
24
27
|
Maven:
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'pushwagner/ext'
|
2
2
|
require 'pushwagner/maven'
|
3
|
+
require 'yaml'
|
3
4
|
|
4
5
|
module Pushwagner
|
5
6
|
|
@@ -11,7 +12,7 @@ module Pushwagner
|
|
11
12
|
opts = HashWithIndifferentAccess.new(opts)
|
12
13
|
|
13
14
|
config_file = opts[:config_file] || File.join(File.dirname(__FILE__), '/config/deploy.yml')
|
14
|
-
@version = opts[:version].to_s
|
15
|
+
@version = opts[:version] && opts[:version].to_s
|
15
16
|
@current = opts[:environment] || 'development'
|
16
17
|
|
17
18
|
@config = HashWithIndifferentAccess.new(YAML::load_file(config_file) || {})
|
data/lib/pushwagner/maven.rb
CHANGED
@@ -11,7 +11,12 @@ module Pushwagner
|
|
11
11
|
def initialize(maven, version)
|
12
12
|
required("Need maven configuration") unless maven
|
13
13
|
|
14
|
-
|
14
|
+
if version && !version.empty?
|
15
|
+
@version = version
|
16
|
+
else
|
17
|
+
required("Deployment version for artifacts is required")
|
18
|
+
end
|
19
|
+
|
15
20
|
@repository = Repository.new(maven['repositories'])
|
16
21
|
@artifacts = Hash[(maven['artifacts'] || required("Requires at least one maven artifact")).map { |k,h| [k, Artifact.new(h['artifact_id'], h['group_id'], h['version'] || version)] }]
|
17
22
|
|
data/lib/pushwagner/version.rb
CHANGED
data/spec/configs/full.yml
CHANGED
data/spec/configs/static.yml
CHANGED
data/spec/environment_spec.rb
CHANGED
@@ -22,7 +22,7 @@ describe Pushwagner::Environment do
|
|
22
22
|
expect(env.version).to eq("1.3.3.7")
|
23
23
|
end
|
24
24
|
end
|
25
|
-
describe "
|
25
|
+
describe "maven artifacts" do
|
26
26
|
it "requires a version" do
|
27
27
|
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'maven.yml'))
|
28
28
|
expect { env.maven }.to raise_error(StandardError, "Deployment version for artifacts is required")
|
@@ -34,41 +34,41 @@ describe Pushwagner::Environment do
|
|
34
34
|
expect(env.maven).to eq({})
|
35
35
|
end
|
36
36
|
end
|
37
|
-
describe "
|
37
|
+
describe "static files" do
|
38
38
|
it "returns empty hash when not configured" do
|
39
39
|
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'maven.yml'), :version => "1foo" )
|
40
40
|
expect(env.static?).to be_false
|
41
41
|
expect(env.static).to eq({})
|
42
42
|
end
|
43
|
-
it "
|
43
|
+
it "parses to a hash of files" do
|
44
44
|
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'static.yml'))
|
45
|
-
expect(env.static).to eq({'
|
45
|
+
expect(env.static).to eq({'blah.uppercase.no' => ['index.htm', 'static']})
|
46
46
|
end
|
47
47
|
end
|
48
|
-
describe "
|
48
|
+
describe "environments" do
|
49
49
|
it "returns all environments" do
|
50
50
|
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'full.yml'), :version => "1foo" )
|
51
51
|
expect(env.environments.size).to eq(2)
|
52
52
|
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
53
|
+
describe "environment" do
|
54
|
+
it "returns empty environment if it doesn't exist" do
|
55
|
+
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'full.yml'), :version => "1foo" )
|
56
|
+
expect(env.environment).to eq({})
|
57
|
+
end
|
58
|
+
it "returns environment if it exists" do
|
59
|
+
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'full.yml'), :version => "1foo", :environment => "staging")
|
60
|
+
expect(env.environment).to eq({'hosts' => ["staging.uppercase.no"], 'user' => "www-data"})
|
61
|
+
end
|
62
|
+
describe "hosts" do
|
63
|
+
it "returns empty list if it doesn't exist" do
|
64
|
+
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'empty.yml'), :version => "1foo" )
|
65
|
+
expect(env.hosts).to eq([])
|
66
|
+
end
|
67
|
+
it "returns environment if it exists" do
|
68
|
+
env = Pushwagner::Environment.new(:config_file => File.join(config_root, 'full.yml'), :version => "1foo", :environment => "staging")
|
69
|
+
expect(env.environment).to eq({'hosts' => ["staging.uppercase.no"], 'user' => "www-data"})
|
70
|
+
end
|
71
|
+
end
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
data/spec/maven_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe Pushwagner::Maven do
|
|
27
27
|
expect(m.artifacts["some-notifier"].version).to eq("1.0final")
|
28
28
|
end
|
29
29
|
|
30
|
-
describe "
|
30
|
+
describe "artifacts" do
|
31
31
|
it "requires at least one artifact" do
|
32
32
|
cfg.delete('artifacts')
|
33
33
|
expect {Pushwagner::Maven.new(cfg, "1bar")}.to raise_error(StandardError, "Requires at least one maven artifact")
|
@@ -35,25 +35,25 @@ describe Pushwagner::Maven do
|
|
35
35
|
it "parses two artifacts" do
|
36
36
|
m = Pushwagner::Maven.new(cfg, "1bar")
|
37
37
|
expect(m.artifacts.size).to eq(2)
|
38
|
-
expect(m.artifacts.keys
|
39
|
-
expect(m.artifacts.keys
|
38
|
+
expect(m.artifacts.keys).to include("some-api")
|
39
|
+
expect(m.artifacts.keys).to include("some-notifier")
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
describe "
|
44
|
-
it "requires
|
43
|
+
describe "repositories" do
|
44
|
+
it "requires repositories configuration element" do
|
45
45
|
cfg.delete('repositories')
|
46
46
|
expect {Pushwagner::Maven.new(cfg, "1")}.to raise_error(StandardError)
|
47
47
|
end
|
48
|
-
it "requires snapshots repository" do
|
48
|
+
it "requires 'snapshots' repository" do
|
49
49
|
cfg['repositories'].delete('snapshots')
|
50
50
|
expect {Pushwagner::Maven.new(cfg, "1")}.to raise_error(StandardError)
|
51
51
|
end
|
52
|
-
it "requires releases repository" do
|
52
|
+
it "requires 'releases' repository" do
|
53
53
|
cfg['repositories'].delete('releases')
|
54
54
|
expect {Pushwagner::Maven.new(cfg, "1")}.to raise_error(StandardError)
|
55
55
|
end
|
56
|
-
it "parses
|
56
|
+
it "parses repositories" do
|
57
57
|
m = Pushwagner::Maven.new(cfg, "1")
|
58
58
|
expect(m.repository.snapshots_url).to eq("http://w00t.uppercase.no/nexus/content/repositories/snapshots")
|
59
59
|
expect(m.repository.releases_url).to eq("http://w00t.uppercase.no/nexus/content/repositories/releases")
|
@@ -61,7 +61,7 @@ describe Pushwagner::Maven do
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
describe "
|
64
|
+
describe "repository authentication" do
|
65
65
|
let(:settings) {IO.read(File.join(config_root, 'settings.xml'))}
|
66
66
|
|
67
67
|
it "reads releases authentication from maven settings.xml" do
|
@@ -81,7 +81,8 @@ describe Pushwagner::Maven do
|
|
81
81
|
|
82
82
|
expect(m.repository.authentication(true)).to eq("bar:baz")
|
83
83
|
end
|
84
|
-
|
84
|
+
end
|
85
|
+
describe "maven2-style repo support" do
|
85
86
|
let(:metadata) {IO.read(File.join(config_root, 'maven-metadata.xml'))}
|
86
87
|
|
87
88
|
it "builds maven2-repo-style urls and retrieves metadata" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushwagner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
@@ -116,6 +116,7 @@ extra_rdoc_files: []
|
|
116
116
|
files:
|
117
117
|
- .gitignore
|
118
118
|
- .rvmrc
|
119
|
+
- .travis.yml
|
119
120
|
- Gemfile
|
120
121
|
- Gemfile.lock
|
121
122
|
- README.md
|