Skip to content

Running tasks

Laura Beaufort edited this page Oct 20, 2020 · 4 revisions

Short tasks

If you have a short task that takes less than a day, use cf tasks This is good because it cleans up after its self and uses the code that is already deployed there. Tasks will be interrupted if the apps are redeployed. We redeploy apps daily on prod and dev redeploys when something is merged into the develop branch and tests succeed.

Select the desired environment and then:

$ cf run-task APP-NAME --command "TASK" --name TASK-NAME

You can check on your task with:

$ cf tasks APP-NAME

Long tasks

If you have a long running task you will want to use a headless app. Here is the cloud.gov documentation on how to deploy one of these apps.

When naming your app, say what is running and end the name with -kill-expected-end-date. For example, if I am running "python manage.py update_all" as a headless app that will take a day and a half to run and it is July 25, you would name your app update-all-kill-07-27

Here is the PR with a task template https://github.com/18F/openFEC/pull/2560 (We can replace this to a link to the task manifests when it is merged.)