Skip to content
  • Auto
  • Light
  • Dark

Create

Create a new build
builds.create(BuildCreateParams**kwargs) -> idstrconfig_commitstrcreated_atdatetimedocumented_specDocumentedSpecobjectliteralorgstrprojectstrtargetsTargetsupdated_atdatetimeBuildObject
post/v0/builds

Create a new build

Parameters
projectstr
optional

Project name

revisionunion
Union[str, Dict[str, FileInput]]

Specifies what to build: a branch name, commit SHA, merge command ("base..head"), or file contents

Hide ParametersShow Parameters
RevisionUnionMember0type
str

A branch name, commit SHA, or merge command in the format "base..head"

RevisionUnionMember1type
Dict[str, FileInput]

File contents to commit directly

Hide ParametersShow Parameters
Contentclass
Hide ParametersShow Parameters
contentstr

File content

URLclass
Hide ParametersShow Parameters
urlstr

URL to fetch file content from

allow_emptybool
optional

Whether to allow empty commits (no changes). Defaults to false.

branchstr
optional

Optional branch to use. If not specified, defaults to "main". When using a branch name or merge command as revision, this must match or be omitted.

commit_messagestr
optional

Optional commit message to use when creating a new commit.

targetslist
optional
List[Target]

Optional list of SDK targets to build. If not specified, all configured targets will be built.

Hide ParametersShow Parameters
"node"
"typescript"
"python"
"go"
"java"
"kotlin"
"ruby"
"terraform"
"cli"
"php"
"csharp"
Returns
idstrconfig_commitstrcreated_atdatetimedocumented_specDocumentedSpecobjectliteralorgstrprojectstrtargetsTargetsupdated_atdatetimeBuildObject
from stainless_v0 import Stainless

client = Stainless(
    api_key="My API Key",
)
build_object = client.builds.create(
    project="project",
    revision="string",
)
print(build_object.id)
200 Example
{
  "id": "id",
  "config_commit": "config_commit",
  "created_at": "2019-12-27T18:11:19.117Z",
  "documented_spec": {
    "content": "content",
    "type": "content"
  },
  "object": "build",
  "org": "org",
  "project": "project",
  "targets": {
    "cli": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "csharp": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "go": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "java": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "kotlin": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "node": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "php": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "python": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "ruby": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "terraform": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    },
    "typescript": {
      "commit": {
        "status": "not_started"
      },
      "lint": {
        "status": "not_started"
      },
      "object": "build_target",
      "status": "not_started",
      "test": {
        "status": "not_started"
      },
      "build": {
        "status": "not_started"
      },
      "upload": {
        "status": "not_started"
      }
    }
  },
  "updated_at": "2019-12-27T18:11:19.117Z"
}