BMO/DeveloperBox: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
=== Creating a BMO Development System using VirtualBox and Vagrant ===
== Creating a BMO Development System using VirtualBox and Vagrant ==
 
=== Getting your system setup ===


* Install Virtualbox on your workstation (http://www.virtualbox.org)
* Install Virtualbox on your workstation (http://www.virtualbox.org)
* Install Vagrant on your workstation (http://www.vagrantup.com/)
* Install Vagrant on your workstation (http://www.vagrantup.com/)
* Creating your VM from the BMO base vbox
** Note: ~7G download (the base vbox has a recent sanitized copy of BMO)
  vagrant init
  vagrant box add bmo https://people.mozilla.com/~dkl/latest.box
* Edit Vagrantfile to allow port forward to VM of port 80
** TODO: Figure out what needs to be done to have this in the base vbox instead
of requiring user to do it.
  Uncomment the line that says (according to version):
  Version 1.0.x:
  # config.vm.forward_port 80, 8080
  Version 1.1.x:
  # config.vm.network :forwarded_port, guest: 80, host: 8080


  In the line
=== Installing and running the BMO Vagrant box ===
   config.vm.box = "base"
 
  Change "base" to "bmo"
* Create following file called 'Vagrantfile' in a directory by itself.
 
   Vagrant.configure("2") do |config|
    config.vm.box = "bugzilla"
    config.vm.box_url = "https://people.mozilla.com/~dkl/bugzilla.box"
    config.vm.network :forwarded_port, guest: 80, host: 8080
  end
 
* Execute the following in the directory where the 'Vagrantfile' is located. This will download the box and then start the VM.
 
  $ vagrant up
 
* The following will log you into the VM over SSH and drop you into the 'vagrant' user's home directory.
 
$ vagrant ssh
 
=== Working with the latest BMO code in the VM ===
 
* For starters you will need change your login password to a known value and also make yourself a Bugzilla admin (substitute your bmo address below).
 
  $ vagrant ssh
  $ cd ~/htdocs/bmo
  $ ./checksetup.pl --make-admin=<email> --reset-password=<email>


* Starting the VM
* You should now be able to access the web UI at http://localhost:8080/bmo using your browser on the same system.
  vagrant up
* Logging into the VM
  vagrant ssh
* Make yourself an admin and set your password (substitute your bmo address below)
  vagrant ssh
  cd htdocs/bmo
  ./checksetup.pl --make-admin=<email> --reset-password=<email>
* Access the web UI at http://localhost:8080/bmo using your browser
** You may need to update the values for urlbase and sslbase in /home/vagrant/htdocs/bmo/data/params to match the port number you chose for redirection earlier. If the port is different than 8080.
** You may need to update the values for urlbase and sslbase in /home/vagrant/htdocs/bmo/data/params to match the port number you chose for redirection earlier. If the port is different than 8080.


* Updating the BZR code to the latest revision. Note: http://doc.bazaar.canonical.com/migration/en/survival/bzr-for-git-users.html
* Updating the BZR code to the latest revision. Note: http://doc.bazaar.canonical.com/migration/en/survival/bzr-for-git-users.html


   vagrant ssh
   $ cd ~/htdocs/bmo
  cd htdocs/bmo
   $ bzr merge (This will merge upstream changes into your local branch. There may be conflicts if you have made changes as well)
   bzr merge
   $ bzr commit (commit the merged files to your branch)
   bzr commit (commit the merged files to your branch?)


* Run tests.
* Run the built in test suite located in the /home/vagrant/htdocs/bmo/t directory.
** perl runtests.pl will run all the tests in the /bmo/t directory
 
** you can run just one of the tests in /t, for example, perl t/004template.t will go through all the template tests.
  $ perl runtests.pl
 
* You can run just one of the tests in /t, for example to run the template compilation tests:
 
  perl t/004template.t


* Making a patch for review of your latest changes
* Making a patch for review of your latest changes
** (see https://wiki.mozilla.org/Bugzilla:Patches)
** (see https://wiki.mozilla.org/Bugzilla:Patches)
** This will place the patch file in your home directory of the laptop and not on the VM
** This will place the patch file in your home directory of the laptop and not on the VM so you can easily upload, etc.
so you can easily upload, etc.
 
   bzr diff > /vagrant/<some_patch_name>_1.patch
  $ cd ~/htdocs/bmo
   $ bzr diff > /vagrant/<some_patch_name>_1.patch


* File any bugs or feature requests [https://bugzilla.mozilla.org/enter_bug.cgi?product=bugzilla.mozilla.org&component=Developer%20Box here]
* File any bugs or feature requests [https://bugzilla.mozilla.org/enter_bug.cgi?product=bugzilla.mozilla.org&component=Developer%20Box here]
Confirmed users
241

edits