Container Scripts

When an instance container is started, Beach will automatically run a few actions - for example, doctrine:migrate will be called, in order to prepare the database schema for the new code which is going to get live. This is controlled via a switch in the Beach UI.

Custom Startup Scripts

But you can also run your own scripts, simply by placing a specific file in the root directory of your project.

The Details

When you deploy an instance, a new container is started in the cluster. When it is running, all start up scripts will be run and once that is done, the container will tell the cluster management that it is ready for receiving traffic.

Simply create a file called beach-startup.sh, commit it to your project's root directory and deploy it. Here's an example which makes sure that Job Worker Queues are set up before the application goes live:

beach-startup.sh

#!/bin/bash  
/application/flow queue:setup Stripe

Here's another example which flushes the content cache of a Neos 3.x or higher version on each deployment:

beach-startup.sh

#!/bin/bash  
/application/flow flow:cache:flushone Neos_Fusion_Content

Disabling Custom Scripts

In case you have a beach-startup.sh in your repository, but want to skip running it in an instance for some reason, you can set the instance variable BEACH_APPLICATION_CUSTOM_STARTUP_SCRIPTS_ENABLE to false.