|
|
| Line 1: |
Line 1: |
| == Creating a BMO Development System using VirtualBox and Vagrant == | | == Creating a BMO Development System using Docker == |
|
| |
|
| Getting Bugzilla, as well as the latest code that is used by [http://bugzilla.mozilla.org bugzilla.mozilla.org], installed and running locally in order to | | Getting Bugzilla, as well as the latest code that is used by [http://bugzilla.mozilla.org bugzilla.mozilla.org], installed and running locally in order to |
| make changes, fix bugs, etc. is not the easiest thing for every one to do. Especially if you are not familiar with Linux systems, the Perl programming | | make changes, fix bugs, etc. is not the easiest thing for every one to do. Especially if you are not familiar with Linux systems, the Perl programming |
| language, or installing all of the many CPAN module dependencies needed for Bugzilla to work properly. This Developer Box is designed to help people | | language, or installing all of the many CPAN module dependencies needed for Bugzilla to work properly. This Developer Box is designed to help people |
| to be able to get up and running quickly and easily by providing a ready to run Virtual Machine (VM) that should work on most platforms. The VM is built using | | to be able to get up and running quickly and easily by providing a ready to run Docker container that should work on most platforms. |
| Vagrant and VirtualBox which most people should not have difficulty getting installed on Windows, OSX, and Linux.
| |
|
| |
|
| The VM provided for download comes with a test database already installed that contains most products and other data that would see on BMO it has all of the
| | First you will need to check the latest BMO source code from https://git.mozilla.org/webtools/bmo/bugzilla into a local directory and change into the |
| bugs themselves removed for size. Also all user account passwords, stored queries, group membership have been removed for obvious reasons. At the end of
| | contrib/docker directory. |
| this document, I will outline how to obtain a sanitized copy of the BMO database which does contain all 'public' bugs that you can then import into your
| |
| VM and be able to do more thorough testing and development on a larger amount of data.
| |
|
| |
| === Getting your system setup ===
| |
|
| |
|
| * Install Virtualbox on your workstation (http://www.virtualbox.org)
| | $ git clone https://git.mozilla.org/?p=webtools/bmo/bugzilla.git docker-bugzilla |
| * Install Vagrant on your workstation (http://www.vagrantup.com/)
| | $ cd docker-bugzilla/contrib/docker |
|
| |
|
| === Installing and running the BMO Vagrant box ===
| | For instructions on how to get your platform setup to run Docker as well as information on how to start the container, see the '''README.md''' file in the current directory. |
| | |
| * Create following file called 'Vagrantfile' in a directory by itself. If you have a previously installed box, you may have to change the box name (config.vm.box) to something unique (e.g. append a timestamp) so that the new box is downloaded.
| |
| | |
| Vagrant.configure("2") do |config|
| |
| config.vm.box = "bmo"
| |
| config.vm.box_url = "https://people.mozilla.com/~dkl/bugzilla.box"
| |
| end
| |
| | |
| * Execute the following in the directory where the 'Vagrantfile' is located. This will download the box and then start the VM.
| |
| | |
| $ vagrant up
| |
| | |
| * If you are getting errors downloading the box file, you can download it separately. In OS X or Linux, I suggest using "wget -c https://people.mozilla.com/~dkl/bugzilla.box" from the command line, which will resume an interrupted transfer. Then change the config.vm.box_url value to the path of the downloaded box, with no protocol, i.e., do not start it with "file://". You can verify the downloaded file's md5sum against http://people.mozilla.org/~dkl/bugzilla.box.md5 to be sure it downloaded properly before bringing the box 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>
| |
| | |
| * You should now be able to access the web UI at http://localhost:8080/bmo using your browser on the same system.
| |
| ** 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
| |
| | |
| $ 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 commit (commit the merged files to your branch)
| |
| | |
| * Run the built in test suite located in the /home/vagrant/htdocs/bmo directory.
| |
| | |
| $ 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
| |
| ** (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 so you can easily upload, etc.
| |
| | |
| $ 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]
| |
| | |
| === Installing a recent sanitized dump of public bugs from BMO ===
| |
| | |
| * From time to time Michael Hoye (mhoye) will upload an updated MySQL dump file to his people site that contains sanitized data from BMO.
| |
| | |
| http://people.mozilla.org/~mhoye/bugzilla/
| |
| | |
| * You can drop the database you have currently installed in your VM and import the new dump which will give you a larger amount of data to test/develop with.
| |
| | |
| $ vagrant ssh
| |
| $ cd ~/htdocs/bmo
| |
| $ mysql -u root mysql
| |
| mysql> DROP DATABASE bugs; CREATE DATABASE bugs CHARACTER SET = 'utf8';
| |
| $ zcat /vagrant/database_dump_file.gz | mysql -u root bugs --max_allowed_packet=128M
| |
| | |
| * The BMO code may have had features added since the last time the snapshot was made and put out for download. Running ./checksetup.pl will make any database schema changes needed.
| |
|
| |
| $ ./checksetup.pl
| |
| | |
| * Since this is a new import, you will need to setup your personal BMO account again as well.
| |
| | |
| $ vagrant ssh
| |
| $ cd ~/htdocs/bmo
| |
| $ ./checksetup.pl --make-admin=<email> --reset-password=<email>
| |