Ruby Post Deploy Configuration

The platform can perform post deployment application configuration via rake. This is usually needed to finalize the configuration of complex applications, to run additional applications, or specific steps for application configuration, like db:migrate.

To do this, we’ve introduced a new file called rake_deploy. It is located in the application root and contains a list of the commands that have to be passed to rake. Each command must be on a separate line. Commands are executed successively.

The platform executes commands from rake_deploy with each restart of the Apache/nginx service and deletes them right after successful execution. As a result, if you need to bypass different commands to rake on each deploy you need to create a rake_deploy file each time and put the correct commands there.

The platform puts the output of each rake_deploy into a corresponding log file, which is available via the Log view in the platform dashboard.

Syntaxis of the rake_deploy file:

1
2
3
4
$COMMAND_NAME_1  
$COMMAND_NAME_2  
...  
$COMMAND_NAME_N

And the platform will execute the following scripts:

1
2
3
4
rake $COMMAND_NAME_1  
rake $COMMAND_NAME_2  
...  
rake $COMMAND_NAME_N

For example, rake_deploy looks like the following in the Redmine tutorial:

1
2
3
generate_secret_token  
db:migrate  
redmine:load_default_data
Note: To freeze gems, you need to add the gems:unpack command to rake_deploy.
Share this:
FacebookXWhatsAppTelegramLinkedInGmailCopy Link
Updated on March 10, 2026
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support