traquitana 0.1.0 → 0.1.5
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Gemfile.lock +8 -8
- data/README.md +39 -23
- data/bin/traq +26 -26
- data/config/custom.yml +11 -24
- data/config/default.yml +6 -0
- data/config/proc.sh +52 -0
- data/config/traq.yml +1 -0
- data/gem-public_cert.pem +24 -20
- data/lib/bar.rb +1 -1
- data/lib/cleaner.rb +2 -2
- data/lib/config.rb +8 -8
- 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 +3 -0
- data/spec/config/Rakefile +11 -0
- data/spec/config/config/traq.yml +1 -0
- data/spec/config_spec.rb +106 -101
- data/spec/deploy_spec.rb +14 -7
- data/spec/network_spec.rb +55 -52
- data/spec/packager_spec.rb +40 -40
- data/spec/selector_spec.rb +9 -9
- data/traq/config.yml +6 -0
- data/traquitana.gemspec +11 -11
- metadata +35 -35
- metadata.gz.sig +0 -0
- data/lib/migrator.rb +0 -25
- data/spec/migrator_spec.rb +0 -75
data/spec/deploy_spec.rb
CHANGED
@@ -1,11 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require 'fileutils'
|
5
|
+
require 'minitest/autorun'
|
4
6
|
require "#{File.expand_path(File.dirname(__FILE__))}/../lib/traquitana.rb"
|
5
7
|
|
6
8
|
describe Traquitana::Deployer do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
before do
|
10
|
+
FileUtils.cd("#{__dir__}/config")
|
11
|
+
@config = Traquitana::Config.instance
|
12
|
+
@deploy = Traquitana::Deployer.new(verbose: true)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'deploys' do
|
16
|
+
@deploy.run
|
17
|
+
end
|
11
18
|
end
|
data/spec/network_spec.rb
CHANGED
@@ -1,56 +1,59 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'digest/md5'
|
2
|
+
require 'minitest/autorun'
|
3
3
|
require "#{File.expand_path(File.dirname(__FILE__))}/../lib/traquitana.rb"
|
4
4
|
|
5
5
|
describe Traquitana::SSH do
|
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
|
-
|
6
|
+
before do
|
7
|
+
@config = Traquitana::Config.instance
|
8
|
+
@network = Traquitana::SSH.new(@config.host, @config.user)
|
9
|
+
@send = "#{File.expand_path(File.dirname(__FILE__))}/config/network_test.txt"
|
10
|
+
@md5 = Digest::MD5.hexdigest(File.read(@send))
|
11
|
+
|
12
|
+
Dir.mkdir(@config.directory) if !File.exists?(@config.directory)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'configs' do
|
16
|
+
it 'should have a host attribute' do
|
17
|
+
expect(@network).must_respond_to :host
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should have an user attribute' do
|
21
|
+
expect(@network).must_respond_to :user
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should have an options attribute' do
|
25
|
+
expect(@network).must_respond_to :options
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'operations' do
|
30
|
+
it 'should have a send method' do
|
31
|
+
expect(@network).must_respond_to :send_files
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should send a file to the remote host' do
|
35
|
+
check = "#{@config.directory}/#{File.basename(@send)}"
|
36
|
+
File.unlink(check) if File.exists?(check)
|
37
|
+
|
38
|
+
@network.send_files([[@send, "#{@config.directory}/#{File.basename(@send)}"]], Traquitana::Bar.new)
|
39
|
+
|
40
|
+
expect(File.exists?(check)).must_equal true
|
41
|
+
expect(Digest::MD5.hexdigest(File.read(check))).must_equal @md5
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should have a execute method' do
|
45
|
+
expect(@network).must_respond_to :execute
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should execute a command on the remote host' do
|
49
|
+
remote_dir = "#{@config.directory}/remote_dir"
|
50
|
+
FileUtils.rmdir(remote_dir) if File.exists?(remote_dir)
|
51
|
+
|
52
|
+
@network.execute(["mkdir #{@config.directory}/remote_dir"])
|
53
|
+
expect(File.exists?(remote_dir)).must_equal true
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "uploading" do
|
58
|
+
end
|
56
59
|
end
|
data/spec/packager_spec.rb
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'fileutils'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'minitest/focus'
|
3
4
|
require "#{File.expand_path(File.dirname(__FILE__))}/../lib/traquitana.rb"
|
4
5
|
|
5
6
|
describe Traquitana::Packager do
|
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
|
-
|
7
|
+
before do
|
8
|
+
@packager = Traquitana::Packager.new(File.expand_path(File.dirname(__FILE__)) + '/config/')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should have an id method' do
|
12
|
+
expect(@packager).must_respond_to :id
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should return an id' do
|
16
|
+
expect(@packager.id).wont_be_nil
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should have a list file method' do
|
20
|
+
expect(@packager).must_respond_to :list_file
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should return the correct list file name' do
|
24
|
+
expect(@packager.list_file).must_equal @packager.id + '.list'
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should have a zip file method' do
|
28
|
+
expect(@packager).must_respond_to :zip_file
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should return the correct zip file name' do
|
32
|
+
expect(@packager.zip_file).must_equal @packager.id + '.zip'
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should have a pack method' do
|
36
|
+
expect(@packager).must_respond_to :pack
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should return the list and package file' do
|
40
|
+
list, package = @packager.pack
|
41
|
+
expect(list).wont_be_nil
|
42
|
+
expect(package).wont_be_nil
|
43
|
+
end
|
43
44
|
end
|
44
|
-
|
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/traq/config.yml
CHANGED
@@ -6,12 +6,18 @@
|
|
6
6
|
- Rakefile
|
7
7
|
- config.ru
|
8
8
|
- Gemfile
|
9
|
+
- package.json
|
10
|
+
- postcss.config.js
|
9
11
|
- - config/application.rb
|
10
12
|
- - config/environment.rb
|
11
13
|
- - config/initializers/**/*
|
12
14
|
- - config/environments/production.rb
|
13
15
|
- - config/locales/**/*
|
14
16
|
- - config/routes.rb
|
17
|
+
- - config/storage.yml
|
18
|
+
- - config/webpacker.yml
|
19
|
+
- - config/webpack/environment.js
|
20
|
+
- - config/webpack/production.js
|
15
21
|
- - app/**/*
|
16
22
|
- - db/migrate/**/*
|
17
23
|
- - public/javascripts/**/*
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eustaquio Rangel
|
@@ -10,45 +10,49 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEVjCCAr6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAqMSgwJgYDVQQDDB9ldXN0
|
14
|
+
YXF1aW9yYW5nZWwvREM9Z21haWwvREM9Y29tMB4XDTIxMDEwNTE1MTMzNFoXDTIy
|
15
|
+
MDEwN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yCJyUCFwuxAt9V
|
30
|
+
GLCyn2Ti9MIT0FyujhEXSQdJjAyuDGtEkO2LIKBJ+CIbG68FBqc1k+UwPQiNJCgE
|
31
|
+
s3Fsha0Wv75uupzqu57FHXHSjdnBNeQHfdC+Ma8VIlWdKxfcxZKOEL589tnJTJHF
|
32
|
+
IRNTTxZFwTTvZy2aSvBb73m+clb36mlGO3emb/S3WMu2oOlmorHD4CAbyZjPTwIs
|
33
|
+
zYVH+Nlf2O8Li2j3QNGL0r2MNCJWeuhB23IOoL60AaxvpyHAbWnfOpqidQU1Zwpg
|
34
|
+
cXxQcroczXGs/RH1diJes5AihU97po1EVyVpxjkyiVZxd0fl+r3OR7iYSSNMrdpH
|
35
|
+
Ey5t62RSM7fM69lDtUa1Jmv/CCRAeeY4TQUFwDrnNYhxQshCWcrFWQMb4ExJtwbC
|
36
|
+
iQ4FrdvzJJS+rA==
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
41
|
+
name: highline
|
38
42
|
requirement: !ruby/object:Gem::Requirement
|
39
43
|
requirements:
|
40
44
|
- - ">="
|
41
45
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
46
|
+
version: '0'
|
43
47
|
type: :runtime
|
44
48
|
prerelease: false
|
45
49
|
version_requirements: !ruby/object:Gem::Requirement
|
46
50
|
requirements:
|
47
51
|
- - ">="
|
48
52
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
53
|
+
version: '0'
|
50
54
|
- !ruby/object:Gem::Dependency
|
51
|
-
name: net-
|
55
|
+
name: net-scp
|
52
56
|
requirement: !ruby/object:Gem::Requirement
|
53
57
|
requirements:
|
54
58
|
- - ">="
|
@@ -62,7 +66,7 @@ dependencies:
|
|
62
66
|
- !ruby/object:Gem::Version
|
63
67
|
version: '0'
|
64
68
|
- !ruby/object:Gem::Dependency
|
65
|
-
name: net-
|
69
|
+
name: net-ssh
|
66
70
|
requirement: !ruby/object:Gem::Requirement
|
67
71
|
requirements:
|
68
72
|
- - ">="
|
@@ -76,19 +80,19 @@ dependencies:
|
|
76
80
|
- !ruby/object:Gem::Version
|
77
81
|
version: '0'
|
78
82
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
83
|
+
name: rubyzip
|
80
84
|
requirement: !ruby/object:Gem::Requirement
|
81
85
|
requirements:
|
82
86
|
- - ">="
|
83
87
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
88
|
+
version: 2.0.0
|
85
89
|
type: :runtime
|
86
90
|
prerelease: false
|
87
91
|
version_requirements: !ruby/object:Gem::Requirement
|
88
92
|
requirements:
|
89
93
|
- - ">="
|
90
94
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
95
|
+
version: 2.0.0
|
92
96
|
description: Simple tool for deploy Rails apps
|
93
97
|
email:
|
94
98
|
- eustaquiorangel@gmail.com
|
@@ -117,7 +121,6 @@ files:
|
|
117
121
|
- lib/cleaner.rb
|
118
122
|
- lib/config.rb
|
119
123
|
- lib/deployer.rb
|
120
|
-
- lib/migrator.rb
|
121
124
|
- lib/packager.rb
|
122
125
|
- lib/selector.rb
|
123
126
|
- lib/ssh.rb
|
@@ -164,7 +167,6 @@ files:
|
|
164
167
|
- spec/config/public/stylesheets/application.css
|
165
168
|
- spec/config_spec.rb
|
166
169
|
- spec/deploy_spec.rb
|
167
|
-
- spec/migrator_spec.rb
|
168
170
|
- spec/network_spec.rb
|
169
171
|
- spec/packager_spec.rb
|
170
172
|
- spec/selector_spec.rb
|
@@ -189,8 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
191
|
- !ruby/object:Gem::Version
|
190
192
|
version: '0'
|
191
193
|
requirements: []
|
192
|
-
|
193
|
-
rubygems_version: 2.6.11
|
194
|
+
rubygems_version: 3.1.4
|
194
195
|
signing_key:
|
195
196
|
specification_version: 4
|
196
197
|
summary: Just a simple tool to deploy Rails apps with SSH and some shell scripts
|
@@ -236,7 +237,6 @@ test_files:
|
|
236
237
|
- spec/config/public/stylesheets/application.css
|
237
238
|
- spec/config_spec.rb
|
238
239
|
- spec/deploy_spec.rb
|
239
|
-
- spec/migrator_spec.rb
|
240
240
|
- spec/network_spec.rb
|
241
241
|
- spec/packager_spec.rb
|
242
242
|
- spec/selector_spec.rb
|