[
  {
    "cmd": [
      "vpython3",
      "-u",
      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
      "--json-output",
      "/path/to/tmp/json",
      "ensure-directory",
      "--mode",
      "0o777",
      "[START_DIR]/[SWARM_OUT_DIR]"
    ],
    "infra_step": true,
    "name": "mkdirs out_dir"
  },
  {
    "cmd": [
      "vpython3",
      "-u",
      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
      "--json-output",
      "/path/to/tmp/json",
      "rmtree",
      "/tmp/lottie_files"
    ],
    "infra_step": true,
    "name": "remove previous lottie files"
  },
  {
    "cmd": [
      "vpython3",
      "-u",
      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
      "--json-output",
      "/path/to/tmp/json",
      "copytree",
      "[START_DIR]/lottie-samples",
      "/tmp/lottie_files"
    ],
    "infra_step": true,
    "name": "copy lottie files"
  },
  {
    "cmd": [
      "python3",
      "RECIPE_MODULE[skia::vars]/resources/get_env_var.py",
      "SWARMING_BOT_ID"
    ],
    "name": "get swarming bot id"
  },
  {
    "cmd": [
      "python3",
      "RECIPE_MODULE[skia::vars]/resources/get_env_var.py",
      "SWARMING_TASK_ID"
    ],
    "name": "get swarming task id"
  },
  {
    "cmd": [],
    "name": "Docker setup"
  },
  {
    "cmd": [
      "python3",
      "RECIPE_MODULE[skia::docker]/resources/get_uid_gid.py"
    ],
    "name": "Docker setup.Get uid and gid",
    "~followup_annotations": [
      "@@@STEP_NEST_LEVEL@1@@@"
    ]
  },
  {
    "cmd": [
      "vpython3",
      "-u",
      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
      "--json-output",
      "/path/to/tmp/json",
      "ensure-directory",
      "--mode",
      "0o777",
      "[START_DIR]/[SWARM_OUT_DIR]"
    ],
    "infra_step": true,
    "name": "Docker setup.mkdirs out_dir",
    "~followup_annotations": [
      "@@@STEP_NEST_LEVEL@1@@@"
    ]
  },
  {
    "cmd": [
      "chmod",
      "777",
      "[START_DIR]/[SWARM_OUT_DIR]"
    ],
    "infra_step": true,
    "name": "Docker setup.chmod 777 [START_DIR]/[SWARM_OUT_DIR]",
    "~followup_annotations": [
      "@@@STEP_NEST_LEVEL@1@@@"
    ]
  },
  {
    "cmd": [
      "chmod",
      "755",
      "[START_DIR]"
    ],
    "infra_step": true,
    "name": "Docker setup.chmod 755 [START_DIR]",
    "~followup_annotations": [
      "@@@STEP_NEST_LEVEL@1@@@"
    ]
  },
  {
    "cmd": [
      "chmod",
      "0755",
      "[START_DIR]/skia/infra/lottiecap/docker/lottiecap_gold.sh"
    ],
    "infra_step": true,
    "name": "Docker setup.chmod 0755 [START_DIR]/skia/infra/lottiecap/docker/lottiecap_gold.sh",
    "~followup_annotations": [
      "@@@STEP_NEST_LEVEL@1@@@"
    ]
  },
  {
    "cmd": [
      "chmod",
      "-R",
      "a+r",
      "[START_DIR]/lottie/build/player"
    ],
    "infra_step": true,
    "name": "Docker setup.chmod -R a+r [START_DIR]/lottie/build/player",
    "~followup_annotations": [
      "@@@STEP_NEST_LEVEL@1@@@"
    ]
  },
  {
    "cmd": [
      "chmod",
      "-R",
      "a+r",
      "/tmp/lottie_files"
    ],
    "infra_step": true,
    "name": "Docker setup.chmod -R a+r /tmp/lottie_files",
    "~followup_annotations": [
      "@@@STEP_NEST_LEVEL@1@@@"
    ]
  },
  {
    "cmd": [
      "docker",
      "run",
      "--shm-size=2gb",
      "--rm",
      "--user",
      "13:17",
      "--mount",
      "type=bind,source=[START_DIR],target=/SRC",
      "--mount",
      "type=bind,source=[START_DIR]/[SWARM_OUT_DIR],target=/OUT",
      "--mount",
      "type=bind,source=[START_DIR]/lottie/build/player,target=/LOTTIE_BUILD",
      "--mount",
      "type=bind,source=/tmp/lottie_files,target=/LOTTIE_FILES",
      "gcr.io/skia-public/gold-lottie-web-puppeteer:v2",
      "/SRC/skia/infra/lottiecap/docker/lottiecap_gold.sh",
      "--builder",
      "Test-Debian10-none-GCE-CPU-AVX2-x86_64-Debug-All-LottieWeb",
      "--git_hash",
      "abc123",
      "--buildbucket_build_id",
      "",
      "--bot_id",
      "",
      "--task_id",
      "",
      "--browser",
      "Chrome",
      "--config",
      "Debug",
      "--issue",
      "1234",
      "--patchset",
      "7",
      "--patch_storage",
      "gerrit"
    ],
    "env": {
      "CHROME_HEADLESS": "1",
      "DOCKER_CONFIG": "/home/chrome-bot/.docker",
      "PATH": "<PATH>:RECIPE_REPO[depot_tools]"
    },
    "name": "Generate LottieWeb Gold output with Docker"
  },
  {
    "cmd": [
      "vpython3",
      "-u",
      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
      "--json-output",
      "/path/to/tmp/json",
      "glob",
      "[START_DIR]/[SWARM_OUT_DIR]",
      "*.png"
    ],
    "infra_step": true,
    "name": "find .png images",
    "~followup_annotations": [
      "@@@STEP_LOG_LINE@glob@[START_DIR]/[SWARM_OUT_DIR]/someimage.png@@@",
      "@@@STEP_LOG_END@glob@@@"
    ]
  },
  {
    "cmd": [
      "gsutil",
      "-m",
      "cp",
      "[START_DIR]/[SWARM_OUT_DIR]/*.png",
      "gs://skia-infra-gm/dm-images-v1"
    ],
    "name": "upload .png images"
  },
  {
    "cmd": [
      "gsutil",
      "cp",
      "-Z",
      "[START_DIR]/[SWARM_OUT_DIR]/dm.json",
      "gs://skia-infra-gm/trybot/dm-json-v1/2012/05/14/12/1234_7/Test-Debian10-none-GCE-CPU-AVX2-x86_64-Debug-All-LottieWeb/1337000001/dm.json"
    ],
    "name": "upload dm.json"
  },
  {
    "name": "$result"
  }
]