traquitana 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02aba41ee56fff3715bc9b3a5f14f17939c9ad771c28841aab1ea6a81e5c5c6b
4
- data.tar.gz: 240fbc2ff2b332a037a81bb3b4b49e4d21f4680bba41131fc99e189cbb35e7df
3
+ metadata.gz: 8796c0d24b549a6b7f848ffc2bc374a23590d312c0d49b83d9587b956e905e08
4
+ data.tar.gz: f23850ebdac4fac4e173132d1d55ff293178fca42b49a0744cb59cfb6c40672b
5
5
  SHA512:
6
- metadata.gz: a6056e8b0317117224029b52d1b3da160665dc06844a64bd4258b6993198d348914b1697692a437c5fa7de08bb05e53f7f200d32c6d9f6323fb0f66e39d15ad2
7
- data.tar.gz: 8777dbf451d8323bd78f36935c8f4ca3543e3ceb2dc193a4afd3df022e115fde4ffe9a682db3fb698e7941dc12ad1d76a6db966ac1cf9d6f577bd2fac20280ae
6
+ metadata.gz: 6aa9a2e32d9435b2806a5a624c8477a3e6533c9239d41672585eab142227ea85f35d2adde1f4a765757be4bcd50c4198d0b682f91cc97ff24e7623bb7d7fcd28
7
+ data.tar.gz: f753cee4d955b30333e8d575666366a3bee2421c559cf1b6f5e2fe3fa28e54c3aa92dae7cf0543f962eb7fbf1ed1978b1225914ec3643da2c34c68cd7aab3ea5
checksums.yaml.gz.sig CHANGED
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- traquitana (0.1.7)
4
+ traquitana (2.0.6)
5
+ bcrypt_pbkdf
6
+ ed25519
5
7
  highline
6
8
  net-scp
7
9
  net-ssh
@@ -10,10 +12,16 @@ PATH
10
12
  GEM
11
13
  remote: https://rubygems.org/
12
14
  specs:
13
- highline (2.0.3)
14
- net-scp (3.0.0)
15
- net-ssh (>= 2.6.5, < 7.0.0)
16
- net-ssh (6.1.0)
15
+ bcrypt_pbkdf (1.1.1)
16
+ ed25519 (1.3.0)
17
+ highline (3.1.1)
18
+ reline
19
+ io-console (0.7.2)
20
+ net-scp (4.0.0)
21
+ net-ssh (>= 2.6.5, < 8.0.0)
22
+ net-ssh (7.3.0)
23
+ reline (0.5.10)
24
+ io-console (~> 0.5)
17
25
  rubyzip (2.3.2)
18
26
 
19
27
  PLATFORMS
data/README.md CHANGED
@@ -44,6 +44,9 @@ $ gem install traquitana
44
44
  - ignore: it will just send the files that had changed on less than the number of hours configured here
45
45
  - server: the webserver running on the server. ex: passenger
46
46
  - list: the list of file patterns searched to send to the server
47
+ - branches: optional, will check if your Git current branch is allowed on
48
+ the branches listed here (comma separated), preventing from deploying from
49
+ a wrong branch
47
50
 
48
51
  On the list can have two elements by row, like:
49
52
 
@@ -70,12 +73,12 @@ $ gem install traquitana
70
73
  - Will create a list with the file names found
71
74
  - Will zíp the files.
72
75
  - Will send the list to the server, together with some control files.
73
- - What the control files are for: they are shell scripts that will zip the
74
- old files (based on what new files are going), unzip the new files, run
75
- migrations if needed, run bundle install if the Gemfile contents changed
76
- and restart the web server. There are two files: one generic to make all
77
- sort of things BUT not restarting the web server. The webserver script will
78
- be send based on what webserver you need.
76
+ - What the control files are for: they are shell scripts that will zip the
77
+ old files (based on what new files are going), unzip the new files, run
78
+ migrations if needed, run bundle install if the Gemfile contents changed
79
+ and restart the web server. There are two files: one generic to make all
80
+ sort of things BUT not restarting the web server. The webserver script will
81
+ be send based on what webserver you need.
79
82
 
