Commit 5203951a978b5ded67040dbaaf5283118faafa5e

Authored by Will Farrington

Merge pull request #36 from kevinSuttle/master

Add missing opt dir commands

Showing 1 changed file Inline Diff

# Our Boxen 1 1 # Our Boxen
2 2
This is a template Boxen project designed for your organization to fork and 3 3 This is a template Boxen project designed for your organization to fork and
modify appropriately. 4 4 modify appropriately.
The Boxen rubygem and the Boxen puppet modules are only a framework for getting 5 5 The Boxen rubygem and the Boxen puppet modules are only a framework for getting
things done. 6 6 things done.
This repository template is just a basic example of _how_ to do things with them. 7 7 This repository template is just a basic example of _how_ to do things with them.
8 8
## Getting Started 9 9 ## Getting Started
10 10
1. Install Xcode Command Line Tools and/or full Xcode. 11 11 1. Install Xcode Command Line Tools and/or full Xcode.
* If using full Xcode, you'll need to agree to the license by running: `xcodebuild -license` 12 12 * If using full Xcode, you'll need to agree to the license by running: `xcodebuild -license`
1. Create a new repository on GitHub as your user for your Boxen. (eg. 13 13 1. Create a new repository on GitHub as your user for your Boxen. (eg.
`wfarr/my-boxen`). **Make sure it is a private repository!** 14 14 `wfarr/my-boxen`). **Make sure it is a private repository!**
1. Use your install of [boxen-web](https://github.com/boxen/boxen-web) or get running manually like so: 15 15 1. Use your install of [boxen-web](https://github.com/boxen/boxen-web) or get running manually like so:
``` 16 16 ```
17 sudo mkdir -p /opt/boxen
18 sudo chown $USER:admin /opt/boxen
mkdir -p ~/src/my-boxen 17 19 mkdir -p ~/src/my-boxen
cd ~/src/my-boxen 18 20 cd ~/src/my-boxen
git init 19 21 git init
git remote add upstream https://github.com/boxen/our-boxen 20 22 git remote add upstream https://github.com/boxen/our-boxen
git fetch upstream 21 23 git fetch upstream
git checkout -b master upstream/master 22 24 git checkout -b master upstream/master
git remote add origin https://github.com/wfarr/my-boxen 23 25 git remote add origin https://github.com/wfarr/my-boxen
git push origin master 24 26 git push origin master
25 27
script/boxen 26 28 script/boxen
``` 27 29 ```
30
1. Close and reopen your Terminal. If you have a shell config file 28 31 1. Close and reopen your Terminal. If you have a shell config file
(eg. `~/.bashrc`) you'll need to add this at the very end: 29 32 (eg. `~/.bashrc`) you'll need to add this at the very end:
`[ -f /opt/boxen/env.sh ] && source /opt/boxen/env.sh`, and reload 30 33 `[ -f /opt/boxen/env.sh ] && source /opt/boxen/env.sh`, and reload
your shell. 31 34 your shell.
1. Confirm the Boxen env has loaded: `boxen --env` 32 35 1. Confirm the Boxen env has loaded: `boxen --env`
33 36
Now you have your own my-boxen repo that you can hack on. 34 37 Now you have your own my-boxen repo that you can hack on.
You may have noticed we didn't ask you to fork the repo. 35 38 You may have noticed we didn't ask you to fork the repo.
This is because when our-boxen goes open source that'd have some 36 39 This is because when our-boxen goes open source that'd have some
implications about your fork also potentially being public. 37 40 implications about your fork also potentially being public.
That's obviously quite bad, so that's why we strongly suggest you 38 41 That's obviously quite bad, so that's why we strongly suggest you
create an entirely separate repo and simply pull the code in, as shown above. 39 42 create an entirely separate repo and simply pull the code in, as shown above.
40 43
## Getting your users started _after_ your "fork" exists 41 44 ## Getting your users started _after_ your "fork" exists
42 45
1. Install the Xcode Command Line Tools (full Xcode install optional). 43 46 1. Install the Xcode Command Line Tools (full Xcode install optional).
1. Point them at your private install of [boxen-web](https://github.com/boxen/boxen-web), **OR** have them run the following: 44 47 1. Point them at your private install of [boxen-web](https://github.com/boxen/boxen-web), **OR** have them run the following:
45 48
``` 46 49 ```
sudo mkdir -p /opt/boxen 47 50 sudo mkdir -p /opt/boxen
sudo chown $USER:admin /opt/boxen 48 51 sudo chown $USER:admin /opt/boxen
git clone https://github.com/yourorg/yourreponame.git /opt/boxen/repo 49 52 git clone https://github.com/yourorg/yourreponame.git /opt/boxen/repo
cd /opt/boxen/repo 50 53 cd /opt/boxen/repo
script/boxen 51 54 script/boxen
52 55
# add boxen to your shell config, at the end, eg. 53 56 # add boxen to your shell config, at the end, eg.
echo '[ -f /opt/boxen/env.sh ] && source /opt/boxen/env.sh' 54 57 echo '[ -f /opt/boxen/env.sh ] && source /opt/boxen/env.sh'
``` 55 58 ```
56 59
Open a new terminal, `boxen --env` to confirm. 57 60 Open a new terminal, `boxen --env` to confirm.
58 61
## What You Get 59 62 ## What You Get
60 63
This template project provides the following by default: 61 64 This template project provides the following by default:
62 65
* Homebrew 63 66 * Homebrew
* Git 64 67 * Git
* Hub 65 68 * Hub
* DNSMasq w/ .dev resolver for localhost 66 69 * DNSMasq w/ .dev resolver for localhost
* NVM 67 70 * NVM
* RBenv 68 71 * RBenv
* Full Disk Encryption requirement 69 72 * Full Disk Encryption requirement
* NodeJS 0.4 70 73 * NodeJS 0.4
* NodeJS 0.6 71 74 * NodeJS 0.6
* NodeJS 0.8 72 75 * NodeJS 0.8
* Ruby 1.8.7 73 76 * Ruby 1.8.7
* Ruby 1.9.2 74 77 * Ruby 1.9.2
* Ruby 1.9.3 75 78 * Ruby 1.9.3
* Ack 76 79 * Ack
* Findutils 77 80 * Findutils
* GNU-Tar 78 81 * GNU-Tar
79 82
## Customizing 80 83 ## Customizing
81 84
You can always check out the number of existing modules we already 82 85 You can always check out the number of existing modules we already
provide as optional installs under the 83 86 provide as optional installs under the
[boxen organization](https://github.com/boxen). These modules are all 84 87 [boxen organization](https://github.com/boxen). These modules are all
tested to be compatible with Boxen. Use the `Puppetfile` to pull them 85 88 tested to be compatible with Boxen. Use the `Puppetfile` to pull them
in dependencies automatically whenever `boxen` is run. 86 89 in dependencies automatically whenever `boxen` is run.
87 90
### Node definitions 88 91 ### Node definitions
89 92
Puppet has the concept of a 90 93 Puppet has the concept of a
['node'](http://docs.puppetlabs.com/references/glossary.html#agent), 91 94 ['node'](http://docs.puppetlabs.com/references/glossary.html#agent),
which is essentially the machine on which Puppet is running. Puppet looks for 92 95 which is essentially the machine on which Puppet is running. Puppet looks for
[node definitions](http://docs.puppetlabs.com/learning/agent_master_basic.html#node-definitions) 93 96 [node definitions](http://docs.puppetlabs.com/learning/agent_master_basic.html#node-definitions)
in the `manifests/site.pp` file in the Boxen repo. You'll see a default node 94 97 in the `manifests/site.pp` file in the Boxen repo. You'll see a default node
declaration that looks like the following: 95 98 declaration that looks like the following:
96 99
``` puppet 97 100 ``` puppet
node default { 98 101 node default {
# core modules, needed for most things 99 102 # core modules, needed for most things
include dnsmasq 100 103 include dnsmasq
101 104
# more... 102 105 # more...
} 103 106 }
``` 104 107 ```
105 108
### How Boxen interacts with Puppet 106 109 ### How Boxen interacts with Puppet
107 110
Boxen runs everything declared in `manifests/site.pp` by default. 108 111 Boxen runs everything declared in `manifests/site.pp` by default.
But just like any other source code, throwing all your work into one massive 109 112 But just like any other source code, throwing all your work into one massive
file is going to be difficult to work with. Instead, we recommend you 110 113 file is going to be difficult to work with. Instead, we recommend you
use modules in the `Puppetfile` when you can and make new modules 111 114 use modules in the `Puppetfile` when you can and make new modules
in the `modules/` directory when you can't. Then add `include $modulename` 112 115 in the `modules/` directory when you can't. Then add `include $modulename`
for each new module in `manifests/site.pp` to include them. 113 116 for each new module in `manifests/site.pp` to include them.
One pattern that's very common is to create a module for your organization 114 117 One pattern that's very common is to create a module for your organization
(e.g., `modules/github`) and put an environment class in that module 115 118 (e.g., `modules/github`) and put an environment class in that module
to include all of the modules your organization wants to install for 116 119 to include all of the modules your organization wants to install for
everyone by default. An example of this might look like so: 117 120 everyone by default. An example of this might look like so:
118 121
``` puppet 119 122 ``` puppet
# modules/github/manifests/environment.pp 120 123 # modules/github/manifests/environment.pp
121 124
class github::environment { 122 125 class github::environment {
include github::apps::mac 123 126 include github::apps::mac
124 127