grocery_delivery 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +29 -24
- data/bin/grocery-delivery +4 -4
- data/lib/grocery_delivery/hooks.rb +1 -1
- data/lib/grocery_delivery/logging.rb +8 -4
- metadata +77 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f337a09319eafef3f7c95d9fd358468a320c6912c580c9ec52fb59ab74203b44
|
4
|
+
data.tar.gz: 56bb4c32c4be6387fded401705215f699d17ba9d8ee90a1825e6bfefd5566fbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 110709d96037e3dec5636b43d2b4324dbeef043e5ec6476142c4a28023e5f18d9a90e8b8e5e24cf8126db0018bc4397bf66d563835199bb2783710061372570f
|
7
|
+
data.tar.gz: 35c38494431c9af2f7e1bdffd5a023160fa8744b7e94600d128be8ccf62ed4f218f36c50e589ec891bc1a3684020468f6b4450c6135d6115875e326cf3d47b14
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Grocery Delivery
|
2
2
|
|
3
|
-
|
3
|
+
![Continuous Integration](https://github.com/facebook/grocery-delivery/workflows/Continuous%20Integration/badge.svg?event=push)
|
4
4
|
|
5
5
|
## Intro
|
6
6
|
Ohai!
|
@@ -29,12 +29,12 @@ principals:
|
|
29
29
|
* You want all your chef-servers in sync
|
30
30
|
* Everything you care about comes from version control.
|
31
31
|
|
32
|
-
We recommend
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
We recommend enabling attributes whitelisting to prevent node attributes being
|
33
|
+
saved back to the server. In recent versions of Chef (past Chef 11), this
|
34
|
+
feature is [built-in](https://docs.chef.io/nodes/#whitelist-attributes). For
|
35
|
+
older versions, we recommend using the
|
36
|
+
[`whitelist_node_attrs`](https://github.com/chef-boneyard/whitelist-node-attrs)
|
37
|
+
cookbook.
|
38
38
|
|
39
39
|
## Dependencies
|
40
40
|
|
@@ -43,7 +43,7 @@ http://docs.getchef.com/essentials_node_object.html#whitelist-attributes
|
|
43
43
|
|
44
44
|
## Config file
|
45
45
|
|
46
|
-
The default config file is `/etc/gd-config.rb` but you may use
|
46
|
+
The default config file is `/etc/gd-config.rb` but you may use `-c` to specify
|
47
47
|
another. The config file works the same as client.rb does for Chef - there
|
48
48
|
are a series of keywords that take an argument and anything else is just
|
49
49
|
standard Ruby.
|
@@ -56,37 +56,38 @@ All command-line options are available in the config file:
|
|
56
56
|
* pidfile (string, default: `/var/run/grocery_delivery.pid`)
|
57
57
|
|
58
58
|
In addition the following are also available:
|
59
|
-
* master_path - The top-level path for Grocery Delivery's work. Most other
|
59
|
+
* `master_path` - The top-level path for Grocery Delivery's work. Most other
|
60
60
|
paths are relative to this. Default: `/var/chef/grocery_delivery_work`
|
61
|
-
* repo_url - The URL to clone/checkout if it doesn't exist. Default: `nil`
|
62
|
-
* reponame - The relative directory to check the repo out to, inside of
|
61
|
+
* `repo_url` - The URL to clone/checkout if it doesn't exist. Default: `nil`
|
62
|
+
* `reponame` - The relative directory to check the repo out to, inside of
|
63
63
|
`master_path`. Default: `ops`
|
64
|
-
* cookbook_paths - An array of directories that contain cookbooks relative to
|
64
|
+
* `cookbook_paths` - An array of directories that contain cookbooks relative to
|
65
65
|
`reponame`. Default: `['chef/cookbooks']`
|
66
|
-
* role_path - A directory to find roles in relative to `reponame`. Default:
|
66
|
+
* `role_path` - A directory to find roles in relative to `reponame`. Default:
|
67
67
|
`'chef/roles'`
|
68
|
-
*
|
68
|
+
* `role_type` - RB or JSON roles? Default: `rb`
|
69
|
+
* `databag_path` - A directory to find databags in relative to `reponame`.
|
69
70
|
Default: `'chef/databags'`
|
70
|
-
* rev_checkpoint - Name of the file to store the last-uploaded revision,
|
71
|
+
* `rev_checkpoint` - Name of the file to store the last-uploaded revision,
|
71
72
|
relative to `reponame`. Default: `gd_revision`
|
72
|
-
* knife_config - Knife config to use for uploads. Default:
|
73
|
+
* `knife_config` - Knife config to use for uploads. Default:
|
73
74
|
`/root/.chef/knife.rb`
|
74
75
|
Note: `knife.rb` will need to set `cookbook_path` pointing to the cookbook
|
75
76
|
path in the work directory,
|
76
77
|
e.g. `/var/chef/grocery_delivery_work/ops/chef/cookbooks`
|
77
|
-
* knife_bin - Path to knife. Default: `/opt/chef/bin/knife`
|
78
|
-
* vcs_type - Git or SVN? Default: `svn`
|
79
|
-
* vcs_path - Path to git or svn binary. If not given, just uses 'git' or 'svn'.
|
78
|
+
* `knife_bin` - Path to knife. Default: `/opt/chef/bin/knife`
|
79
|
+
* `vcs_type` - Git or SVN? Default: `svn`
|
80
|
+
* `vcs_path` - Path to git or svn binary. If not given, just uses 'git' or 'svn'.
|
80
81
|
Default: `nil`
|
81
|
-
* plugin_path - Path to plugin file. Default: `/etc/gd-plugin.rb`
|
82
|
-
* berks - Boolean to determine if we should use berkshelf to resolve
|
82
|
+
* `plugin_path` - Path to plugin file. Default: `/etc/gd-plugin.rb`
|
83
|
+
* `berks` - Boolean to determine if we should use berkshelf to resolve
|
83
84
|
dependencies and upload cookbooks. Default: `false`
|
84
|
-
* berks_bin - Path to berkshelf. Default: `/opt/chefdk/bin/berks`
|
85
|
+
* `berks_bin` - Path to berkshelf. Default: `/opt/chefdk/bin/berks`
|
85
86
|
|
86
87
|
## Plugin
|
87
88
|
|
88
89
|
The plugin should be a ruby file which defines several class methods. It is
|
89
|
-
class_eval()d into a Hooks class.
|
90
|
+
`class_eval()`d into a `Hooks` class.
|
90
91
|
|
91
92
|
The following functions can optionally be defined:
|
92
93
|
|
@@ -108,7 +109,7 @@ to parse it.
|
|
108
109
|
|
109
110
|
* self.postrun(dryrun, success, msg)
|
110
111
|
|
111
|
-
After we've parsed the updates to the repo and uploaded/deleted the
|
112
|
+
After we've parsed the updates to the repo and uploaded/deleted the relevant
|
112
113
|
items from the local server. `Success` is a bool for whether we succeeded, and
|
113
114
|
`msg` is the status message - either the revision we sync'd or an error.
|
114
115
|
|
@@ -116,3 +117,7 @@ items from the local server. `Success` is a bool for whether we succeeded, and
|
|
116
117
|
|
117
118
|
Same as postrun, but is registered as an atexit function so it happens even
|
118
119
|
if we crash.
|
120
|
+
|
121
|
+
## License
|
122
|
+
|
123
|
+
See the `LICENSE` file in this repo.
|
data/bin/grocery-delivery
CHANGED
@@ -62,7 +62,7 @@ end
|
|
62
62
|
|
63
63
|
def read_checkpoint
|
64
64
|
GroceryDelivery::Log.debug("Reading #{checkpoint_path}")
|
65
|
-
File.
|
65
|
+
File.exist?(checkpoint_path) ? File.read(checkpoint_path).strip : nil
|
66
66
|
end
|
67
67
|
|
68
68
|
def full_upload(knife)
|
@@ -84,7 +84,7 @@ end
|
|
84
84
|
|
85
85
|
def partial_upload(knife, repo, checkpoint, local_head)
|
86
86
|
GroceryDelivery::Log.warn(
|
87
|
-
"
|
87
|
+
"Determining changes... from #{checkpoint} to #{local_head}",
|
88
88
|
)
|
89
89
|
|
90
90
|
begin
|
@@ -191,7 +191,7 @@ def setup_config
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
opts.on('-c', '--config-file FILE', 'config file') do |s|
|
194
|
-
unless File.
|
194
|
+
unless File.exist?(File.expand_path(s))
|
195
195
|
GroceryDelivery::Log.error("Config file #{s} not found.")
|
196
196
|
exit(2)
|
197
197
|
end
|
@@ -207,7 +207,7 @@ def setup_config
|
|
207
207
|
options[:pidfile] = s
|
208
208
|
end
|
209
209
|
end.parse!
|
210
|
-
if File.
|
210
|
+
if File.exist?(File.expand_path(options[:config_file]))
|
211
211
|
GroceryDelivery::Config.from_file(options[:config_file])
|
212
212
|
end
|
213
213
|
GroceryDelivery::Config.merge!(options)
|
@@ -29,6 +29,10 @@ module GroceryDelivery
|
|
29
29
|
@@init = true
|
30
30
|
end
|
31
31
|
|
32
|
+
def self.level
|
33
|
+
@@level
|
34
|
+
end
|
35
|
+
|
32
36
|
def self.verbosity=(val)
|
33
37
|
@@level = val
|
34
38
|
end
|
@@ -48,25 +52,25 @@ module GroceryDelivery
|
|
48
52
|
|
49
53
|
def self.debug(msg)
|
50
54
|
if @@level == Logger::DEBUG
|
51
|
-
msg.prepend('DEBUG: ')
|
55
|
+
msg.to_s.prepend('DEBUG: ')
|
52
56
|
logit(Syslog::LOG_DEBUG, msg)
|
53
57
|
end
|
54
58
|
end
|
55
59
|
|
56
60
|
def self.info(msg)
|
57
61
|
if @@level == Logger::INFO
|
58
|
-
msg.prepend('INFO: ')
|
62
|
+
msg.to_s.prepend('INFO: ')
|
59
63
|
logit(Syslog::LOG_INFO, msg)
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
63
67
|
def self.warn(msg)
|
64
|
-
msg.prepend('WARN: ')
|
68
|
+
msg.to_s.prepend('WARN: ')
|
65
69
|
logit(Syslog::LOG_WARNING, msg)
|
66
70
|
end
|
67
71
|
|
68
72
|
def self.error(msg)
|
69
|
-
msg.prepend('ERROR: ')
|
73
|
+
msg.to_s.prepend('ERROR: ')
|
70
74
|
logit(Syslog::LOG_ERR, msg)
|
71
75
|
end
|
72
76
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grocery_delivery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Dibowitz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: between_meals
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.0.
|
20
|
+
version: 0.0.11
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.0.
|
27
|
+
version: 0.0.11
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: mixlib-config
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: chef-dk
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
@@ -68,7 +68,35 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: openssl
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec-core
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rspec-expectations
|
72
100
|
requirement: !ruby/object:Gem::Requirement
|
73
101
|
requirements:
|
74
102
|
- - ">="
|
@@ -81,6 +109,48 @@ dependencies:
|
|
81
109
|
- - ">="
|
82
110
|
- !ruby/object:Gem::Version
|
83
111
|
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rspec-mocks
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: simplecov
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: rubocop
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - '='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 0.55.0
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - '='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 0.55.0
|
84
154
|
description: Utility for keeping Chef servers in sync with a repo
|
85
155
|
email:
|
86
156
|
executables:
|
@@ -115,8 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
185
|
- !ruby/object:Gem::Version
|
116
186
|
version: '0'
|
117
187
|
requirements: []
|
118
|
-
|
119
|
-
rubygems_version: 2.6.11
|
188
|
+
rubygems_version: 3.0.1
|
120
189
|
signing_key:
|
121
190
|
specification_version: 4
|
122
191
|
summary: Grocery Delivery
|