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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d764f2405cc54fc402db2ea721aaf06f0618e64
4
- data.tar.gz: c9cdd17e48479bfc8b2e8bf7a80b02159afcbe8e
3
+ metadata.gz: 65b0763c5febe700ed75a932c1c2dacb44a772c3
4
+ data.tar.gz: a5ad52ae173ec08e29a99ce89097eac72ca24a9a
5
5
  SHA512:
6
- metadata.gz: 58331c3e29042ee858df78513f097301d64b3285197ffc9f0b15e90e5e32371a495ffc86da10ad67ceabe76e933c2c2e5d5c425fd9e66852824d96f637e088e4
7
- data.tar.gz: c469074647c9914ea46e84537b4f20524f4dfa29184efd5f38b5495593ee3ea32dd72b7046025f69f7597bf7725f205117f503b8641f727fcb64deb3f7c32176
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
- Application to sync changes from git to Chef Server via Jenkins
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
+ ```
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'comrad'
3
- s.version = '0.1.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
 
@@ -23,11 +23,11 @@ module Comrad
23
23
  class Notifier
24
24
  def self::configure
25
25
  validate_config
26
- Slack::Post.configure(
27
- webhook_url: Config.config['slack']['webhook_url'],
28
- username: 'comrad',
29
- channel: Config.config['slack']['channel']
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'] && Config.config['slack']['channel']
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.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-24 00:00:00.000000000 Z
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