workmesh 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/deployment-routines/update-config.rb +18 -0
- data/deployment-routines/update-source.rb +53 -0
- data/lib/workmesh.rb +2 -16
- metadata +4 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4e93016a2c4975149768794a4084eb3fb2b86af9752278ff780044d6ade7707
|
4
|
+
data.tar.gz: 81a01ab4e3d12ccab133853f6acd1233b300be0bfed817f74f53bc258224c86c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd19ed6730ccee45fd47eec84326b34ca506610ebf3cbabadf8cc5da8acc2a15baac5665140122116233c8d0569943983a2be495677e345789fe98407987d3f7
|
7
|
+
data.tar.gz: b1868444351445b73e1fbe87397873e40a545cb3bd1be2f697cfc9d719fde1800902cd37a63c332f0d05dc00c962e2bbc513d57c4949f6703c69bd5eed5a4f9c
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# setup deploying rutines
|
2
|
+
BlackStack::Deployer::add_routine({
|
3
|
+
:name => 'workmesh-update-config',
|
4
|
+
:commands => [
|
5
|
+
{
|
6
|
+
# back up old configuration file
|
7
|
+
# upload configuration file from local working directory to remote server
|
8
|
+
:command => "
|
9
|
+
cd ~/code/%workmesh_service%;
|
10
|
+
mv ./config.rb ./config.%timestamp%.rb;
|
11
|
+
echo \"%config_rb_content%\" > ./config.rb;
|
12
|
+
",
|
13
|
+
#:matches => [ /^$/, /mv: cannot stat '\.\/config.rb': No such file or directory/ ],
|
14
|
+
#:nomatches => [ { :nomatch => /.+/, :error_description => 'No output expected.' } ],
|
15
|
+
:sudo => false,
|
16
|
+
},
|
17
|
+
],
|
18
|
+
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# setup deploying rutines
|
2
|
+
BlackStack::Deployer::add_routine({
|
3
|
+
:name => 'workmesh-update-source',
|
4
|
+
:commands => [
|
5
|
+
{
|
6
|
+
:command => 'mkdir ~/code;',
|
7
|
+
:matches => [ /^$/i, /File exists/i ],
|
8
|
+
:sudo => false,
|
9
|
+
}, {
|
10
|
+
:command => 'mkdir -p ~/code/%workmesh_service%;',
|
11
|
+
:matches => [ /^$/i, /File exists/i ],
|
12
|
+
:sudo => false,
|
13
|
+
}, {
|
14
|
+
:command => '
|
15
|
+
cd ~/code/%workmesh_service%;
|
16
|
+
rm -r ./*;
|
17
|
+
git clone https://github.com/%workmesh_service% .;
|
18
|
+
',
|
19
|
+
:matches => [
|
20
|
+
/already exists and is not an empty directory/i,
|
21
|
+
/Cloning into/i,
|
22
|
+
/Resolving deltas\: 100\% \((\d)+\/(\d)+\), done\./i,
|
23
|
+
/fatal\: destination path \'.+\' already exists and is not an empty directory\./i,
|
24
|
+
],
|
25
|
+
:nomatches => [ # no output means success.
|
26
|
+
{ :nomatch => /error/i, :error_description => 'An Error Occurred' },
|
27
|
+
],
|
28
|
+
:sudo => false,
|
29
|
+
}, {
|
30
|
+
:command => '
|
31
|
+
cd ~/code/%workmesh_service%;
|
32
|
+
git fetch --all;
|
33
|
+
',
|
34
|
+
:matches => [/\-> origin\//, /^Fetching origin$/],
|
35
|
+
:nomatches => [ { :nomatch => /error/i, :error_description => 'An error ocurred.' } ],
|
36
|
+
:sudo => false,
|
37
|
+
}, {
|
38
|
+
:command => '
|
39
|
+
cd ~/code/%workmesh_service%;
|
40
|
+
git reset --hard origin/%git_branch%;
|
41
|
+
',
|
42
|
+
:matches => /HEAD is now at/,
|
43
|
+
:sudo => false,
|
44
|
+
}, {
|
45
|
+
#
|
46
|
+
:command => 'export RUBYLIB=~/code/%workmesh_service%;',
|
47
|
+
:nomatches => [
|
48
|
+
{ :nomatch => /.+/i, :error_description => 'No output expected' },
|
49
|
+
],
|
50
|
+
:sudo => false,
|
51
|
+
}
|
52
|
+
],
|
53
|
+
});
|
data/lib/workmesh.rb
CHANGED
@@ -2,7 +2,6 @@ require 'colorize'
|
|
2
2
|
require 'sequel'
|
3
3
|
require 'blackstack-core'
|
4
4
|
require 'blackstack-nodes'
|
5
|
-
require 'blackstack-deployer'
|
6
5
|
require 'simple_command_line_parser'
|
7
6
|
require 'simple_cloud_logging'
|
8
7
|
|
@@ -76,18 +75,6 @@ module BlackStack
|
|
76
75
|
ret[:workmesh_service] = self.workmesh_service
|
77
76
|
ret
|
78
77
|
end
|
79
|
-
# run deployment routines
|
80
|
-
def deploy(l=nil)
|
81
|
-
l = BlackStack::DummyLogger.new(nil) if l.nil?
|
82
|
-
|
83
|
-
l.logs 'Updating config.rb... '
|
84
|
-
BlackStack::Deployer::run_routine(self.name, 'workmesh-update-config')
|
85
|
-
l.done
|
86
|
-
|
87
|
-
l.logs 'Updating source... '
|
88
|
-
BlackStack::Deployer::run_routine(self.name, 'workmesh-update-source')
|
89
|
-
l.done
|
90
|
-
end
|
91
78
|
end # class Node
|
92
79
|
|
93
80
|
class Protocol
|
@@ -209,7 +196,8 @@ module BlackStack
|
|
209
196
|
if h[:protocols].is_a?(Array)
|
210
197
|
h[:protocols].each do |protocol|
|
211
198
|
errors << "The key :protocols must be an Array of valid hash descritors of the Protocol class" unless protocol.is_a?(Hash)
|
212
|
-
|
199
|
+
protocol_errors = Protocol.descriptor_errors(protocol)
|
200
|
+
errors << "The key :protocols must be an Array of valid hash descritors of the Protocol class. Errors found are: #{protocol_errors.join('. ')}" unless protocol_errors.length == 0
|
213
201
|
end
|
214
202
|
end
|
215
203
|
# validate: the key :assignation is nil or it is a symbol belonging the array ASSIGANTIONS
|
@@ -299,8 +287,6 @@ module BlackStack
|
|
299
287
|
# add a node to the infrastructure
|
300
288
|
def self.add_node(h)
|
301
289
|
@@nodes << BlackStack::Workmesh::Node.new(h)
|
302
|
-
# add to deployer
|
303
|
-
BlackStack::Deployer.add_node(h) #if @@integrate_with_blackstack_deployer
|
304
290
|
end
|
305
291
|
|
306
292
|
def self.nodes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workmesh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -70,26 +70,6 @@ dependencies:
|
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 1.2.11
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: blackstack-deployer
|
75
|
-
requirement: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: 1.2.24
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.2.24
|
83
|
-
type: :runtime
|
84
|
-
prerelease: false
|
85
|
-
version_requirements: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 1.2.24
|
90
|
-
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 1.2.24
|
93
73
|
- !ruby/object:Gem::Dependency
|
94
74
|
name: simple_command_line_parser
|
95
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,6 +124,8 @@ executables: []
|
|
144
124
|
extensions: []
|
145
125
|
extra_rdoc_files: []
|
146
126
|
files:
|
127
|
+
- deployment-routines/update-config.rb
|
128
|
+
- deployment-routines/update-source.rb
|
147
129
|
- lib/workmesh.rb
|
148
130
|
homepage: https://rubygems.org/gems/workmesh
|
149
131
|
licenses:
|