Project Setup¶
To dev in Cubed you will need to become familiar with Vagrant boxes. Vagrant are headerless boxes we use to run our server enviroments locally, all of which are Ubuntu based and run python. They are headerless as we do not need to see the operating systems graphical output, so you will have to get used to using Linux's command line.
When running vagrant, by default it uses the Vagrantfile, which then runs a couple of quick Linux commands to install Python, some other libraries, and then Ansible. Ansible is a library that runs different configuration files in order to setup servers.
This Ansible file is run on the local dev environment, then again when deploying to the Staging Server and again when deploying to the Live Server. This ensures that all environments are setup and configured exactly the same.
An example of this is that we install specific versions of Django, Tastypie, Pipeline etc... and Python libraries such as Arrow, fURL etc...
Vagrant Setup¶
Pull the latest of the project you want. Open up a Windows Command Prompt window in the root directroy - this should be where the Vagrantfile, then run the Vagrant command:
vagrant up
Once the vagrant box has finished setting up you will get a print out of information on how successful the process was. You will also get the port numbers that are available to connect to via the browser.
From here there are a number of ways to connect to the Vagrant box. The easiest way is to use the built in vagrant ssh command. This will open up a SSH connection to the Vagrant box.
vagrant ssh
Other options include using the Operating System's SSH client or using Putty:
PuTTY Configuration¶
Key | Value |
---|---|
Host Name | 127.0.0.1 or localhost |
Port | 2222 or 2201 |
Hint
You can get the port for the Vagrant box you want to connect to by running the following command : vagrant port
This is the basic approach to all Cubed projects. Following these steps with any repo will get the relevant server running locally and ready to dev on.