Overview

This short guide will show you how to trigger image builds in Beach through an HTTP request. The examples given will be based on GitHub and Gitlab, but most other continuous integration solutions will work more or less the same.

The Details

A build can be triggered through the Beach API by calling a specific URL which contains the identifier of the instance you want to run a build for, and a secret access token. You can call that URL either by sending an HTTP GET or a POST request.

The URL you need to call looks like this:

https://beach.flownative.com/api/v1/instances/{instance identifier}/checkfornewcommits?token={access token}

The URL for each instance can be found on the instance details page in Beach:

The automation settings allow to switch automatic deployment on and off. The pipeline trigger URL can be copied, too.

In case there is no access token yet, navigate to your organization details page (that's where you can upload a logo of your organization and also find your deployment key) and klick the button to generate one.

You can test the trigger by just calling the URL in your browser. If there's a new commit in your Git repository, Beach will start building an image for this code.

An example: GitHub

In GitHub navigate to the Settings > Webhooks menu of the Git repository used in your Beach instance. You will set up a new webhook which will trigger the build in Beach.

Enter the full URL of the webhook as given in your Beach instance settings, including the instance identifier and the access token.

Important: The content type must be set to "application/json".

For the trigger, select the "Just the push event" option.

Add this webhook and test if it can trigger a build in Beach.

An example: GitLab

In GitLab navigate to the Settings > Integrations menu of the Git repository used in your Beach instance. You will set up a new webhook which will trigger the build in Beach.

Enter the full URL of the webhook as given in your Beach instance settings, including the instance identifier and the access token.

For the "trigger", select the "Push events" option.

Add this webhook and test if it can trigger a build in Beach.