Difficulty: Easy
Estimated Time: 10min

The central concept of any CI/CD system is to run tasks, which are the focus of this scenario where we will break down the configuration of tasks.

Concourse provides an easy way to run tasks directly from the command line. This helps you ensure tasks run as expected in your target build environment.

Tasks utlimately are run from within pipeline jobs which we will cover in the pipelines scenario.

Basic concourse and client configuration have been initiated as part of this introduction and should be ready for you to use soon.

In this scenario we've learned the core configuration of tasks in Concourse as well as how to run individual tasks from our command line client.

Next we will learn how to define pipelines to run multiple tasks.

Understanding Tasks

Step 1 of 4

Running Tasks

Every task in Concourse runs within a "container" (as best available on the target platform).

The task_hello_world.yml (click to open) configuration defines a task for the linux platform which uses the busybox container image to provide the filesystem and dependencies for the task (busybox being a minimal linux distribution of only 4Mb).

When executed, you will see it downloading this busybox Docker image. It will only need to download this base image once; though will recheck every time that the concourse worker running the task has the latest busybox image available prior to executing the task.

As soon as your local concourse instance is online, run task_hello_world.yml directly from the command line with the following fly command:

fly -t tutorial execute -c task_hello_world.yml

The task will run the command echo hello world within the busybox container.

Notice that consecutive runs of the task configurations using the same busybox image execute faster

fly -t tutorial execute -c task_hello_world.yml

Review the execution of these one-off task using the builds (alias bs) command:

fly -t tutorial bs

Fetch the output of a particular build using the watch (alias w) command:

fly -t tutorial w -b 1

We will dive deeper into the configuration of a task next.