MENU
      Create Project

        Create Project


        Article summary

        Summary

        Create a SourceBuild project.

        Request

        API URL

        POST  {SOURCEBUILD_API_URL}/project
        Plain text

        Request parameter

        None

        Request query

        None

        Request body

        {
            "name": "string",
            "description": "string",
            "source": {
                "type": "string",
                "config": {
                    "repository": "string",
                    "branch": "string"
                }
            },
            "env": {
                "compute": { "id": "number" },
                "platform": {
                    "type": "string",
                    "config": "TEnvSourceBuild" | "TEnvContainerRegistry" | "TEnvPublicRegistry"
                },
                "docker": {
                   "use": "boolean",
                   "id": "number"
                },
                "timeout": "number",
                "envVars": {
                   "key": "string",
                   "value": "string"
                }
            },
            "cmd": {
               "pre": ["string"],
               "build": ["string"],
               "post": ["string"],
               "dockerbuild": {
                   "use": "boolean",
                   "dockerfile": "string",
                   "registry": "string",
                   "image": "string",
                   "tag": "string",
                   "latest": "boolean"
               }
            },
            "artifact": {
                "use": "boolean",
                "path": ["string"],
                "storage": {
                    "bucket": "string",
                    "path": "string",
                    "filename": "string"
                },
                "backup": "boolean",
            },
            "cache": {
                "use": "boolean",
                "registry": "string",
                "image": "string",
                "tag": "string",
                "latest": "boolean"
            },
            "linked": {
                "CloudLogAnalytics": "boolean",
                "FileSafer": "boolean",
            }
        }
        JSON
        ItemTypeTypeDefaultDescriptionRemarks
        nameYstringProject name
        descriptionNstring""Project description
        source.typeYstringSource storage typeOnly "SourceCommit"
        source.config.repositoryYstringSource storage repository nameSearch with sourceCommitRepoisotryList API
        source.config.branchYstringSource storage repository branch nameSearch with sourceCommitBranchList API
        env.compute.idYnumberComputing type ID of the build environmentSearch with buildEnvComputeList API
        env.platform.typeYstringImage storage type in the build environment"SourceBuild": Image managed in SourceBuild
        "ContainerRegistry": Image in Container Registry
        "PublicRegistry": Image in public registry
        env.platform.configYTEnvSourceBuild | TEnvContainerRegistry | TEnvPublicRegistryBuild preferencesIf env.platform.type="SourceBuild", TEnvSourceBuild
        If env.platform.type="ContainerRegistry", TEnvContainerRegistry
        If env.platform.type="PublicRegistry", TEnvPublicRegistry
        Refer to TEnvPlatformConfig below
        env.docker.useYbooleanfalseInclusion (use) status of Docker engine in the build environment for Docker
        env.docker.idN (required if env.docker.use=true)numberDocker engine version IDSearch with buildEnvDockerList API
        env.timeoutNnumber5Build run timeout
        env.envVarsN{"key": string, "value": string}[][]Build environment variable
        cmd.preNstring[][]Command before build
        cmd.buildNstring[][]Command during build
        cmd.postNstring[][]Command after build
        cmd.dockerbuild.useNbooleanfalseUse status of Docker image build settings
        cmd.dockerbuild.dockerfileN (required if cmd.dockerbuild.use=true)stringPath including the dockerfile file nameInclude dockerfile in the source storage assigned to source.config.repository, and enter the path from the top level of the source storage.
        cmd.dockerbuild.registryN (required if cmd.dockerbuild.use=true)stringThe registry name of Container Registry to store the image
        cmd.dockerbuild.imageN (required if cmd.dockerbuild.use=true)stringImage name
        cmd.dockerbuild.tagN (required if cmd.dockerbuild.use=true)stringTag name
        cmd.dockerbuild.latestNbooleanfalseSave status of the latest tag
        artifact.useNbooleanfalseSave status of the build results
        artifact.pathN (required if artifact.use=true)string[]Location of the build resultsEnter the path from the top level of the source storage assigned to source.config.repository. Both file and directory paths can be used.
        artifact.storage.bucketN (required if artifact.use=true)stringBucket name of Object Storage to save the results
        artifact.storage.pathN (required if artifact.use=true)stringThe path within the Object Storage bucket to save the results
        artifact.storage.filenameN (required if artifact.use=true)File name to save the resultsThe results are compressed and saved in ZIP format. If the extension is not .zip, .zip will be automatically included in the file name.
        artifact.backupNbooleanfalseBackup status of the results
        cache.useNbooleanfalseSave status of the build environment after completing your buildSave the build environment into an image after completing the build
        This can be set as the image of your build environment for xxx build
        cache.registryN (required if cache.use=true)stringThe registry name of Container Registry to store the image of the build environment after completing the build
        cache.imageN (required if cache.use=true)stringImage name
        cache.tagN (required if cache.use=true)stringTag name
        cache.latestNbooleanfalseSave status of the latest tag
        linked.CloudLogAnalyticsNbooleanfalseSave status of the build log in Cloud Log Analytics
        linked.FileSaferNbooleanfalseTest status of the build results with File Safer (file filter)

        TEnvPlatformConfig

        TEnvSourceBuild

        {
            "os": {
                "id": "number"
            },
            "runtime": {
                "id": "number",
                "version": {
                    "id": "number"
                }
            }
        }
        Plain text
        ItemRequirement statusTypeDescriptionRemarks
        os.idYnumberOperating system IDSearch with buildEnvOSListAPI
        runtime.idYnumberRuntime IDSearch with buildEnvRunTimeList API
        runtime.version.idYnumberRuntime version IDSearch with buildEnvRunTimeVersionList API

        TEnvContainerRegistry

        {
            "registry": "string",
            "image": "string",
            "tag": "string"
        }
        Plain text
        ItemRequirement statusTypeDescriptionRemarks
        registryYstringRegistry name
        imageYstringImage name
        tagYstringTag name

        TEnvPublicRegistry

        {
            "image": "string",
            "tag": "string"
        }
        Plain text
        ItemRequirement statusTypeDescriptionRemarks
        imageYstringImage name
        tagYstringTag name

        Response

        Response body

        {
            "id": "number",
            "name": "string"
        }
        JSON
        ItemTypeDescriptionRemarks
        idnumberProject ID
        namestringProject name

        Was this article helpful?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.