Skip to content

Commit ccbe6f7

Browse files
committed
Initial commit
0 parents  commit ccbe6f7

18 files changed

+412
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.vagrant
2+
Berksfile.lock
3+
*~
4+
*#
5+
.#*
6+
\#*#
7+
.*.sw[a-z]
8+
*.un~
9+
10+
# Bundler
11+
Gemfile.lock
12+
bin/*
13+
.bundle/*
14+
15+
.kitchen/
16+
.kitchen.local.yml

.kitchen.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
driver:
3+
name: vagrant
4+
5+
provisioner:
6+
name: chef_zero
7+
8+
platforms:
9+
- name: ubuntu-12.04
10+
- name: centos-6.5
11+
12+
suites:
13+
- name: default
14+
run_list:
15+
- recipe[mailhog::default]
16+
attributes:

Berksfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://supermarket.chef.io"
2+
3+
metadata

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0.1.0 (2015-03-23)
2+
------------------
3+
4+
* Initial release

CONTRIBUTING.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# How to contribute
2+
3+
I appreciate any kind of contributions. Please feel free to submit issue reports, feature suggestions and especially pull requests. But please take a moment to review following guidelines.
4+
5+
## Got a Question?
6+
7+
Please don't use Github Issues for asking questions. This project uses Github Issues for bug tracking and feature management only, not as some kind of support forum.
8+
If you have personal support request or any questions about how to use this project, please feel free to send an email to project maintainer. You may find the email address in maintainer's Github profile.
9+
10+
## Reporting bugs
11+
12+
Please make sure that issue is reproducible on the latest code in `develop` branch in the repository.
13+
14+
Be sure to include enough of information so that your issue can be recreated.
15+
16+
Make sure that no other similar issues already exist.
17+
18+
## Submitting pull requests
19+
20+
### Branches
21+
22+
This repository is using [git flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model. If you're not familiar with it, please take a moment to read the text by the link.
23+
24+
Generally it means that all new branches should be forked from `develop` branch, not from `master`.
25+
26+
### Pull request workflow
27+
28+
1. Fork the repo.
29+
2. Checkout your new branch from `develop` branch.
30+
3. Push your changes to your branch in your fork of repository.
31+
4. Submit a pull request to the upstream repository.

Gemfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem "berkshelf"
4+
gem "stove", "~> 3.0.0"
5+

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015 Sergey Storchay
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# chef-mailhog
2+
3+
[![CK Version](http://img.shields.io/cookbook/v/mailhog.svg)](https://supermarket.getchef.com/cookbooks/mailhog)
4+
5+
This cookbook installs [MailHog](https://github.com/mailhog/MailHog).
6+
7+
Usage
8+
-----
9+
10+
Include the mailhog recipe to install MailHog on your system:
11+
```chef
12+
include_recipe "mailhog"
13+
```
14+
15+
MailHog service is installed and managed via `runit`.
16+
17+
Requirements
18+
------------
19+
20+
### Cookbooks:
21+
22+
* runit
23+
24+
### Platforms:
25+
26+
* Ubuntu
27+
* Debian
28+
* RHEL
29+
* CentOS
30+
* Fedora
31+
32+
License
33+
-------
34+
35+
Copyright (c) 2015 Sergey Storchay, http://r8.com.ua
36+
37+
Licensed under MIT:
38+
http://raw.github.com/r8/chef-mailhog/master/LICENSE

attributes/default.rb

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Cookbook Name:: mailhog
3+
# Recipe:: default
4+
#
5+
# Copyright (c) 2015 Sergey Storchay, All Rights Reserved.
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in all
15+
# copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
#
25+
26+
default['mailhog']['version'] = '0.1.6'
27+
default['mailhog']['install_method'] = 'binary'
28+
29+
default['mailhog']['binary']['url'] = nil # Set it to override automatical generation
30+
31+
default['mailhog']['binary']['mode'] = 0755
32+
default['mailhog']['binary']['path'] = '/usr/local/bin/MailHog'
33+
34+
default['mailhog']['binary']['prefix_url'] = 'http://github.com/mailhog/MailHog/releases/download/v'
35+
default['mailhog']['binary']['checksum']['linux_386'] = 'a72d1016b70964562c8a77a3b57637a77889ee61f3b22973e0a7beb17181d8da'
36+
default['mailhog']['binary']['checksum']['linux_amd64'] = 'e8e9acb4fa4470f4d4c3a4bba312f335bfc28122ea723599531699f099b4c9a5'

chefignore

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Put files/directories that should be ignored in this file when uploading
2+
# or sharing to the community site.
3+
# Lines that start with '# ' are comments.
4+
5+
# OS generated files #
6+
######################
7+
.DS_Store
8+
Icon?
9+
nohup.out
10+
ehthumbs.db
11+
Thumbs.db
12+
13+
# SASS #
14+
########
15+
.sass-cache
16+
17+
# EDITORS #
18+
###########
19+
\#*
20+
.#*
21+
*~
22+
*.sw[a-z]
23+
*.bak
24+
REVISION
25+
TAGS*
26+
tmtags
27+
*_flymake.*
28+
*_flymake
29+
*.tmproj
30+
.project
31+
.settings
32+
mkmf.log
33+
34+
## COMPILED ##
35+
##############
36+
a.out
37+
*.o
38+
*.pyc
39+
*.so
40+
*.com
41+
*.class
42+
*.dll
43+
*.exe
44+
*/rdoc/
45+
46+
# Testing #
47+
###########
48+
.watchr
49+
.rspec
50+
spec/*
51+
spec/fixtures/*
52+
test/*
53+
features/*
54+
Guardfile
55+
Procfile
56+
57+
# SCM #
58+
#######
59+
.git
60+
*/.git
61+
.gitignore
62+
.gitmodules
63+
.gitconfig
64+
.gitattributes
65+
.svn
66+
*/.bzr/*
67+
*/.hg/*
68+
*/.svn/*
69+
70+
# Berkshelf #
71+
#############
72+
Berksfile
73+
Berksfile.lock
74+
cookbooks/*
75+
tmp
76+
77+
# Cookbooks #
78+
#############
79+
CONTRIBUTING
80+
81+
# Strainer #
82+
############
83+
Colanderfile
84+
Strainerfile
85+
.colander
86+
.strainer
87+
88+
# Vagrant #
89+
###########
90+
.vagrant
91+
Vagrantfile
92+
93+
# Travis #
94+
##########
95+
.travis.yml

metadata.rb

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name 'mailhog'
2+
maintainer 'Sergey Storchay'
3+
maintainer_email '[email protected]'
4+
license 'MIT'
5+
description 'Installs/Configures mailhog'
6+
version '0.1.0'
7+
8+
depends 'runit', '>= 0.0.0'
9+
10+
%w(debian ubuntu centos redhat smartos).each do |os|
11+
supports os, '>= 0.0.0'
12+
end

recipes/binary.rb

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Cookbook Name:: mailhog
3+
# Recipe:: default
4+
#
5+
# Copyright (c) 2015 Sergey Storchay, All Rights Reserved.
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in all
15+
# copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
#
25+
26+
include_recipe 'runit'
27+
28+
arch = node['kernel']['machine'] =~ /x86_64/ ? 'amd64' : '386'
29+
30+
if node['mailhog']['binary']['url']
31+
binary_url = node['mailhog']['binary']['url']
32+
checksum = node['mailhog']['binary']['checksum']
33+
else
34+
binary_url = "#{node['mailhog']['binary']['prefix_url']}#{node['mailhog']['version']}/MailHog_linux_#{arch}"
35+
checksum = node['mailhog']['binary']['checksum']["linux_#{arch}"]
36+
end
37+
38+
# Download and install binary file
39+
remote_file node['mailhog']['binary']['path'] do
40+
source binary_url
41+
checksum checksum
42+
mode node['mailhog']['binary']['mode']
43+
action :create
44+
end
45+
46+
# Setup runit service
47+
runit_service 'mailhog' do
48+
default_logger true
49+
end

recipes/default.rb

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Cookbook Name:: mailhog
3+
# Recipe:: default
4+
#
5+
# Copyright (c) 2015 Sergey Storchay, All Rights Reserved.
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in all
15+
# copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
#
25+
26+
include_recipe "mailhog::#{node['mailhog']['install_method']}"

spec/spec_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'chefspec'
2+
require 'chefspec/berkshelf'

0 commit comments

Comments
 (0)