Automatic application deployment

This is the key part of our platform. We’ve done what we can to keep the configuration process as simple as possible. Got any further suggestions how to improve it even more? Please, let us know!

If you want to learn more about the installation process, please go to the “DevOpsBox platform installation” section.

Bitbucket repository

Create a new repository in Bitbucket Cloud. We will call it “simple-app.” Then, clone it to your disk:

Copy to Clipboard

Simple application

You will need a simple dockerized application. If you don’t have one, just use nginx – it is enough for our Demo. However, we strongly advise you to create stateless applications that meet 12-factor rules (https://www.12factor.net). While it is not necessary, it is a good practice.

The simple application repository will contain only a single file called Dockerfile containing:

Copy to Clipboard

We often use docker-compose to test our applications locally (it is not required, though!). You can do it in a few simple steps:

  • Create docker-compose.yaml file with content:
Copy to Clipboard
  • Start docker-compose:
Copy to Clipboard
  • Go to http://localhost:8080 in your browser

Box.yaml

This is probably the simplest box.yaml possible. You only specify a port on which your container is listening and a map of environments containing only the names – there are no environment-specific configurations for this application

Copy to Clipboard

This is probably the simplest box.yaml possible. You only specify a port on which your container is listening and a map of environments containing only the names – there are no environment-specific configurations for this application

Commit and push Build plan

Next step is to commit your application with the box.yaml and push it to the Bitbucket:

Copy to Clipboard

And wait…

Bamboo build and deployment

After some time, 15 minutes max, you will see a new Build plan and a Deployment project in Bamboo.

Build plan

Deployment project

Deployment

Just press the deployment button next to one of environments. Click “Start deployment” and wait until it’d done. There will be a link to your application in the Bamboo deployment log e.g.: “Application url: https://dev-simple-app-dev.nonprod.your-new-test-domain.net”.

You can open it in your browser and see your application running! That’s it! The application is deployed, and you can use all of the DevOpsBox features!

Add Postgresql database

“Ok, great, but that was really simple. I need something more real-life like an application storing its data in Postgresql database.”

Nothing simpler. Just add it to your box.yaml! It will look like this:

Copy to Clipboard

When you deploy the application, our platform will automatically create a PostgreSQL RDS instance and inject all the necessary values to your environment variables. Your job is “only” to implement your application!

Show more about Automatic application deployment

DevOpsBox platform installation

DevOpsBox installation is quite simple. It takes a few hours, mainly waiting for cloud provisioning. If you trust us and simply want to find out how our platform operates, feel free to skip this chapter and jump back to the “Automatic application deployment” section. If you are really curious, read ahead.

Prerequisites

Scripts

You will need a computer with:

  • Bash
  • Docker

All other dependencies are dockerized.

Bitbucket Cloud

Currently, the only supported version control system is Bitbucket Cloud. You will need:

  • app password with account, repository and project read permissions
  • ssh private key of a user with read-only permissions to all your repositories

AWS

Bamboo

We use Bamboo as CI/CD server. You will need:

Google account single sign-on

You will have to generate client id and client secret for google account. This link can help https://www.keycloak.org/docs/6.0/server_admin/#google. You only need to do the google part, Keycloak will be configured automatically. For authorized redirect URIs enter https://box-keycloak-util.util.your-new-test-domain.net/auth/realms/box-platform/broker/google/endpoint.

Configuration

There are two configuration files:

  • aws/box-platform-config/box.yaml
  • aws/box-platform-config/secrets.yaml

All the attributes will not be described here; they will probably be adjusted by our engineer. Most of them are self-explanatory, either way.

Box.yaml

Copy to Clipboard

Secrets.yaml

Copy to Clipboard

Run and wait!

Running the deployment process is as simple as:

Copy to Clipboard

You will receive an email with confirmation details for your newly created test domain. After the confirmation, you will have to wait for a few hours. If the process ends successfully, go to: https://box-keycloak-util.util.your-new-test-domain.net/auth/admin/box-platform/console/ and change your boxadmin password.

You now have your own DevOpsBox!