Understanding Katacoda's index.json

The index.json file is the place where the information about the scenario is defined. This page will outline the options.

Titles and Descriptions

pathwayTitle Title of the collection of scenarios
title Title the scenario
description Description of the scenario, displayed on the intro screen
difficulty Provide users with a sense of the depth of content, displayed on the intro screen
time Provide users with an estimated time to complete, displayed on the intro screen

Details Node

steps Details for the scenario steps
intro Details for the intro screen
finish Details for the finish screen
assets Files to upload to the environment. There are different places where the files can be uploaded, the client and any of the hosts. The client is the container defined in the index.json file. host01 is where Docker itself is running. When using a cluster of containers, there will be others hosts, for example host02.

To copy all files to the /root folder in the host01 you can use:
"assets": { "host01": [ {"file": "*", "target": "/root"} ] }

To copy the file example to the home of the client and to grant execution privileges:
"assets": { "client": [{"file": "example", "target": "/home/scrapbook/", "chmod": "+x"}] }

Steps Node

title Title for the step.
text Filename containing the body for the step.
answer Filename containing the answer body for the step.
verify Bash script to run to check if the user can proceed. More details here.
courseData Bash script to run in the background. More details here.
code Bash script to run in the foreground. More details here.

Intro/Finish Node

text Filename containing the body for the screen.
credits Display a link on the intro screen, useful for linking to blog post for giving credit.
courseData Bash script to run in the background. More details here.
code Bash script to run in the foreground. More details here.

Files

For use with the UI Editor layout, define filenames that would be opened by default.

Environment

hideintro Boolean field that control if the intro step is shown to the user. By default it is hidden in the embedded mode. Example:
"environment": { "uilayout": "terminal", "hideintro": false}
hidefinish Boolean field that control if the finish step is shown to the user. By default it is hidden in the embedded mode. Example:
"environment": { "uilayout": "terminal", "hidefinish": true }
uisettings Especify the format of the files for syntax highlighting in the editor (useful when it doesn't recognize the extension you are using). The suported formats are: reactjs, makefile, dockerfile, dockercompose, csharp, javascript, golang, java and xml. Example:
"environment": {"uisettings": "yaml"}
icon The icon for the scenario. The list of icons is at the home page. The possible values are: fa-docker, fa-weave, fa-kubernetes, fa-openshift, fa-dcos, fa-tensorflow, fa-runc, fa-coreos, fa-elixir, fa-csharp, fa-fsharp, fa-rlang, fa-golang, fa-java, fa-node and fa-ruby. Example:
"icon": "fa-node"
showdashboard Should Dashboard tabs be shown in UI.
dashboards Easily provide links for accessing dashboard/UI ports running in the environment. When using the terminal-iframe layout, it also show the exposed port of the container, without the need of open a new window. You can specify the name, port and the host identifier. To display a tab called App showing the port 8080 from the host host02:
"dashboards": [{ "name": "App", "port": 8080, "host": "host02" }
uilayout The layout ID provided by Katacoda. More details here.
uimessage1 Message to display at the top of the interative terminal.

Backend

imageid Environment image id provided by Katacoda. More details here.

Example

{
  "pathwayTitle": "Pathway Title",
  "title": "Scenario Title",
  "description": "Scenario Description",
  "difficulty": "beginner",
  "time": "5-10 minutes",
  "details": {
    "steps": [
      {
        "title": "Step Title",
        "text": "step1.md",
        "answer": "step1-answer.md",
        "verify": "step1-verify.sh",
        "courseData": "run-command-in-background.sh",
        "code": "run-command-in-terminal.sh"
      },
      {
        "title": "Step 2 - Step Title",
        "text": "step2.md"
      }
    ],
    "intro": {
      "text": "intro.md",
      "courseData": "courseBase.sh",
      "credits": "",
      "code": "changecd.sh"
    },
    "finish": {
      "text": "finish.md"
    },
    "assets": {
      "client": [
        {
          "file": "docker-compose.yml",
          "target": "~/"
        }
      ],
      "host01": [
        {
          "file": "config.yml",
          "target": "~/"
        }
      ]
    }
  },
  "files": [
    "app.js"
  ],
  "environment": {
    "showdashboard": true,
    "dashboards": [{"name": "Tab Name", "port": 80}, {"name": "Tab Name", "port": 8080}],
    "uilayout": "terminal",
    "uimessage1": "\u001b[32mYour Interactive Bash Terminal. A safe place to learn and execute commands.\u001b[m\r\n"
  },
  "backend": {
    "imageid": "docker"
  }
}

      
Additional Information

index.json schema

What layouts can I use?

What environments can I use?

Pre-Existing Files / Execute Commands On Start