{
  "repo": "pingcap/benchmarksql",
  "binary": "run-database-build",
  "binary_path": "run/runDatabaseBuild.sh",
  "dependencies": {
    "RunDatabaseBuildCLI.Execute": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Always when the command is invoked"
          ],
          "operations": [
            {
              "operation": "READ FILE",
              "trigger": "Read the properties file and resolve SQL stages",
              "conditions": [
                "PROPS argument points to an existing file"
              ],
              "implementation": "grep '^db=' $PROPS; iterate tableCreates/indexCreates/foreignKeys/extraHistID/buildFinish"
            }
          ]
        }
      },
      "services": [
        {
          "name": "benchmarksql-cli",
          "target_repo": "pingcap/benchmarksql",
          "target_interface": "RunSQLCLI.runSQL.sh PROPS_FILE SQL_FILE",
          "operation_type": "local_cli_call",
          "conditions": [
            "Before and after data load"
          ],
          "operations": [
            {
              "operation": "EXECUTE SUBCOMMAND",
              "trigger": "Apply schema and post-load SQL steps",
              "conditions": [
                "tableCreates and post-load SQL steps are enumerated"
              ],
              "implementation": "./runSQL.sh \"${PROPS}\" $step"
            }
          ]
        },
        {
          "name": "benchmarksql-cli",
          "target_repo": "pingcap/benchmarksql",
          "target_interface": "RunLoaderCLI.runLoader.sh PROPS_FILE [ARGS]",
          "operation_type": "local_cli_call",
          "conditions": [
            "Always once the pre-load SQL stages succeed"
          ],
          "operations": [
            {
              "operation": "EXECUTE SUBCOMMAND",
              "trigger": "Populate benchmark data",
              "conditions": [
                "Pre-load SQL finished successfully"
              ],
              "implementation": "./runLoader.sh \"${PROPS}\" $*"
            }
          ]
        }
      ]
    }
  }
}
