The MetaCPAN VM
Part II

Olaf Alders @wundercounter
Toronto Perl Mongers
Jan 30, 2014

Thursday, 30 January, 14
Installation

Getting started (Part I): http://
www.slideshare.net/oalders/themetacpan-vm-for-dummies-part-oneinstallation...
Starting your VM

cd metacpan/metacpan-developer
vagrant up
vagrant ssh

Thursday, 30 January, 14
Just become metacpan

For almost everything, you'll be
better off as the metacpan user
So, "sudo su metacpan" whenever you...
Running web tests
sudo su metacpan
cd ~/metacpan.org
prove -lvr t

Thursday, 30 January, 14
Running api tests
# run Elasticsearch in the foreground
# you don't have to stop elasticsearch, but it saves some resource...
Restarting Services
/etc/init.d/metacpan-www restart
/etc/init.d/metacpan-api restart
# if you're running the api locally
...
Port-Mapped URLs

http://0.0.0.0:5001 (metacpan-web)
http://0.0.0.0:5000 (cpan-api)

Thursday, 30 January, 14
Access and Error Logs

/var/www

Thursday, 30 January, 14
Installing Modules
# front end deps
sudo su metacpan
cd ~/metacpan.org
sudo ~/bin/install_modules --installdeps .
# api de...
Prefer plackup?
# front end
sudo su metacpan
cd ~/metacpan.org
/etc/init.d/metacpan-www stop
plackup -R lib --port 5001
# ...
Prefer carton?
# assumes you are "metacpan" and have stopped services
# front end
cd ~/metacpan.org
carton install
carton ...
Vagrant Workflow

Edit files on the host
Run tests and deploy code on the
guest

Thursday, 30 January, 14
Playing with Puppet
# on the host, in the dev directory you created
cd metacpan/metacpan-puppet
# let's add a new binary (...
Now, let's code!

Thursday, 30 January, 14
Upcoming SlideShare
Loading in...5
×

The MetaCPAN VM Part II (Using the VM)

354

Published on

Now that you have the MetaCPAN VM installed, let's take a look at what you need to know so that you can be productive.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
354
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

The MetaCPAN VM Part II (Using the VM)

  1. 1. The MetaCPAN VM Part II Olaf Alders @wundercounter Toronto Perl Mongers Jan 30, 2014 Thursday, 30 January, 14
  2. 2. Installation Getting started (Part I): http:// www.slideshare.net/oalders/themetacpan-vm-for-dummies-part-oneinstallation Thursday, 30 January, 14
  3. 3. Starting your VM cd metacpan/metacpan-developer vagrant up vagrant ssh Thursday, 30 January, 14
  4. 4. Just become metacpan For almost everything, you'll be better off as the metacpan user So, "sudo su metacpan" whenever you start an SSH session Thursday, 30 January, 14
  5. 5. Running web tests sudo su metacpan cd ~/metacpan.org prove -lvr t Thursday, 30 January, 14
  6. 6. Running api tests # run Elasticsearch in the foreground # you don't have to stop elasticsearch, but it saves some resources vagrant ssh sudo /etc/init.d/elasticsearch stop sudo /opt/elasticsearch-0.20.2/bin/elasticsearch -f -Des.http.port=9900 -Des.cluster.name=testing # log in with a new session to run the tests # don't pass the -r flag to prove vagrant ssh sudo su metacpan cd ~/api.metacpan.org source ~/.metacpanrc prove -lv t Thursday, 30 January, 14
  7. 7. Restarting Services /etc/init.d/metacpan-www restart /etc/init.d/metacpan-api restart # if you're running the api locally sudo /etc/init.d/elasticsearch restart # if you're indexing the full CPAN # and want to watch for the latest changes sudo /etc/init.d/metacpan-watcher start Thursday, 30 January, 14
  8. 8. Port-Mapped URLs http://0.0.0.0:5001 (metacpan-web) http://0.0.0.0:5000 (cpan-api) Thursday, 30 January, 14
  9. 9. Access and Error Logs /var/www Thursday, 30 January, 14
  10. 10. Installing Modules # front end deps sudo su metacpan cd ~/metacpan.org sudo ~/bin/install_modules --installdeps . # api deps cd ~/api.metacpan.org sudo ~/bin/install_modules --installdeps . # install some arbitrary module sudo ~/bin/install_modules Acme::Urinal Thursday, 30 January, 14
  11. 11. Prefer plackup? # front end sudo su metacpan cd ~/metacpan.org /etc/init.d/metacpan-www stop plackup -R lib --port 5001 # api cd ~/api.metacpan.org /etc/init.d/metacpan-api stop plackup -R lib --port 5000 Thursday, 30 January, 14
  12. 12. Prefer carton? # assumes you are "metacpan" and have stopped services # front end cd ~/metacpan.org carton install carton exec plackup -R lib --port 5001 # api cd ~/api.metacpan.org carton install carton exec plackup -R lib --port 5000 Thursday, 30 January, 14
  13. 13. Vagrant Workflow Edit files on the host Run tests and deploy code on the guest Thursday, 30 January, 14
  14. 14. Playing with Puppet # on the host, in the dev directory you created cd metacpan/metacpan-puppet # let's add a new binary (ncdu) to the system vi modules/metacpan/manifests/packages.pp package { ncdu: ensure => present } cd ../../metacpan-developer vagrant provision Thursday, 30 January, 14
  15. 15. Now, let's code! Thursday, 30 January, 14
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×