Quick way to get the platform for joind.in development set up
This repository provides a vagrant virtual machine so you can start contributing quickly. Joind.in is a big project, so there a few parts involved.
-
Install requirements. (Note: these are not required by joind.in itself, but are required for this quick start guide.)
- VirtualBox (https://www.virtualbox.org/) (versions 4.0 and 4.1 are currently supported)
- Ruby (http://www.ruby-lang.org/)
- Vagrant (http://vagrantup.com/)
-
Fork the following joind.in repository
-
Clone joindin-vm
git clone [email protected]:%%YourGitHubId%%/joindin-vm.git --recursive
-
Execute the script that will clone the other 3 repository from your forks
php scripts/cloneRepository.php
-
Start the VM
vagrant up
-
Add hostname to /etc/hosts. If you are on Linux, run this:
echo "\n127.0.0.1 dev.joind.in api.dev.joind.in web2.dev.joind.in" | sudo tee -a /etc/hosts
If you are on OSX, run this:
echo "127.0.0.1 dev.joind.in api.dev.joind.in web2.dev.joind.in" | sudo tee -a /etc/hosts
If you are on Windows, run this on the cmd line
echo 127.0.0.1 dev.joind.in api.dev.joind.in web2.dev.joind.in >> %SYSTEMDRIVE%\Windows\System32\Drivers\Etc\Hosts
-
Browse to the sites
- For the joind.in site: http://dev.joind.in:8080/
- For the responsive site: http://web2.dev.joind.in:8080/
- For the API: http://api.dev.joind.in:8080/
-
You can log to joind.in test site with those credentials for an admin account: * Username: imaadmin * Password: password
-
For other users, look at the dbgen documentation.
Notes:
-
HTTP and SSH ports on the VM are forwarded to localhost (22 -> 2222, 80 -> 8080)
-
The joind.in directory you cloned will be mounted inside the VM at
/vagrant
-
You can develop by editing the files you cloned in the IDE of you choice.
-
The database is running inside the VM. You can get to with the following commands:
you@you> vagrant ssh vagrant@vm> mysql joindin -uroot
-
To stop the VM so that you can work on it later, issue the following command from the host machine:
vagrant halt
-
To delete the VM completely, issue the following command from the host machine:
vagrant destroy
To install the testing tools in the VM
- Copy the file
puppet/hieradata/common.yaml.dist
topuppet/hieradata/common.yaml
. - Edit this file and change the value of
joindin::test::tests
to true. - Re provision the VM. If the VM is not on, run
vagrant up
, if it's on, runvagrant provision
- Wait for the testing tools to be installed. This will take a few minutes.
- Run the joind.in tests with this command from inside the VM
cd /vagrant/joind.in && phing
- Run the joindin-api tests with this command from inside the VM
cd /vagrant/joindin-api && phing
- Run the joindin-web2 tests with this command from inside the VM
cd /vagrant/joindin-web2 && phing
If you get this error:
"The box 'centos-62-64-puppet' is still stored on disk in the Vagrant 1.0.x format. This box must be upgraded in order to work properly with this version of Vagrant.".
You can fix it by running the command vagrant box repackage centos-62-64-puppet virtualbox
and executing vagrant up
again.
If you get a warning about a mismatch between your version of the guest addition and the one in the VM. You can make sure that the guest additions in the VM are always up to date with this command:
vagrant plugin install vagrant-vbguest
If Vagrant complains that the command plugin does not exist, it's because your version of Vagrant is too old. You might need to upgrade it for the VM to work correctly.