Skip to content

Commit 030ac75

Browse files
committed
Add readme.
1 parent 798a5fd commit 030ac75

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

README.md

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Phoenix framework for Elixir development box
2+
============================================
3+
4+
Vagrant
5+
-------
6+
[Vagrant](http://www.vagrantup.com/) and
7+
[Ansible](http://www.ansibleworks.com/) is used to setup the local development
8+
environment.
9+
10+
The installation of following software will be described under:
11+
12+
* [VirtualBox](http://virtualbox.org/)
13+
* [Vagrant](http://www.vagrantup.com/)
14+
* [Ansible](http://www.ansibleworks.com/)
15+
16+
Instructions for Ubuntu
17+
-----------------------
18+
19+
1. Install VirtualBox:
20+
21+
`apt-get install -y virtualbox`
22+
23+
Use the VirtualBox installer from http://virtualbox.org/ if the version in
24+
apt is older than 4.x (verify with
25+
`apt-cache show virtualbox | grep 'Version:'`).
26+
27+
2. Install the Vagrant package for Ubuntu from the
28+
[Vagrant download page](http://www.vagrantup.com/downloads.html).
29+
30+
The Vagrant version available in apt is (usually) outdated.
31+
32+
3. Install Ansible using pip:
33+
34+
`pip install ansible`
35+
36+
The Ansible version available in apt is (usually) outdated.
37+
38+
4. Install NFS package (required for folder sharing between host and guest):
39+
40+
`apt-get install -y nfs-kernel-server`
41+
42+
5. OPTIONAL: Install the vagrant plugin which upgrades the vb guest addons when necessary
43+
`vagrant plugin install vagrant-vbguest`
44+
45+
6. Create the Vagrant dev VM:
46+
47+
`vagrant up dev`
48+
49+
This will download the base Vagrant box, configure a VM and provision it
50+
using Ansible. The provision step automatically installs erlang, elixir and the
51+
phoenix framework (plus all other needed packages). For more provisioning steps,
52+
please see `provisioning/`.
53+
54+
7. Login to the Vagrant VM by running:
55+
56+
`vagrant ssh dev`
57+
58+
8. Start development:
59+
60+
`mix phoenix.new hello_phoenix`
61+
`cd hello_phoenix`
62+
`mix phoenix.server`
63+
64+
This will create and run the demo app.
65+
66+
The demo is running on [http://localhost:4000](http://localhost:4000/)
67+
68+
9. OPTIONAL: Add a database user
69+
70+
`sudo -u postgres createuser -P -s -e phoenix_user`
71+
72+
Edit the database part of `config/config.exs` to match the user and password
73+
you just created. You should now be able to follow the database part of the phoenix
74+
tutorial.
75+
76+
77+
Instructions for OSX
78+
-----------------------
79+
This part of manual will refer to the linux part when possible.
80+
81+
On osx it´s adviced to install homebrew. It will be used in the installation procedure.
82+
83+
1. Install homebrew
84+
Follow the instructions at [Homebrew´s site](http://brew.sh/).
85+
You will bea able to install various handy package with the `brew` command.
86+
87+
2. Install VirtualBox:
88+
89+
Get the newest version from
90+
[Virtualbox download page](https://www.virtualbox.org/wiki/Downloads) and
91+
install it.
92+
93+
3. Install the Vagrant package for Ubuntu from the
94+
[Vagrant download page](http://www.vagrantup.com/downloads.html).
95+
96+
4. Install Ansible:
97+
98+
Homebrew is well maintained and the packages are rapidly updated to the latest version. Install ansible
99+
with:
100+
`brew install ansible`
101+
102+
From this point on you can continue with the Ubuntu installation instructions,
103+
starting at step 5.
104+
105+
Links
106+
-----
107+
108+
* [Vagrant docs](http://docs.vagrantup.com/v2/)
109+
* [Ansible docs](http://docs.ansible.com/)

0 commit comments

Comments
 (0)