Ori Blog

Guide: Integrating Ori with your existing CI/CD pipeline

Written by João Coelho | Oct 4, 2023 1:52:02 PM

In this guide, we'll see how you can update your OGC container after releasing a new version of your app. Using the OGC CLI, we can integrate existing CI/CD pipeline such as GitHub Actions into our OGC deployment flow.

Configure your application

The first step is to configure your application in OGC. In the example below, we have setup a backend application with a MongoDB database and MongoDB Express. Here a tutorial on how to setup a multi-tiered application in OGC.

Setup GitHub Workflow

Once the application is configured, we can create a new GitHub Action that will automatically update the deployment when a new version of the application is pushed.

Let's look at a example pipeline run the CLI examples directory:

Installing OGC CLI:

The CLI is available via the install script, or you can also download the binary directly (see the ogc-cli-releases repo). Below we are choosing to use the install script, downloading the latest version and adding it to the path.

 

Login to registry and build image

In this case, we have a private registry added to our OGC project meaning the deployment will automatically pull the private image. This means that we must login into our registry to push the latest image.

The version comes from a version file setup in the root directory. We are using it to build and push the new version of the app under the new tag.

 

Update application

The last thing we need to do is update the container version and re-deploy the package.

  1. Configure OGC credentials as environment variables
  2. Get required resource IDs
  3. Update container image-tag property with the latest version
  4. Restart deployment
 

Conclusion

Now that we are able to automatically deploy our application via the OGC CLI, deploying applications becomes a solved problem. Regardless of what cluster, cloud provider or region you want to deploy to, this behaviour stays the same.

This, alongside other OGC features such as self heal, automatic networking and storage management across many clusters in any cloud, developers and engineering teams can focus on delivering product value, instead of worrying about infrastructure.