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 and the VirtualBox Extension Pack (https://www.virtualbox.org/) (versions 4.0 and 4.1 are currently supported)
- Ruby (https://www.ruby-lang.org/)
- Vagrant (https://vagrantup.com/)
-
Fork the following joind.in repositories:
-
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
cd joindin-vm php scripts/cloneRepository.php
-
Start the VM
vagrant up
-
Add hostname to /etc/hosts. If you are on Linux, run this:
(echo ; 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 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: https://dev.joind.in:8080/
- For the responsive site: https://web2.dev.joind.in:8080/
- For the API: https://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 it with the following commands:
you@you> vagrant ssh vagrant@vm> mysql joindin -uroot
-
The database is also forwarded on port 3307 to your host, so you can also use:
you@you> mysql -u joindin -h 127.0.0.1 -P 3307 -ppassword joindin
-
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
.cp puppet/hieradata/common.yaml.dist puppet/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.
On the latest Vagrant version, sometimes Vagrant stops before running Puppet. If if happens, you can run it manually.
vagrant provision
We use mailcatcher to grab emails before they leave the VM, and present them to you in a web interface so you can see what the system would be sending. To check the mails that have been sent, visit https://localhost:8081 on your host machine.