Vagrant project files to set up the Ionic build/test environment for the TVSD WhereYouAt client.
To use this project, you must first have Vagrant installed and working. Please visit vagrantup.com for more information. Especially ensure that the command vagrant ssh works for Vagrant boxes.
Before running, this Vagrant project and the ionic_wya must be cloned into the correct locations.
-
Create a
clientfolder which will contain this project & the ionic_wya project. -
In the
clientfolder, clone theionic_wyaproject. You should now have aclient\ionic_wyafolder. -
In the
clientfolder, clone this project. You should now have aclient\vagrant_ionic_wyafolder. -
You should now have the following directory structure:
client\ ionic_wya\ vagrant_ionic_wya\ -
Check which Vagrant boxes you have installed. To do this, open a command prompt and run the following command:
vagrant box list. Make a note of the boxes you have installed. -
In a text editor, open the
client\vagrant_ionic_wya\Vagrantfile. Toward the beginning of the file, there will be a section similar to the following:# Uncomment one of the boxes below depending on the box you currently have. # If you don't have either box, uncomment the first one. # To find which boxes are on your system: $ vagrant box list #config.vm.box = "drifty/ionic-android" #config.vm.box = "drifty_ionic"Uncomment the line with the name of a box you already have installed and save the file.
vagrant upin theclient\vagrant_ionic_wyafolder.vagrant sshcd /project && ionic serve- Open
http://localhost:8100/in your browser.
-
Open the
clientfolder in your command prompt.On Windows, you can double-click the
clientfolder in Explorer, shift+right-click in an empty area of the folder and select "Open command window here". -
Change directories to the
vagrant_ionic_wyafolder:cd vagrant_ionic_wya -
Start the Vagrant box using the command
vagrant up -
Once the box has loaded, SSH into the Vagrant box using the command
vagrant ssh -
You should now be at a command prompt within the Vagrant VM:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-34-generic i686) Last login: Sun Dec 21 17:44:41 2014 from 10.0.2.2 vagrant@ionic-android:~$ -
At the Vagrant box's Linux command prompt, change directories to the Ionic project directory:
vagrant@ionic-android:~$ cd /project -
Run the project:
vagrant@ionic-android:/project$ ionic serveIf prompted, choose the non-
localhostoption when serving. -
On your host system, open a web browser and go to
http://localhost:8100/. -
When development is finished, be sure to shut down or suspend the Vagrant box. Do not just close the command prompt as the box will continue consuming host resources as the VM runs in the background.
I recommend suspend if you intend to return to the project later, and shutting down if you will not be developing for some time. You can also destroy the box, but you will then need to wait for Vagrant to re-import the box and also wait for the provisioner to update Ionic, which can take a while.