New deployment method — CI/CD via third-party CI

Chingis
Wodby blog
Published in
3 min readJul 26, 2018

--

Today, I want to introduce a new deployment method we’ve added to all stacks, both managed and custom — CI/CD via third-party CI (public beta). Until now the only way you could deploy code via Wodby was through a direct git integration. Despite this method being super simple and straightforward it has a few major flaws that CI/CD workflow solves:

  • With direct git integration people normally used post-deployment scripts to install dependencies. And sometimes it happens that some of the libraries failed installing for whatever reason (e.g. packagist.org is not available) but you’ve already deployed code that might use them. In CI/CD approach you can be sure nothing will be deployed until all build steps are complete
  • For the same reason as previous, you can’t run your tests before deployment
  • Direct git deployment cannot be used for custom stacks (no orchestration) and cluster deployments (no codebase volumes)
  • With CI/CD you have build artifacts — docker images that you can download locally and debug if needed
  • With CI/CD you can rollback to previous builds (coming soon feature)

So how this deployment via third-party CI tool really works? Here’s a big picture:

  1. You deploy an app based on a managed stack that supports CI deployments or custom stack with at least one service that has ci deployment type
  2. In your CI tool you download Wodby CLI tool or its docker image. With our CLI tool you will perform the next steps
  3. Initialize the build by providing your Wodby API key and UUID of your app instance
  4. Build images with your codebase. Images will be based on the images from your stack
  5. Push (release) images to a private docker registry we provide you (or any other registry)
  6. Deploy the build (a set of images) to your app instance

In other words, it’s a standard build with docker but you don’t have to think about docker images at all, you just use images from your stack. You use the same environment (same docker images) during the build as the ones you use in production runtime. When you upgrade a stack, next build will use updated images from the new stack. We provide a private docker registry but you can use your own registry.

Here’s a simple CircleCI example so you have an idea how it works:

In this example you just install your code dependencies, build static HTML frontend and put the result codebase to stack images. But if you need something more complex you can provide Dockerfile to the build command. Just make sure you Dockerfile starts with the following lines to make it uses the image from the stack:

ARG WODBY_BASE_IMAGE
FROM ${WODBY_BASE_IMAGE}

You can find technical step by step instructions in our documentation or visit wodby/wodby-ci for ready-to-run examples for CircleCI, TravisCI, BitBucket Pipelines or any other (shell script).

This is an application page after you‘ve deployed the build:

We’re looking forward to simplify it even more with upcoming deployment method Wodby CI!

--

--