comrad 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -1
- data/comrad.gemspec +2 -2
- data/lib/comrad/notifier.rb +6 -6
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65b0763c5febe700ed75a932c1c2dacb44a772c3
|
4
|
+
data.tar.gz: a5ad52ae173ec08e29a99ce89097eac72ca24a9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df39545a8e9c536d2d0f33fcaf1bd6e878ca4888f8d733bab7b4626c805cdc795262a87f0ec8dbd866d4c8753334d1b6b895db4a97715caad0dbe3d3e3ee0a97
|
7
|
+
data.tar.gz: ebf5185b313fb5cacc3591364ef97b5d2fc7b9b8e390142205605df47a9ca22f67f2f2ce4aad9288571ea1da5e41ba3fe5875b265ecc5059a5f6327c1babfc9b
|
data/README.md
CHANGED
@@ -3,5 +3,35 @@ Comrad
|
|
3
3
|
[![Build Status](https://travis-ci.org/tas50/Comrad.svg)](https://travis-ci.org/tas50/Comrad)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/comrad.svg)](http://badge.fury.io/rb/comrad)
|
5
5
|
|
6
|
-
|
6
|
+
Comrad prevents human error, by automatically syncing changes on the master branch of your chef repo to your chef server. You eliminate the chance that someone uploads an outdated file or misses an upload, by automating the process. Comrad runs as a Jenkins job allowing you to trigger the job after acceptance tests. All changes are logged in the Jenkins job history and optionally log to Slack using Slack webhooks.
|
7
7
|
|
8
|
+
## Usage
|
9
|
+
Comrad has several command line options and also a YAML config file.
|
10
|
+
|
11
|
+
Command line options:
|
12
|
+
```
|
13
|
+
-p, --print Print the config options that would be used, and then exit
|
14
|
+
-c, --config comrad.yml Path to config file (defaults to /etc/comrad.yml)
|
15
|
+
-q, --quiet Don't post actions to Slack
|
16
|
+
-d, --dry-run Print what you would do, but don't actually do it
|
17
|
+
-s, --scary-mode Enable the deletion of objects if they've been removed from git
|
18
|
+
-h, --help Displays Help
|
19
|
+
```
|
20
|
+
|
21
|
+
Example YAML config:
|
22
|
+
```
|
23
|
+
---
|
24
|
+
slack:
|
25
|
+
webhook_url: 'https://hooks.slack.com/services/123/123/123
|
26
|
+
channel: 'ops-channel'
|
27
|
+
jenkins:
|
28
|
+
workspace_dir: '/var/jenkins/workspaces/myjob/'
|
29
|
+
url: 'http://jenkins.int.myco.co/'
|
30
|
+
username: 'jenkins-api-user'
|
31
|
+
password: 'jenkins-api-password'
|
32
|
+
job_name: 'my-jenkins-job'
|
33
|
+
chef:
|
34
|
+
pem_path: '/home/jenkins/.chef/jenkins.pem'
|
35
|
+
client_name: 'jenkins'
|
36
|
+
server_url: https://chef.int.myco.co
|
37
|
+
```
|
data/comrad.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'comrad'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.2'
|
4
4
|
s.date = Date.today.to_s
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.extra_rdoc_files = ['README.md', 'LICENSE']
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.required_ruby_version = '>= 1.9.3'
|
15
15
|
s.add_dependency 'rest-client', '~> 1.7.0'
|
16
16
|
s.add_dependency 'chef', '>= 11.0'
|
17
|
-
s.add_dependency 'slack-post', '~> 0.3'
|
17
|
+
s.add_dependency 'slack-post', '~> 0.3', '>= 0.3.1'
|
18
18
|
s.add_development_dependency 'rake', '~> 10.0'
|
19
19
|
s.add_development_dependency 'rubocop', '~> 0.30.0'
|
20
20
|
|
data/lib/comrad/notifier.rb
CHANGED
@@ -23,11 +23,11 @@ module Comrad
|
|
23
23
|
class Notifier
|
24
24
|
def self::configure
|
25
25
|
validate_config
|
26
|
-
|
27
|
-
webhook_url: Config.config['slack']['webhook_url']
|
28
|
-
|
29
|
-
|
30
|
-
)
|
26
|
+
slack_config = {
|
27
|
+
webhook_url: Config.config['slack']['webhook_url']
|
28
|
+
}
|
29
|
+
slack_config[:channel] = Config.config['slack']['channel'] if Config.config['slack']['channel']
|
30
|
+
Slack::Post.configure(slack_config)
|
31
31
|
@configured = true
|
32
32
|
end
|
33
33
|
|
@@ -62,7 +62,7 @@ module Comrad
|
|
62
62
|
|
63
63
|
# Ensure the slack config is present
|
64
64
|
def self::validate_config
|
65
|
-
unless Config.config['slack']['webhook_url']
|
65
|
+
unless Config.config['slack']['webhook_url']
|
66
66
|
puts "\nSlack config in comrad.yml is incomplete. Cannot continue.".to_red
|
67
67
|
exit!
|
68
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comrad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -45,6 +45,9 @@ dependencies:
|
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.3'
|
48
|
+
- - '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.3.1
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,6 +55,9 @@ dependencies:
|
|
52
55
|
- - ~>
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '0.3'
|
58
|
+
- - '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.3.1
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rake
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|