Mojo Wonk Blog.

A semi-offical blog dedicated to the Mojolicious web framework

Testing Environment With Tmux

Text saying "Tmux" in the middle of white, red, yellow, and blue boxes containing shell output separated by thick black lines. Original artwork by Doug Bell

The Yancy CMS for the Mojolicious web framework currently supports three different database systems directly (and even more through the DBIx::Class ORM). As a result, when doing development, I need to have two database daemons running locally, a bunch of different environment variables to tell the tests where those databases are, and a web daemon to test the front-end.

Setting up these daemons is a pain, but I also do not want to run them all the time (to save on my laptop's battery). To me, it's easier to run a database daemon for a specific project than to try to manage all the databases I might need. But that means that every time I want to do some work on Yancy, I need to start up a bunch of things.

Since I do all my development in a terminal window, the Tmux terminal multiplexer has become an extremely useful tool. Using a shell script and Tmux, I can run a single command to set up all the databases, environment variables, and all the tabs I need to get to work quickly.

Continue reading Testing Environment With Tmux...

Day 19: You Only Export Twice

Container ship leaving port

With my Yancy documentation site built, with a custom landing page and a POD viewer, I just need to deploy the site. I could deploy the site using hypnotoad, Mojolicious's preforking server with hot deployment, but that would require me to have a server and keep it online. It'd be a lot better if I could just deploy a static website to Github like all the cool people are doing.

But to do that, I'd need to take my dynamic website and turn it into a static one, and that's impossible! Or is it? Why am I asking me, when I'm the one who wrote a way to do it: The Mojolicious export command.

Continue reading Day 19: You Only Export Twice...