Go to content Go to menu

Here’s a quick thing I did for a couple of my colleagues, to demo writing a Lando environment from scratch. I grabbed the latest copy of Omeka-S and unzipped the file, then wrote the following .lando.yml file

name: omeka-s
recipe: lamp
config:
  php: '7.3'
  webroot: .
  database: mysql:5.7
  xdebug: false

And then I modified the config/database.ini file to use the default DB credentials used by Lando:

user     = "lamp"
password = "lamp"
dbname   = "lamp"
host     = "database"

And then I ran lando start and followed along with the rest of the Omeka S install guide.

Lando tells you the URL you need to visit after your site comes up:

Waiting until database service is ready...
Scanning to determine which services are ready... Please standby...

BOOMSHAKALAKA!!!

Your app has started up correctly.
Here are some vitals:

 NAME            omeka-s
 LOCATION        /Users/hpotting/workspace/lando-omeka-s
 SERVICES        appserver, database
 APPSERVER URLS  https://localhost:32825
                 http://localhost:32826
                 http://omeka-s.lndo.site/
                 https://omeka-s.lndo.site/

Any of those URLs work fine.


I’ve been trying to ramp up quickly on a number of projects, which all use similar yet different stacks. Some of them have documented/established practices for setting up a dev workspace, but, I’ve always wanted to try using Lando to set up a dev environment, and now that I have to set up a few of them, it feels like now’s the time to get my hands dirty: use a tool built to rapidly iterate until I have a workspace. Learning as I go.

I didn’t really grasp that’s what I was doing, but several hours into writing my first lando.yml file, and asking for help in resolving the error messages I was seeing, someone over in the Lando Slack kindly suggested that I start smaller… after I get something working, then build up from that success. Seems obvious, right? It was quite an aha moment for me.

I commented out most of my work, and focussed on getting a database working. I defined success as having an environment in which I could load a copy of some production data, run some queries, destroy the workspace, start over, reimport the same data, and try other things. And, this turned out to be a great place to start.

In case you’d like a head start on learning how to use Lando to write your own dev workspace, here are two different seed projects:

In the spirit of learning as I go, I will update this post as I finish up different dev workspaces. I’ll define “finish up” as making a pull request for the project, and having the PR accepted. I have two in the works so far, with more surely to come.

UPDATE: Two Pull Requests Accepted

I think I’ll turn this into a series. My next article will be on using Lando with Django. Any web application framework that relies on scaffolding is a good fit for this “learn as you go” approach. More later.

UPDATE: Well, Part 2 turned out to be even easier, a live coding demo I did with some colleagues, setting up a dev environment for Omeka-S.