Difficulty: beginner
Estimated Time: 5-10 minutes

Welcome to an Introduction on how to use the Cake Build system.

This course makes use of a katacoda base image which already have Cake installed, and ready to use. As a result, the steps that you will see within this course are likely going to be slightly different to others that you might have seen, since the typical bootstrapper script is not required.

i.e. rather than running:




You can simply run cake to initiate the build script.

However, everything else should be exactly the same. Let's get started.

You've completed your first Cake scenario!

Cake Introduction

Step 1 of 3

Step 1 - Create Build Script

In order to get started with Cake, you are going to need a build script. This is typically called build.cake (and this is what Cake looks for by default when no script name is provided), but you can call it whatever you want. You should find a build.cake file already to go.


Let's create a typical build.cake file. Copy the below into the build.cake file, and click the cake button.

var target = Argument("target", "FirstTask");

        Information("Hello World!");



What is this doing?

On the first line we are using a built in alias to grab a command line argument passed into Cake. When there is no argument passed, a default value of Hello is used.

We then define a Task to actually do some work. This task is named FirstTask and simply uses the Information alias to write out "Hello from Cake" to the command line.

The `RunTarget method is then called to execute the defined target, which by default, will be the Hello task.

The output from Cake will then show which Tasks were executed, how long they took, and whether the build was successful or not.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

This tab will not be visible to users.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]