forked from OpenLMIS/env-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
52 lines (44 loc) · 2.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|======================================================|
| ____ _ __ __ _____ _____ |
| / __ \ | | | \/ |_ _|/ ____| |
| | | | |_ __ ___ _ __ | | | \ / | | | | (___ |
| | | | | '_ \ / _ \ '_ \| | | |\/| | | | \___ \ |
| | |__| | |_) | __/ | | | |____| | | |_| |_ ____) | |
| \____/| .__/ \___|_| |_|______|_| |_|_____|_____/ |
| | | |
| |_| |
| |
| env-setup |
;======================================================;
Currently this is mainly focussed to RHEL6/CentOS6 distros
Maintaining DevOps related Project requirements
* Requirements : ruby, chef, knife
============
SETUP
=====
Using Chef-Solo
--------------
* Set up your base machine as a knife client. Find more on chef http://wiki.opscode.com/display/chef/Chef+Basics
* Set up git on your base machine
* Run following commands : -
git clone https://github.com/OpenLMIS/env-setup.git
cd env-setup/chef-solo
knife bootstrap vm/ec2-IP/domain-name --template-file centos6.rb -x username
* The vm/ec2 instance is up and running with latest build.
Using Chef Server
----------------
* Set up a chef server as described in http://blog.frameos.org/2011/05/19/installing-chef-server-0-10-in-rhel-6-scientificlinux-6/
* Set up your base machine as a knife client. Find more on chef http://wiki.opscode.com/display/chef/Chef+Basics
* Bootstrap a new node using ./scripts/bootstrap-templates/centos6.rb. This will register the node to the chef server.
* Upload cookbooks from ./chef/cookbooks to the chef server
* Upload roles from ./chef/roles to the chef server
* Run baserole on the newly set up node
* Node is ready for the application to be deployed.
Cookbook Testing
================
* Using chefspec (rspec based) tool for cookbook testing https://github.com/acrmp/chefspec
* Gemfile in env-setup has the gems loaded.
* Run bundle install to install the gems.
* unit_test rake task is defined in Rakefile.
* Use `bundle exec rake` to test all cookbooks.
* For individual cookbook spec testing use `rspec chef/cookbooks/<cookbook_name>/spec/*_spec.rb`