This short guide will show you how to trigger image Builds in Beach through an HTTP request. The example given will be based on 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: 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 API call, including the instance identifier and the access token.

As for the "trigger", select the "Push events" option.

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