How can i execute a task multiple times?

I need to run the tasks ‘install new application into container’, ‘restart container’, ‘import static database content via new application’ and ‘restart container’. The container needs to be restarted twice. How can i achieve this via gradle tasks?

The simplest solution is to declare two “restart container” tasks.