Running Rake tasks


You can choose to run your Rake tasks automatically or manually. Running them automatically involves either scheduling them by using the Rake task add-on or by using deploy hooks. Alternatively, you can run them manually on your server.

Scheduling Rake tasks

Read more about the rake task add-in in the documentation.

Using deploy hooks

You can use deploy hooks to execute your rake task at any point of your deployment.

Simply add a bash script to the application that contains the rake task. For example, create the file /.cloud66/scripts/ as below:

bundle exec rake your:task

Then add a deploy_hook to execute the above script on each deploy: create the file .cloud66/deploy_hooks.yml as below:

    - source: /.cloud66/scripts/
      destination: /tmp/
      target: rails
      execute: true
      run_on: all_servers
      apply_during: all
      sudo: true


This is done by starting a terminal connection to your server and executing your rake task.

$ bundle exec rake your:task