80
83
  - Now everything should be updated. On the next time you want to update your
81
84
  project, just run traq again.
@@ -86,7 +89,7 @@ $ gem install traquitana
86
89
  Use for your risk. I think it's all ok but I don't give you guarantee if it
87
90
  break something.
88
91
 
89
- ## Options
92
+ ## CLI options
90
93
 
91
94
  There are some command line options:
92
95
 
data/lib/deployer.rb CHANGED
@@ -11,7 +11,7 @@ module Traquitana
11
11
  STDOUT.puts "\e[1mRunning Traquitana version #{VERSION}\e[0m\n\n"
12
12
 
13
13
  unless File.exist?(@config.filename)
14
- warn "\e[31mNo config file (#{@config.filename}) found."
14
+ warn "\e[31mNo config file (#{@config.filename}) found.\e[0m"
15
15
  warn "Did you run \e[1mtraq setup\e[0;31m ?"
16
16
  warn "Run it and check the configuration before deploying.\e[0m"
17
17
  exit 1
@@ -19,6 +19,8 @@ module Traquitana
19
19
 
20
20
  @config.load
21
21
 
22
+ check_branches
23
+
22
24
  @options = @config.password.size > 1 ? { password: @config.password } : {}
23
25
  @server = @config.server.to_s.size > 0 ? @config.server : "none"
24
26
  @shell = @config.shell ? "#{@config.shell} " : ""
@@ -66,5 +68,17 @@ module Traquitana
66
68
 
67
69
  @config.filename
68
70
  end
71
+
72
+ def check_branches
73
+ return if @config.branches.to_s.size < 1
74
+
75
+ current_branch = Git.current_branch
76
+ STDOUT.puts "Checking if current branch \e[1m#{current_branch}\e[0m is allowed in #{@config.branches}\n"
77
+
78
+ return if @config.branches.split(',').map(&:strip).include?(current_branch)
79
+
80
+ warn "Branch \e[31m#{current_branch}\e[0m not allowed to deploy!\n\n"
81
+ exit 1
82
+ end
69
83
  end
70
84
  end
data/lib/git.rb ADDED
@@ -0,0 +1,11 @@
1
+ module Traquitana
2
+ class Git
3
+ def self.current_branch
4
+ IO.popen('git rev-parse --abbrev-ref HEAD') do |io|
5
+ io.read.chomp
6
+ end
7
+ rescue
8
+ nil
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Traquitana
2
- VERSION = '2.0.5'
2
+ VERSION = '2.0.6'
3
3
  end
data/lib/traquitana.rb CHANGED
@@ -1,3 +1,3 @@
1
- %w(traquitana/version config selector deployer packager ssh bar cleaner).each do |file|
1
+ %w(traquitana/version config selector deployer packager ssh bar cleaner git).each do |file|
2
2
  require File.dirname(__FILE__)+"/"+file
3
3
  end
data.tar.gz.sig CHANGED
Binary file
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: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eustaquio Rangel
@@ -36,7 +36,7 @@ cert_chain:
36
36
  NO+xAJE0adRapfa4LBdJ6bGWqGA7u39vdJcIAbyTbO17MMWXItJuD3zDdng/9JWP
37
37
  XJH9EG4shjCU
38
38
  -----END CERTIFICATE-----
39
- date: 2024-06-21 00:00:00.000000000 Z
39
+ date: 2024-11-01 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: highline
@@ -150,6 +150,7 @@ files:
150
150
  - lib/cleaner.rb
151
151
  - lib/config.rb
152
152
  - lib/deployer.rb
153
+ - lib/git.rb
153
154
  - lib/packager.rb
154
155
  - lib/selector.rb
155
156
  - lib/ssh.rb
@@ -219,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  - !ruby/object:Gem::Version
220
221
  version: '0'
221
222
  requirements: []
222
- rubygems_version: 3.5.6
223
+ rubygems_version: 3.5.9
223
224
  signing_key:
224
225
  specification_version: 4
225
226
  summary: Just a simple tool to deploy Rails apps with SSH and some shell scripts
metadata.gz.sig CHANGED
Binary file