Swacker: Code to Container, No Docker Required

Jul 20, 2015

The dream of most development teams is to have a setup where code is committed, built, and tested on a continuous basis. This practice is called continuous integration (CI). Add deployment to that list of actions, and you get the practice of continuous deployment, which looks a bit like #commitcode and #lookatthatitworks. In practice it’s more like #thisisahugepainintheass to implement.

With the advent of containerized applications, and newer offerings by companies like Giant Swarm and Wercker, making everyone’s CI dream a reality is now possible without having to shoehorn your app into an highly opinionated PaaS framework.

I’ve put together a sample application called Swacker, which illustrates how an app can be deployed without installing anything on your computer, including Docker. All you need is a browser and the will to click and type.

mind blown


Prerequisites


At a minimum, you will need the following to deploy a static, containerized site to the Interwebs:


Let’s Do It


If you are having trouble sleeping, feel free to watch my artisan video guide.

Start by forking the Swacker repository on Github:

fork this noise

Next, create an application and add the repository you just forked to your Wercker account:

kord is all werk and no play

When you are done adding the new application, use the gear icon at the top right on the application overview page to edit and add a custom deploy step to the application:

Make sure you check auto deploy and enter master for the branch. You’ll also need to add the following variables to the deploy pipeline:

  • user - your Giant Swarm username.
  • pass - your Giant Swarm password.
  • env - desired Giant Swarm environment: <username>/prod

Click save and then head back to the Github repository.


Push==Deploy


Pushing to the forked Github repository will trigger a hook on Wercker to push or update your application to Giant Swarm. To trigger a deployment, edit the index.html file on Github:

lamas know jack about CI, actually

Clicking commit changes to start the build, test, and deploy on Wercker.


View the Glory


Your new static website served by Flask will now be available via the following URL, substituting your username for <user> of course:

http://swacker-<user>.gigantic.io/

That’s it. We’re done here.

You May Also Like

These Stories on Tech

Feb 1, 2024
Dec 15, 2022
Sep 14, 2022