Unearthing CircleCI artifacts

We’re big fans of CircleCI at Mapzen – it’s our mane tool for automated software testing to make sure new code doesn’t run a-foal. The repository everyone at Mapzen touches is our website, which used to stirrup a lot of emotions when we wanted to preview changes and share it with teams. Mike Migurski built an open-source tool called Precog that uses CircleCI artifacts to help preview our Jekyll-generated websites. Our favorite part of Precog, is the loading preview that reminds us to ‘hold our horses’.

horse preview

CircleCI thought it was pretty cool and Alek Sharma talked to Mike about it.

MM: Yeah, it’s a Python-based Flask app. It doesn’t even really need to know anything in particular ahead of time. You can basically feed it any path. It’s: hostname/account/, and with that information, it’ll go talk to the CircleCI API and say, “Hi, do you know anything about this repo?” Then, it’ll talk to GitHub and get more information about the repo, and if it finds artifacts, it will show them.

AS: And then you can get more specific with commit SHAs on the actual branches.

MM: Exactly. You can look at different branches or individual commits. If you have a private repo, you can do a GitHub OAuth in order to show private stuff. For a long time, actually, private was the only thing we did, but then we started to see that there was a use-case for public repos inside Mapzen, so we set it up for both private and public repos.

AS: We’ve touched on this, but let’s talk about how Mapzen uses Precog now.

MM: Basically, any of our repositories that generates a public static file has Precog attached to it. Just four off the top of my head: our website runs on Jekyll; that’s got static output, so we use Precog. Our documentation system uses a Python library called Mkdocs. It’s kind of “Jekyll for documentation”, basically. Same deal: it outputs the artifacts, so we use Precog to preview it. Our Mapzen.js library has an NPM-based build process, so that outputs static files, so we use Precog with that. Then, our style guide, which is our front-end pattern library, uses Jekyll, so same deal. All of those things get Precog URLs; you can look at old versions and future branches of them.

AS: So, openness is a big deal. Has it always been that way?

MM: It’s part of Mapzen’s mission, and it was always founded to be that way… [with open source], you can support uses that are totally outside those predicted areas.

If you use Github branches and CircleCI, horse around with Precog! It’s open and available for anyone to use. 🐴

Preview GIF: Galloping Horse zoopraxiscope by Eadweard Muybridge via Wikipedia