traquitana 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Gemfile.lock +8 -8
- data/README.md +4 -3
- data/bin/traq +26 -26
- data/gem-public_cert.pem +22 -22
- data/lib/bar.rb +1 -1
- data/lib/cleaner.rb +2 -2
- data/lib/config.rb +8 -7
- data/lib/deployer.rb +15 -8
- data/lib/packager.rb +18 -12
- data/lib/selector.rb +1 -1
- data/lib/ssh.rb +1 -1
- data/lib/traquitana.rb +1 -1
- data/lib/traquitana/version.rb +1 -1
- data/spec/bar_spec.rb +48 -41
- data/spec/cleaner_spec.rb +17 -16
- data/spec/config/Gemfile +1 -0
- data/spec/config/Rakefile +11 -0
- data/spec/config_spec.rb +106 -101
- data/spec/deploy_spec.rb +13 -10
- data/spec/network_spec.rb +55 -52
- data/spec/packager_spec.rb +40 -40
- data/spec/selector_spec.rb +9 -9
- data/traquitana.gemspec +11 -11
- metadata +33 -37
- metadata.gz.sig +0 -0
- data/lib/migrator.rb +0 -25
- data/spec/migrator_spec.rb +0 -75
data/spec/selector_spec.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'fileutils'
|
2
|
+
require 'minitest/autorun'
|
3
3
|
require "#{File.expand_path(File.dirname(__FILE__))}/../lib/traquitana.rb"
|
4
4
|
|
5
5
|
describe Traquitana::Selector do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
it 'should have a selected files method' do
|
7
|
+
expect(Traquitana::Selector.new).must_respond_to :files
|
8
|
+
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
it 'should return the file list' do
|
11
|
+
list = Traquitana::Selector.new(File.expand_path(File.dirname(__FILE__)) + '/config/').files
|
12
|
+
expect(list.size).must_equal 29
|
13
|
+
end
|
14
14
|
end
|
data/traquitana.gemspec
CHANGED
@@ -2,25 +2,25 @@
|
|
2
2
|
require File.expand_path('../lib/traquitana/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = [
|
6
|
-
gem.email = [
|
5
|
+
gem.authors = ['Eustaquio Rangel']
|
6
|
+
gem.email = ['eustaquiorangel@gmail.com']
|
7
7
|
gem.description = %q{Simple tool for deploy Rails apps}
|
8
8
|
gem.summary = %q{Just a simple tool to deploy Rails apps with SSH and some shell scripts}
|
9
|
-
gem.homepage =
|
9
|
+
gem.homepage = 'http://github.com/taq/traquitana'
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name =
|
15
|
-
gem.require_paths = [
|
14
|
+
gem.name = 'traquitana'
|
15
|
+
gem.require_paths = ['lib']
|
16
16
|
gem.version = Traquitana::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency(
|
19
|
-
gem.add_dependency(
|
20
|
-
gem.add_dependency(
|
21
|
-
gem.add_dependency(
|
18
|
+
gem.add_dependency('highline', ['>= 0'])
|
19
|
+
gem.add_dependency('net-scp', ['>= 0'])
|
20
|
+
gem.add_dependency('net-ssh', ['>= 0'])
|
21
|
+
gem.add_dependency('rubyzip', ['>= 2.0.0'])
|
22
22
|
|
23
|
-
gem.license =
|
23
|
+
gem.license = 'GPL-2.0'
|
24
24
|
|
25
25
|
gem.signing_key = '/home/taq/.gemcert/gem-private_key.pem'
|
26
26
|
gem.cert_chain = ['gem-public_cert.pem']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traquitana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eustaquio Rangel
|
@@ -11,48 +11,48 @@ cert_chain:
|
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIEVjCCAr6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAqMSgwJgYDVQQDDB9ldXN0
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
14
|
+
YXF1aW9yYW5nZWwvREM9Z21haWwvREM9Y29tMB4XDTE5MTEyNzEzMDUyNVoXDTIw
|
15
|
+
MTEyNjEzMDUyNVowKjEoMCYGA1UEAwwfZXVzdGFxdWlvcmFuZ2VsL0RDPWdtYWls
|
16
|
+
L0RDPWNvbTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAL0m1eB2AEOm
|
17
|
+
l/LHYuLDv05uoaiJaoHRdDcxnATueUGVbGn97fiv1+d2xoXF66a3gww3Apn6vpTY
|
18
|
+
x4aTH11NVNdu9m5MGgHPiIqp8rNtyDt538OncgaTGKLOjUZW8jHGxk1/9y22gBYn
|
19
|
+
XCbLfIciPVOZV39hL5JHdy8obezijs+4TsUE8S5uFyiYGIL1eARyxPWWUENW9x2x
|
20
|
+
scEAW89hJ4tV+49I1UIqfIMKJb7dStiQM+HlBzNf7GkTwzaETHZEyCa7LdfiPI/s
|
21
|
+
iwW/mSoJx5997j6twsIKBVifYk/MEQjQkaLymgYu3CJ7qMaBGYAAJDZGATYt3SvC
|
22
|
+
HMTYhvG7qvbHtBWMeRwvSqNfsj39o59HL53H2G+jfNKpjb/TfRsBBzdGXobFLcH0
|
23
|
+
w91+QoFCquN0aNL6IRSY6hIwinIGGuggWEwp5jmPcYjav0I3tszV5iSxXreURX8S
|
24
|
+
KP+FR/LVd9lgeiNEcmpdkbNoQ1dd7RrRfFVOEcrqaiScRsCCZnMoHQIDAQABo4GG
|
25
|
+
MIGDMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRjzyGZfZ3j8BiB
|
26
|
+
+cEsJb0Lg6tz3jAkBgNVHREEHTAbgRlldXN0YXF1aW9yYW5nZWxAZ21haWwuY29t
|
27
27
|
MCQGA1UdEgQdMBuBGWV1c3RhcXVpb3JhbmdlbEBnbWFpbC5jb20wDQYJKoZIhvcN
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
AQELBQADggGBAHuTzyu0cDGVRsONr7PgY9eahH0ZGy/bdrk0FO0RpAOXayjsmmL2
|
29
|
+
Ouoi8VbWRzVtDvbQdU4bcsUnWkOMLImhlLs1VKAhOVxnV0ZGdyNQfLV1SXMAJkgc
|
30
|
+
AI7ClhA1YVBO70NaOyJPjaXs+lc4PltdEF59+YDCIVjAAoQd31F7x+eO2pjr+Mu1
|
31
|
+
yH5aCyn1BwklE7TF8076SZK4MNLeD/KD3whOjL0k1xeQqAqaImf+oxDbhU3tJCEd
|
32
|
+
dfcBNOr98LHzsGEYQRB24Ksnw7dcEqWs/trbJrgA7lX2/8TAch5fSLgVDQwSLPk7
|
33
|
+
E34l4xf0bry+lF2zuD15Mps1ZDxJhKcgDWNg82huuVh1zqzNYqgWB1hYPBehhXGo
|
34
|
+
NdMU5fm01/k08H5psRBGWS/EcpX063ll3qcOGVqbPPH2U3LCYzWww+2PdslwJo/c
|
35
|
+
uek3m7n2XoRODoAGEm3apnmP8WWMEmI0tXdsvDBwoNVXEMkFnxD+RIMQPW22r3ZL
|
36
|
+
waOiThAR0oxaTQ==
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2019-11-27 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
|
-
name:
|
41
|
+
name: highline
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: '0'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: '0'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name: net-
|
55
|
+
name: net-scp
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
name: net-
|
69
|
+
name: net-ssh
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
@@ -80,19 +80,19 @@ dependencies:
|
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
83
|
+
name: rubyzip
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 2.0.0
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
95
|
+
version: 2.0.0
|
96
96
|
description: Simple tool for deploy Rails apps
|
97
97
|
email:
|
98
98
|
- eustaquiorangel@gmail.com
|
@@ -121,7 +121,6 @@ files:
|
|
121
121
|
- lib/cleaner.rb
|
122
122
|
- lib/config.rb
|
123
123
|
- lib/deployer.rb
|
124
|
-
- lib/migrator.rb
|
125
124
|
- lib/packager.rb
|
126
125
|
- lib/selector.rb
|
127
126
|
- lib/ssh.rb
|
@@ -168,7 +167,6 @@ files:
|
|
168
167
|
- spec/config/public/stylesheets/application.css
|
169
168
|
- spec/config_spec.rb
|
170
169
|
- spec/deploy_spec.rb
|
171
|
-
- spec/migrator_spec.rb
|
172
170
|
- spec/network_spec.rb
|
173
171
|
- spec/packager_spec.rb
|
174
172
|
- spec/selector_spec.rb
|
@@ -193,8 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
191
|
- !ruby/object:Gem::Version
|
194
192
|
version: '0'
|
195
193
|
requirements: []
|
196
|
-
|
197
|
-
rubygems_version: 2.7.6
|
194
|
+
rubygems_version: 3.0.3
|
198
195
|
signing_key:
|
199
196
|
specification_version: 4
|
200
197
|
summary: Just a simple tool to deploy Rails apps with SSH and some shell scripts
|
@@ -240,7 +237,6 @@ test_files:
|
|
240
237
|
- spec/config/public/stylesheets/application.css
|
241
238
|
- spec/config_spec.rb
|
242
239
|
- spec/deploy_spec.rb
|
243
|
-
- spec/migrator_spec.rb
|
244
240
|
- spec/network_spec.rb
|
245
241
|
- spec/packager_spec.rb
|
246
242
|
- spec/selector_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/migrator.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require "yaml"
|
2
|
-
|
3
|
-
module Traquitana
|
4
|
-
class Migrator
|
5
|
-
def run
|
6
|
-
old_file = "./traq/config.yml"
|
7
|
-
new_file = "./config/traq.yml"
|
8
|
-
|
9
|
-
return false if !File.exists?(old_file) || File.exists?(new_file)
|
10
|
-
|
11
|
-
STDOUT.puts "Migrating old config file ..."
|
12
|
-
contents = YAML.load(File.read(old_file))
|
13
|
-
contents = contents.inject({}) {|hash,val| hash[val.first.to_s] = val.last; hash}.reject { |k,v| k == "ignore"}.to_yaml
|
14
|
-
File.open(new_file, "w") { |f| f << contents }
|
15
|
-
|
16
|
-
File.unlink(old_file)
|
17
|
-
first_run = "#{File.dirname(old_file)}/.first_run"
|
18
|
-
File.unlink(first_run) if File.exists?(first_run)
|
19
|
-
|
20
|
-
dir = "#{File.dirname(old_file)}"
|
21
|
-
Dir.unlink(dir) if Dir.exists?(dir)
|
22
|
-
true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/spec/migrator_spec.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
require "minitest/autorun"
|
2
|
-
require "#{File.expand_path(File.dirname(__FILE__))}/../lib/traquitana.rb"
|
3
|
-
|
4
|
-
describe Traquitana::Migrator do
|
5
|
-
before do
|
6
|
-
@migrator = Traquitana::Migrator.new
|
7
|
-
|
8
|
-
@old_file = "#{File.expand_path(File.dirname(__FILE__))}/../traq/config.yml"
|
9
|
-
@old_cont = File.read(@old_file)
|
10
|
-
|
11
|
-
@new_file = "#{File.expand_path(File.dirname(__FILE__))}/../config/traq.yml"
|
12
|
-
@new_cont = File.read(@new_file)
|
13
|
-
|
14
|
-
File.unlink(@new_file)
|
15
|
-
end
|
16
|
-
|
17
|
-
after do
|
18
|
-
FileUtils.mkdir(File.dirname(@old_file)) if !Dir.exists?(File.dirname(@old_file))
|
19
|
-
FileUtils.mkdir(File.dirname(@new_file)) if !Dir.exists?(File.dirname(@new_file))
|
20
|
-
|
21
|
-
File.open(@new_file,"w") {|f| f<<@new_cont}
|
22
|
-
File.open(@old_file,"w") {|f| f<<@old_cont}
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should have a run method" do
|
26
|
-
@migrator.must_respond_to(:run)
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should return false when there isn't an old config file" do
|
30
|
-
contents = File.read(@old_file)
|
31
|
-
File.unlink(@old_file)
|
32
|
-
assert !@migrator.run
|
33
|
-
File.open(@old_file,"w") {|f| f<<contents}
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should return false if there is a new config file" do
|
37
|
-
File.open(@new_file,"w") {|f| f<<@new_cont}
|
38
|
-
assert !@migrator.run
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should return true when there is an old config file" do
|
42
|
-
assert @migrator.run
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should have the new file after run" do
|
46
|
-
File.unlink(@new_file) if File.exists?(@new_file)
|
47
|
-
@migrator.run
|
48
|
-
assert File.exists?(@new_file)
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should not have the old file after run" do
|
52
|
-
@migrator.run
|
53
|
-
assert !File.exists?(@old_file)
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should not have the old dir after run" do
|
57
|
-
@migrator.run
|
58
|
-
assert !Dir.exists?(File.dirname(@old_file))
|
59
|
-
end
|
60
|
-
|
61
|
-
it "should not have the ignore clause on the new file" do
|
62
|
-
@migrator.run
|
63
|
-
assert !YAML.load(File.read(@new_file)).include?("ignore")
|
64
|
-
end
|
65
|
-
|
66
|
-
it "should have all the keys of the old file on the new one" do
|
67
|
-
old_content = YAML.load(File.read(@old_file)).reject {|k,v| k==:ignore}
|
68
|
-
@migrator.run
|
69
|
-
new_content = YAML.load(File.read(@new_file))
|
70
|
-
old_content.each do |key,val|
|
71
|
-
assert new_content.include?(key.to_s)
|
72
|
-
assert new_content[key.to_s].to_s==old_content[key].to_s
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|