deploy_pin 0.1.0 → 1.0.1
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 +4 -4
- data/README.md +1 -0
- data/lib/deploy_pin/runner.rb +16 -8
- data/lib/deploy_pin/task.rb +9 -0
- data/lib/deploy_pin/version.rb +1 -1
- data/lib/tasks/deploy_pin_tasks.rake +4 -4
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4a13417c42329f3d9c8fefbe1228db6af0f45ffd89a34f73a1889293d33383a
|
4
|
+
data.tar.gz: 4a7930087b3bf93992101ae0a7910a7a1d0a8db3ce8bdb5d14b3279ccd1191ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e42705e0a8627a0bb39e4eb55a6d5c7bf569761a78b87edd0e34d71ad89953b217bfc612e367eb5c60307aa46bd4021de934ee2775bcb6d79cdd8e7d5ce36404
|
7
|
+
data.tar.gz: 84ae0a66b25d736b2e148ff748ef427733c55d7d67c8eaceb5b6e76671c84d8c5481f40026a16f84af606edaf7c970422cdc3f413e625f54ad479745738c11e5
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[](https://badge.fury.io/rb/deploy_pin)
|
1
2
|
[](https://travis-ci.org/skcc321/deploy_pin)
|
2
3
|
[](https://codeclimate.com/github/skcc321/deploy_pin/maintainability)
|
3
4
|
[](https://codeclimate.com/github/skcc321/deploy_pin/test_coverage)
|
data/lib/deploy_pin/runner.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
# executes tasks
|
4
4
|
module DeployPin::Runner
|
5
|
-
def self.run(
|
6
|
-
tasks = pending(
|
5
|
+
def self.run(groups:)
|
6
|
+
tasks = pending(groups: groups)
|
7
7
|
tasks.each_with_index do |task, index|
|
8
8
|
puts "[#{index + 1}/#{tasks.count}] Task UUID #{task.uuid}"
|
9
9
|
task.run
|
@@ -11,26 +11,34 @@ module DeployPin::Runner
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.list(
|
15
|
-
pending(
|
14
|
+
def self.list(groups:)
|
15
|
+
pending(groups: groups).each_with_index do |task, index|
|
16
16
|
puts "======= Task ##{index} ========"
|
17
17
|
puts task.script
|
18
18
|
puts ""
|
19
19
|
end
|
20
20
|
|
21
21
|
puts "======= summary ========"
|
22
|
-
puts "tasks number: #{pending(
|
22
|
+
puts "tasks number: #{pending(groups: groups).count}"
|
23
23
|
end
|
24
24
|
|
25
|
-
def self.pending(
|
25
|
+
def self.pending(groups:)
|
26
26
|
files = Dir["#{DeployPin.tasks_path}/*.rb"]
|
27
27
|
|
28
|
+
# get done records uuids
|
28
29
|
records = DeployPin::Record.pluck(:uuid)
|
29
30
|
|
30
31
|
files.map do |file|
|
31
32
|
task = DeployPin::Task.new(file)
|
32
33
|
task.parse_file
|
33
|
-
|
34
|
-
|
34
|
+
|
35
|
+
# task is done
|
36
|
+
next if records.include?(task.uuid)
|
37
|
+
|
38
|
+
# group mismatch
|
39
|
+
next unless groups.include?(task.group)
|
40
|
+
|
41
|
+
task
|
42
|
+
end.compact.sort # sort by group position in config
|
35
43
|
end
|
36
44
|
end
|
data/lib/deploy_pin/task.rb
CHANGED
data/lib/deploy_pin/version.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
namespace :deploy_pin do
|
2
2
|
desc "run pending tasks"
|
3
|
-
task :run, [:
|
4
|
-
args.with_defaults(
|
3
|
+
task :run, [:groups] => :environment do |t, args|
|
4
|
+
args.with_defaults(groups: DeployPin.groups)
|
5
5
|
|
6
6
|
DeployPin::Runner.run(args)
|
7
7
|
end
|
8
8
|
|
9
|
-
task :list, [:
|
10
|
-
args.with_defaults(
|
9
|
+
task :list, [:groups] => :environment do |t, args|
|
10
|
+
args.with_defaults(groups: DeployPin.groups)
|
11
11
|
|
12
12
|
DeployPin::Runner.list(args)
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy_pin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rafael
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '10.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: simplecov
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
90
|
name: bundler
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,8 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
208
|
- !ruby/object:Gem::Version
|
195
209
|
version: '0'
|
196
210
|
requirements: []
|
197
|
-
|
198
|
-
rubygems_version: 2.7.6
|
211
|
+
rubygems_version: 3.0.2
|
199
212
|
signing_key:
|
200
213
|
specification_version: 4
|
201
214
|
summary: pin some task around deployment
|