Skip to content
Staircase

Build

One build contract producing five bundle types, so a conversational agent, a front end, a vendor mapping and a service all move through the same pipeline.

Three files describe a unit of work: what it is, what it exposes, and how it deploys. From those, the build produces one of five bundle types — a service, a data bundle, a front end, a front-end configuration, or a chat bundle.

The bundle is the deployable unit everywhere downstream. Deploy takes it, Marketplace publishes it, and Environment installs it.

How it works

Making a vendor mapping and a React front end the same kind of artifact is what lets one pipeline cover every unit of work. A vendor configuration is not code in the usual sense, but it versions, tests and deploys like everything else, and a separate release path for it would have been a second pipeline to keep correct.

Operations

Product

POST /builds

Build Product

buildProduct

Build a deployable artifact for a product. The artifact must be provided via a URL. A callback will be sent to the URL specified in callback_url property.

Build Hash

The builder generates a unique hash value for each build. This value is available in build metadata which can be accessed using the product information endpoint. Also, this value passes by a Deployer if the AWS CloudFormation parameter definition exists in product serverless.yml. This parameter can be referenced as an environment variable as follows.

Show the rest

Product serverless.yml:

provider: 
 environment: 
 BUILD_HASH: 
 Ref: BuildHash
...
resources: 
 Parameters: 
 BuildHash: 
 Type: String 
 Description: This info will be generated by the Builder and passed by Deployer. It contains a product build hash. 
 Default: "null"

architecture

By default, X86_64 architecture is used to build dependencies. Switch to ARM64 using the 64-bit ARM architecture for the AWS Graviton2 processor. It is possible to use only one architecture per build.

node_version

You can configure Node version to use to package your dependencies. Please note, that node_version = 14 works only with architecture = X86_64 and compute_instance_size = SMALL. node_version 18 and 20 works only with architecture = ARM64 and compute_instance_size = SMALL.

compute_instance_size

You can configure how much memory and disk space your build can take up. compute_instance_size is dependent on architecture. The following table describes mapping of allowed architectures to compute instance sizes.

Architecture Compute instance size Memory Disk space vCPUs
ARM64 SMALL 4 GB 50 GB 2
ARM64 LARGE 16 GB 50 GB 8
X86_64 SMALL 3 GB 64 GB 2
Request
application/json
{
  "source_url": "https://code-manager-dev-root.s3.amazonaws.com/service-builder-api/2f867413-2f16-4c73-86ec-3086c0d4a33c/source.zip"
}
Response
application/json

Build created

{
  "build_id": "13bd5b51-1a41-4510-9baa-d7f7e24c89a3"
}
Request bodyapplication/json
8 fields
FieldTypeDescription
bundle_idstring (uuid)Usually a hash of the commit but can be any UUID.
source_urlrequiredstring (uri)Presigned URL to source code.
callback_urlstring (uri)Callback URL where are you waiting for build status
serverless_versionstringServerless version, that is used in build process to update serverless framework version.2.x3.xExample 3.x
log_levelstringLog level, that is used in build process. Can be used with \"DEBUG\" value for Build product debugging.DEBUGINFOExample INFO
architecturestringArchitecture used to build your bundle dependencies.ARM64X86_64Example X86_64
node_versionstringNode version used to package your dependencies. 14 version works only with X86_64, small instance.12141820Example 12
compute_instance_sizestringCompute instance size defines the computational instance used during the build.LARGESMALLExample SMALL
Response 201application/json
1 fields

Build created

FieldTypeDescription
build_idstring (uuid)Unique build_id which can be used for tracking build status. Usually it is a UUID.
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
GET /builds/{build_id}

Retrieve Product Build Status

getBuildStatus

Retrieve Service Build Status retrieves metadata generated by the build.

  • Metadata is available only for builds that succeed (status==SUCCEEDED).
  • The artifact_url key in the response body contains the URL to the artifact that was built. This URL only supports the GET method and is valid for one hour. A new request to this endpoint will provide a new artifact_url.
  • The response to a GET request for artifact_url will contain headers describing the artifact metadata. Only header names that start with x-amz-meta-service are considered service metadata.
  • Regardless of status response contains build execution logs
Response
application/json

200 response

{
  "build_id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
  "status": "SUCCEEDED",
  "metadata": {
    "service-assessor": {
      "id": "devops-code-assessor:e5dcb19e-b025-4255-a42f-7f501456703c",
      "timestamp": 1623399920.05132,
      "version": "1.0.0",
      "issuer": "https://build.staircaseapi.com/code-assessor",
      "status": "SUCCEEDED"
    },
    "service-code": {
      "id": "0da65dfd-9753-4bb4-8853-06e608979e73",
      "timestamp": 1623399796.747468,
      "version": "1.1",
      "status": "SUCCEEDED",
      "commit_hash": "c366156be0d8a39ce9a7bf85a5f5d5fc1a59ba4c",
      "issuer": "https://build.staircaseapi.com/code"
    },
    "service-builder": {
      "id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
      "timestamp": 1623400025.2152104,
      "version": "1.1",
      "status": "SUCCEEDED",
      "bundle_type": "SERVICE",
      "issuer": "https://build.staircaseapi.com/infra-builder"
    }
  },
  "artifacts_url": "https://builder-api-dev-codebuilddevbucket-kkwqngshvjap.s3.amazonaws.com/build-main/build/7ac245b7-2f93-485-8e8-abfdfd3b0a76/build.zip?AWSAccessKeyId=<redacted>&Signature=<redacted>&x-amz-security-token=<redacted>&Expires=1623405346",
  "logs": [
    "[Container] 2021/06/11 08:26:14 Waiting for agent ping\n",
    "[Container] 2021/06/11 08:26:17 Waiting for DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 Phase is DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 CODEBUILD_SRC_DIR=/codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 YAML location is /codebuild/readonly/buildspec.yml\n",
    "[Container] 2021/06/11 08:26:17 No commands found for phase name: post_build\n",
    "[Container] 2021/06/11 08:26:17 Processing environment variables\n",
    "[Container] 2021/06/11 08:26:17 Moving to directory /codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 Registering with agent\n",
    "[Container] 2021/06/11 08:26:17 Phases found in YAML: 2\n",
    "[Container] 2021/06/11 08:26:17  BUILD: 1 commands\n",
    "[Container] 2021/06/11 08:26:17  POST_BUILD: 0 commands\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase INSTALL\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: INSTALL State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase PRE_BUILD\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: PRE_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase BUILD\n",
    "[Container] 2021/06/11 08:26:17 Running command python3.8 /opt/build.py --env $STAIRCASE_ENV --source $SOURCE_URL --id $BUNDLE_ID --host $HOST --api_key $X_API_KEY --bundle_type $BUNDLE_TYPE\n",
    "npm WARN builder-api@1.0.0 No repository field.",
    "Serverless: Excluding development dependencies...",
    "Serverless: Injecting required Python packages to package...",
    "Serverless: Updated AWS resource tags..",
    "Health response code 403. Body b'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<Error><Code>AccessDenied</Code><Message>Invalid date (should be seconds since epoch): 1623403526code-health-checker/metric/7ac245b7-2f93-485-8e8-abfdfd3b0a76</Message><RequestId>P9ZDFS9GZNB3NYDJ</RequestId><HostId>ol1TYDYI/NgoC5uaxDld7Cii9sbSO4e+d+FK7G+FZJ2NwpZ40JgylLT60DiuSAwdQUQLbkNA1pc=</HostId></Error>'",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Entering phase POST_BUILD\n",
    "[Container] 2021/06/11 08:27:06 Running command if [ $CALLBACK_URL != \"null\" ]; then",
    "  if [ \"$CODEBUILD_BUILD_SUCCEEDING\" = \"1\" ]; then",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"SUCCEEDED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    "  else\n",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"FAILED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    " fi\n",
    "fi",
    "\n",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: POST_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Expanding base directory path: .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding .\n",
    "[Container] 2021/06/11 08:27:06 Expanding file paths for base directory .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding /output.json\n",
    "[Container] 2021/06/11 08:27:06 Found 1 file(s)\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n"
  ]
}
Parameters
1
ParameterTypeExampleDescription
build_id required string path 7ac245b7-2f93-485-8e8-abfdfd3b0a76 Unique build ID which was returned when build was started
Response 200application/json
5 fields

200 response

FieldTypeDescription
build_idstring (uuid)Unique build ID which was returned when build was started
statusstringBuild status (IN_PROGRESS, FAILED, SUCCEEDED)
artifacts_urlstring (url)Artifact URL if build was successfully completed
logsstring[]Build Logs which can be used for build problem investigation
metadataobjectMetadata generated by build
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
Response 404application/json
1 fields

Build not found

FieldTypeDescription
messagestringMessage which contains information about requested entity

Chat Bundle

POST /chat

Build Chat Bundle

buildChatBundle

Build Frontend Bundle

Build a deployable artifact for a chat bundle. The artifact must be provided via a URL. A callback will be sent to the URL specified in callback_url property.

Request
application/json
{
  "source_url": "https://code-manager-dev-root.s3.amazonaws.com/service-builder-api/2f867413-2f16-4c73-86ec-3086c0d4a33c/source.zip"
}
Response
application/json

Build created

{
  "build_id": "13bd5b51-1a41-4510-9baa-d7f7e24c89a3"
}
Request bodyapplication/json
4 fields
FieldTypeDescription
bundle_idstring (uuid)Usually a hash of the commit but can be any UUID.
source_urlrequiredstring (uri)Presigned URL to source code.
callback_urlstring (uri)Callback URL where are you waiting for build status
env_variablesstringEnv variables, that is used in build process.
Response 201application/json
1 fields

Build created

FieldTypeDescription
build_idstring (uuid)Unique build_id which can be used for tracking build status. Usually it is a UUID.
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
GET /chat/{build_id}

Retrieve Chat Bundle Build Status

getChatBundleStatus

Get build status for Chat bundles retrieves metadata generated by the build.

  • Metadata is available only for builds that succeed (status==SUCCEEDED).
  • The artifact_url key in the response body contains the URL to the artifact that was built. This URL only supports the GET method and is valid for one hour. A new request to this endpoint will provide a new artifact_url.
  • The response to a GET request for artifact_url will contain headers describing the artifact metadata. Only header names that start with x-amz-meta-service are considered service metadata.
  • Regardless of status response contains build execution logs
Response
application/json

200 response

{
  "build_id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
  "status": "SUCCEEDED",
  "metadata": {
    "service-assessor": {
      "id": "devops-code-assessor:e5dcb19e-b025-4255-a42f-7f501456703c",
      "timestamp": 1623399920.05132,
      "version": "1.0.0",
      "issuer": "https://build.staircaseapi.com/code-assessor",
      "status": "SUCCEEDED"
    },
    "service-code": {
      "id": "0da65dfd-9753-4bb4-8853-06e608979e73",
      "timestamp": 1623399796.747468,
      "version": "1.1",
      "status": "SUCCEEDED",
      "commit_hash": "c366156be0d8a39ce9a7bf85a5f5d5fc1a59ba4c",
      "issuer": "https://build.staircaseapi.com/code"
    },
    "service-builder": {
      "id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
      "timestamp": 1623400025.2152104,
      "version": "1.1",
      "status": "SUCCEEDED",
      "bundle_type": "SERVICE",
      "issuer": "https://build.staircaseapi.com/infra-builder"
    }
  },
  "artifacts_url": "https://builder-api-dev-codebuilddevbucket-kkwqngshvjap.s3.amazonaws.com/build-main/build/7ac245b7-2f93-485-8e8-abfdfd3b0a76/build.zip?AWSAccessKeyId=<redacted>&Signature=<redacted>&x-amz-security-token=<redacted>&Expires=1623405346",
  "logs": [
    "[Container] 2021/06/11 08:26:14 Waiting for agent ping\n",
    "[Container] 2021/06/11 08:26:17 Waiting for DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 Phase is DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 CODEBUILD_SRC_DIR=/codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 YAML location is /codebuild/readonly/buildspec.yml\n",
    "[Container] 2021/06/11 08:26:17 No commands found for phase name: post_build\n",
    "[Container] 2021/06/11 08:26:17 Processing environment variables\n",
    "[Container] 2021/06/11 08:26:17 Moving to directory /codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 Registering with agent\n",
    "[Container] 2021/06/11 08:26:17 Phases found in YAML: 2\n",
    "[Container] 2021/06/11 08:26:17  BUILD: 1 commands\n",
    "[Container] 2021/06/11 08:26:17  POST_BUILD: 0 commands\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase INSTALL\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: INSTALL State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase PRE_BUILD\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: PRE_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase BUILD\n",
    "[Container] 2021/06/11 08:26:17 Running command python3.8 /opt/build.py --env $STAIRCASE_ENV --source $SOURCE_URL --id $BUNDLE_ID --host $HOST --api_key $X_API_KEY --bundle_type $BUNDLE_TYPE\n",
    "npm WARN builder-api@1.0.0 No repository field.",
    "Serverless: Excluding development dependencies...",
    "Serverless: Injecting required Python packages to package...",
    "Serverless: Updated AWS resource tags..",
    "Health response code 403. Body b'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<Error><Code>AccessDenied</Code><Message>Invalid date (should be seconds since epoch): 1623403526code-health-checker/metric/7ac245b7-2f93-485-8e8-abfdfd3b0a76</Message><RequestId>P9ZDFS9GZNB3NYDJ</RequestId><HostId>ol1TYDYI/NgoC5uaxDld7Cii9sbSO4e+d+FK7G+FZJ2NwpZ40JgylLT60DiuSAwdQUQLbkNA1pc=</HostId></Error>'",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Entering phase POST_BUILD\n",
    "[Container] 2021/06/11 08:27:06 Running command if [ $CALLBACK_URL != \"null\" ]; then",
    "  if [ \"$CODEBUILD_BUILD_SUCCEEDING\" = \"1\" ]; then",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"SUCCEEDED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    "  else\n",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"FAILED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    " fi\n",
    "fi",
    "\n",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: POST_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Expanding base directory path: .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding .\n",
    "[Container] 2021/06/11 08:27:06 Expanding file paths for base directory .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding /output.json\n",
    "[Container] 2021/06/11 08:27:06 Found 1 file(s)\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n"
  ]
}
Parameters
1
ParameterTypeExampleDescription
build_id required string path 7ac245b7-2f93-485-8e8-abfdfd3b0a76 Unique build ID which was returned when build was started
Response 200application/json
5 fields

200 response

FieldTypeDescription
build_idstring (uuid)Unique build ID which was returned when build was started
statusstringBuild status (IN_PROGRESS, FAILED, SUCCEEDED)
artifacts_urlstring (url)Artifact URL if build was successfully completed
logsstring[]Build Logs which can be used for build problem investigation
metadataobjectMetadata generated by build
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
Response 404application/json
1 fields

Build not found

FieldTypeDescription
messagestringMessage which contains information about requested entity

Data Bundle

POST /data

Build Data Bundle

buildDataBundle

Build a deployable artifact for a data bundle. The artifact must be provided via a URL. A callback will be sent to the URL specified in callback_url property. Build allows data bundle handlers to invoke IAM authorized endpoints by adding API execution policy.

Request
application/json
{
  "source_url": "https://code-manager-dev-root.s3.amazonaws.com/service-builder-api/2f867413-2f16-4c73-86ec-3086c0d4a33c/source.zip"
}
Response
application/json

Build created

{
  "build_id": "13bd5b51-1a41-4510-9baa-d7f7e24c89a3"
}
Request bodyapplication/json
5 fields
FieldTypeDescription
bundle_idstring (uuid)Usually a hash of the commit but can be any UUID.
source_urlrequiredstring (uri)Presigned URL to source code.
callback_urlstring (uri)Callback URL where are you waiting for build status
custom_parametersstringCustom parameters, that is used in deployment process. Passed parameter is available in data bundler handler event object with key name 'CUSTOM_PARAMETERS'. Custom parameters have 4 KB size limit.
serverless_versionstringServerless version, that is used in build process to update serverless framework version.2.x3.xExample 3.x
Response 201application/json
1 fields

Build created

FieldTypeDescription
build_idstring (uuid)Unique build_id which can be used for tracking build status. Usually it is a UUID.
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
GET /data/{build_id}

Retrieve Data Bundle Build Status

getDataBundleStatus

Get build status for data bundles retrieves metadata generated by the build.

  • Metadata is available only for builds that succeed (status==SUCCEEDED).
  • The artifact_url key in the response body contains the URL to the artifact that was built. This URL only supports the GET method and is valid for one hour. A new request to this endpoint will provide a new artifact_url.
  • The response to a GET request for artifact_url will contain headers describing the artifact metadata. Only header names that start with x-amz-meta-service are considered service metadata.
  • Regardless of status response contains build execution logs
Response
application/json

200 response

{
  "build_id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
  "status": "SUCCEEDED",
  "metadata": {
    "service-assessor": {
      "id": "devops-code-assessor:e5dcb19e-b025-4255-a42f-7f501456703c",
      "timestamp": 1623399920.05132,
      "version": "1.0.0",
      "issuer": "https://build.staircaseapi.com/code-assessor",
      "status": "SUCCEEDED"
    },
    "service-code": {
      "id": "0da65dfd-9753-4bb4-8853-06e608979e73",
      "timestamp": 1623399796.747468,
      "version": "1.1",
      "status": "SUCCEEDED",
      "commit_hash": "c366156be0d8a39ce9a7bf85a5f5d5fc1a59ba4c",
      "issuer": "https://build.staircaseapi.com/code"
    },
    "service-builder": {
      "id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
      "timestamp": 1623400025.2152104,
      "version": "1.1",
      "status": "SUCCEEDED",
      "bundle_type": "SERVICE",
      "issuer": "https://build.staircaseapi.com/infra-builder"
    }
  },
  "artifacts_url": "https://builder-api-dev-codebuilddevbucket-kkwqngshvjap.s3.amazonaws.com/build-main/build/7ac245b7-2f93-485-8e8-abfdfd3b0a76/build.zip?AWSAccessKeyId=<redacted>&Signature=<redacted>&x-amz-security-token=<redacted>&Expires=1623405346",
  "logs": [
    "[Container] 2021/06/11 08:26:14 Waiting for agent ping\n",
    "[Container] 2021/06/11 08:26:17 Waiting for DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 Phase is DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 CODEBUILD_SRC_DIR=/codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 YAML location is /codebuild/readonly/buildspec.yml\n",
    "[Container] 2021/06/11 08:26:17 No commands found for phase name: post_build\n",
    "[Container] 2021/06/11 08:26:17 Processing environment variables\n",
    "[Container] 2021/06/11 08:26:17 Moving to directory /codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 Registering with agent\n",
    "[Container] 2021/06/11 08:26:17 Phases found in YAML: 2\n",
    "[Container] 2021/06/11 08:26:17  BUILD: 1 commands\n",
    "[Container] 2021/06/11 08:26:17  POST_BUILD: 0 commands\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase INSTALL\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: INSTALL State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase PRE_BUILD\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: PRE_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase BUILD\n",
    "[Container] 2021/06/11 08:26:17 Running command python3.8 /opt/build.py --env $STAIRCASE_ENV --source $SOURCE_URL --id $BUNDLE_ID --host $HOST --api_key $X_API_KEY --bundle_type $BUNDLE_TYPE\n",
    "npm WARN builder-api@1.0.0 No repository field.",
    "Serverless: Excluding development dependencies...",
    "Serverless: Injecting required Python packages to package...",
    "Serverless: Updated AWS resource tags..",
    "Health response code 403. Body b'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<Error><Code>AccessDenied</Code><Message>Invalid date (should be seconds since epoch): 1623403526code-health-checker/metric/7ac245b7-2f93-485-8e8-abfdfd3b0a76</Message><RequestId>P9ZDFS9GZNB3NYDJ</RequestId><HostId>ol1TYDYI/NgoC5uaxDld7Cii9sbSO4e+d+FK7G+FZJ2NwpZ40JgylLT60DiuSAwdQUQLbkNA1pc=</HostId></Error>'",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Entering phase POST_BUILD\n",
    "[Container] 2021/06/11 08:27:06 Running command if [ $CALLBACK_URL != \"null\" ]; then",
    "  if [ \"$CODEBUILD_BUILD_SUCCEEDING\" = \"1\" ]; then",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"SUCCEEDED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    "  else\n",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"FAILED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    " fi\n",
    "fi",
    "\n",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: POST_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Expanding base directory path: .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding .\n",
    "[Container] 2021/06/11 08:27:06 Expanding file paths for base directory .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding /output.json\n",
    "[Container] 2021/06/11 08:27:06 Found 1 file(s)\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n"
  ]
}
Parameters
1
ParameterTypeExampleDescription
build_id required string path 7ac245b7-2f93-485-8e8-abfdfd3b0a76 Unique build ID which was returned when build was started
Response 200application/json
5 fields

200 response

FieldTypeDescription
build_idstring (uuid)Unique build ID which was returned when build was started
statusstringBuild status (IN_PROGRESS, FAILED, SUCCEEDED)
artifacts_urlstring (url)Artifact URL if build was successfully completed
logsstring[]Build Logs which can be used for build problem investigation
metadataobjectMetadata generated by build
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
Response 404application/json
1 fields

Build not found

FieldTypeDescription
messagestringMessage which contains information about requested entity

Frontend Bundle

POST /frontend

Build Frontend Bundle

buildFrontendBundle

Build a deployable artifact for a frontend bundle. The artifact must be provided via a URL. A callback will be sent to the URL specified in callback_url property.

Request
application/json
{
  "source_url": "https://code-manager-dev-root.s3.amazonaws.com/service-builder-api/2f867413-2f16-4c73-86ec-3086c0d4a33c/source.zip"
}
Response
application/json

Build created

{
  "build_id": "13bd5b51-1a41-4510-9baa-d7f7e24c89a3"
}
Request bodyapplication/json
4 fields
FieldTypeDescription
bundle_idstring (uuid)Usually a hash of the commit but can be any UUID.
source_urlrequiredstring (uri)Presigned URL to source code.
callback_urlstring (uri)Callback URL where are you waiting for build status
env_variablesstringEnv variables, that is used in build process.
Response 201application/json
1 fields

Build created

FieldTypeDescription
build_idstring (uuid)Unique build_id which can be used for tracking build status. Usually it is a UUID.
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
GET /frontend/{build_id}

Retrieve Frontend Bundle Build Status

getFrontendBundleStatus

Get build status for fronend bundles retrieves metadata generated by the build.

  • Metadata is available only for builds that succeed (status==SUCCEEDED).
  • The artifact_url key in the response body contains the URL to the artifact that was built. This URL only supports the GET method and is valid for one hour. A new request to this endpoint will provide a new artifact_url.
  • The response to a GET request for artifact_url will contain headers describing the artifact metadata. Only header names that start with x-amz-meta-service are considered service metadata.
  • Regardless of status response contains build execution logs
Response
application/json

200 response

{
  "build_id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
  "status": "SUCCEEDED",
  "metadata": {
    "service-assessor": {
      "id": "devops-code-assessor:e5dcb19e-b025-4255-a42f-7f501456703c",
      "timestamp": 1623399920.05132,
      "version": "1.0.0",
      "issuer": "https://build.staircaseapi.com/code-assessor",
      "status": "SUCCEEDED"
    },
    "service-code": {
      "id": "0da65dfd-9753-4bb4-8853-06e608979e73",
      "timestamp": 1623399796.747468,
      "version": "1.1",
      "status": "SUCCEEDED",
      "commit_hash": "c366156be0d8a39ce9a7bf85a5f5d5fc1a59ba4c",
      "issuer": "https://build.staircaseapi.com/code"
    },
    "service-builder": {
      "id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
      "timestamp": 1623400025.2152104,
      "version": "1.1",
      "status": "SUCCEEDED",
      "bundle_type": "SERVICE",
      "issuer": "https://build.staircaseapi.com/infra-builder"
    }
  },
  "artifacts_url": "https://builder-api-dev-codebuilddevbucket-kkwqngshvjap.s3.amazonaws.com/build-main/build/7ac245b7-2f93-485-8e8-abfdfd3b0a76/build.zip?AWSAccessKeyId=<redacted>&Signature=<redacted>&x-amz-security-token=<redacted>&Expires=1623405346",
  "logs": [
    "[Container] 2021/06/11 08:26:14 Waiting for agent ping\n",
    "[Container] 2021/06/11 08:26:17 Waiting for DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 Phase is DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 CODEBUILD_SRC_DIR=/codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 YAML location is /codebuild/readonly/buildspec.yml\n",
    "[Container] 2021/06/11 08:26:17 No commands found for phase name: post_build\n",
    "[Container] 2021/06/11 08:26:17 Processing environment variables\n",
    "[Container] 2021/06/11 08:26:17 Moving to directory /codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 Registering with agent\n",
    "[Container] 2021/06/11 08:26:17 Phases found in YAML: 2\n",
    "[Container] 2021/06/11 08:26:17  BUILD: 1 commands\n",
    "[Container] 2021/06/11 08:26:17  POST_BUILD: 0 commands\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase INSTALL\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: INSTALL State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase PRE_BUILD\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: PRE_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase BUILD\n",
    "[Container] 2021/06/11 08:26:17 Running command python3.8 /opt/build.py --env $STAIRCASE_ENV --source $SOURCE_URL --id $BUNDLE_ID --host $HOST --api_key $X_API_KEY --bundle_type $BUNDLE_TYPE\n",
    "npm WARN builder-api@1.0.0 No repository field.",
    "Serverless: Excluding development dependencies...",
    "Serverless: Injecting required Python packages to package...",
    "Serverless: Updated AWS resource tags..",
    "Health response code 403. Body b'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<Error><Code>AccessDenied</Code><Message>Invalid date (should be seconds since epoch): 1623403526code-health-checker/metric/7ac245b7-2f93-485-8e8-abfdfd3b0a76</Message><RequestId>P9ZDFS9GZNB3NYDJ</RequestId><HostId>ol1TYDYI/NgoC5uaxDld7Cii9sbSO4e+d+FK7G+FZJ2NwpZ40JgylLT60DiuSAwdQUQLbkNA1pc=</HostId></Error>'",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Entering phase POST_BUILD\n",
    "[Container] 2021/06/11 08:27:06 Running command if [ $CALLBACK_URL != \"null\" ]; then",
    "  if [ \"$CODEBUILD_BUILD_SUCCEEDING\" = \"1\" ]; then",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"SUCCEEDED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    "  else\n",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"FAILED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    " fi\n",
    "fi",
    "\n",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: POST_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Expanding base directory path: .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding .\n",
    "[Container] 2021/06/11 08:27:06 Expanding file paths for base directory .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding /output.json\n",
    "[Container] 2021/06/11 08:27:06 Found 1 file(s)\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n"
  ]
}
Parameters
1
ParameterTypeExampleDescription
build_id required string path 7ac245b7-2f93-485-8e8-abfdfd3b0a76 Unique build ID which was returned when build was started
Response 200application/json
5 fields

200 response

FieldTypeDescription
build_idstring (uuid)Unique build ID which was returned when build was started
statusstringBuild status (IN_PROGRESS, FAILED, SUCCEEDED)
artifacts_urlstring (url)Artifact URL if build was successfully completed
logsstring[]Build Logs which can be used for build problem investigation
metadataobjectMetadata generated by build
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
Response 404application/json
1 fields

Build not found

FieldTypeDescription
messagestringMessage which contains information about requested entity

Frontend Config Bundle

POST /frontend-config

Build Frontend Config Bundle

buildFrontendConfigBundle

Build a deployable artifact for a frontend config bundle. The artifact must be provided via a URL. A callback will be sent to the URL specified in callback_url property.

Request
application/json
{
  "source_url": "https://code-manager-dev-root.s3.amazonaws.com/service-builder-api/2f867413-2f16-4c73-86ec-3086c0d4a33c/source.zip"
}
Response
application/json

Build created

{
  "build_id": "13bd5b51-1a41-4510-9baa-d7f7e24c89a3"
}
Request bodyapplication/json
4 fields
FieldTypeDescription
bundle_idstring (uuid)Usually a hash of the commit but can be any UUID.
source_urlrequiredstring (uri)Presigned URL to source code.
callback_urlstring (uri)Callback URL where are you waiting for build status
env_variablesstringEnv variables, that is used in build process.
Response 201application/json
1 fields

Build created

FieldTypeDescription
build_idstring (uuid)Unique build_id which can be used for tracking build status. Usually it is a UUID.
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
GET /frontend-config/{build_id}

Retrieve Frontend Config Bundle Build Status

getFrontendConfigBundleStatus

Get build status for Frontend Config bundles retrieves metadata generated by the build.

  • Metadata is available only for builds that succeed (status==SUCCEEDED).
  • The artifact_url key in the response body contains the URL to the artifact that was built. This URL only supports the GET method and is valid for one hour. A new request to this endpoint will provide a new artifact_url.
  • The response to a GET request for artifact_url will contain headers describing the artifact metadata. Only header names that start with x-amz-meta-service are considered service metadata.
  • Regardless of status response contains build execution logs
Response
application/json

200 response

{
  "build_id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
  "status": "SUCCEEDED",
  "metadata": {
    "service-assessor": {
      "id": "devops-code-assessor:e5dcb19e-b025-4255-a42f-7f501456703c",
      "timestamp": 1623399920.05132,
      "version": "1.0.0",
      "issuer": "https://build.staircaseapi.com/code-assessor",
      "status": "SUCCEEDED"
    },
    "service-code": {
      "id": "0da65dfd-9753-4bb4-8853-06e608979e73",
      "timestamp": 1623399796.747468,
      "version": "1.1",
      "status": "SUCCEEDED",
      "commit_hash": "c366156be0d8a39ce9a7bf85a5f5d5fc1a59ba4c",
      "issuer": "https://build.staircaseapi.com/code"
    },
    "service-builder": {
      "id": "7ac245b7-2f93-485-8e8-abfdfd3b0a76",
      "timestamp": 1623400025.2152104,
      "version": "1.1",
      "status": "SUCCEEDED",
      "bundle_type": "SERVICE",
      "issuer": "https://build.staircaseapi.com/infra-builder"
    }
  },
  "artifacts_url": "https://builder-api-dev-codebuilddevbucket-kkwqngshvjap.s3.amazonaws.com/build-main/build/7ac245b7-2f93-485-8e8-abfdfd3b0a76/build.zip?AWSAccessKeyId=<redacted>&Signature=<redacted>&x-amz-security-token=<redacted>&Expires=1623405346",
  "logs": [
    "[Container] 2021/06/11 08:26:14 Waiting for agent ping\n",
    "[Container] 2021/06/11 08:26:17 Waiting for DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 Phase is DOWNLOAD_SOURCE\n",
    "[Container] 2021/06/11 08:26:17 CODEBUILD_SRC_DIR=/codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 YAML location is /codebuild/readonly/buildspec.yml\n",
    "[Container] 2021/06/11 08:26:17 No commands found for phase name: post_build\n",
    "[Container] 2021/06/11 08:26:17 Processing environment variables\n",
    "[Container] 2021/06/11 08:26:17 Moving to directory /codebuild/output/src212027353/src\n",
    "[Container] 2021/06/11 08:26:17 Registering with agent\n",
    "[Container] 2021/06/11 08:26:17 Phases found in YAML: 2\n",
    "[Container] 2021/06/11 08:26:17  BUILD: 1 commands\n",
    "[Container] 2021/06/11 08:26:17  POST_BUILD: 0 commands\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase INSTALL\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: INSTALL State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase PRE_BUILD\n",
    "[Container] 2021/06/11 08:26:17 Phase complete: PRE_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:26:17 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:26:17 Entering phase BUILD\n",
    "[Container] 2021/06/11 08:26:17 Running command python3.8 /opt/build.py --env $STAIRCASE_ENV --source $SOURCE_URL --id $BUNDLE_ID --host $HOST --api_key $X_API_KEY --bundle_type $BUNDLE_TYPE\n",
    "npm WARN builder-api@1.0.0 No repository field.",
    "Serverless: Excluding development dependencies...",
    "Serverless: Injecting required Python packages to package...",
    "Serverless: Updated AWS resource tags..",
    "Health response code 403. Body b'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<Error><Code>AccessDenied</Code><Message>Invalid date (should be seconds since epoch): 1623403526code-health-checker/metric/7ac245b7-2f93-485-8e8-abfdfd3b0a76</Message><RequestId>P9ZDFS9GZNB3NYDJ</RequestId><HostId>ol1TYDYI/NgoC5uaxDld7Cii9sbSO4e+d+FK7G+FZJ2NwpZ40JgylLT60DiuSAwdQUQLbkNA1pc=</HostId></Error>'",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Entering phase POST_BUILD\n",
    "[Container] 2021/06/11 08:27:06 Running command if [ $CALLBACK_URL != \"null\" ]; then",
    "  if [ \"$CODEBUILD_BUILD_SUCCEEDING\" = \"1\" ]; then",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"SUCCEEDED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    "  else\n",
    "    curl --request POST $CALLBACK_URL --header 'Content-Type: application/json' --data '{\"status\": \"FAILED\",\"bundle_id\": \"'$BUNDLE_ID'\"}'",
    " fi\n",
    "fi",
    "\n",
    "\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: POST_BUILD State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n",
    "[Container] 2021/06/11 08:27:06 Expanding base directory path: .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding .\n",
    "[Container] 2021/06/11 08:27:06 Expanding file paths for base directory .\n",
    "[Container] 2021/06/11 08:27:06 Assembling file list\n",
    "[Container] 2021/06/11 08:27:06 Expanding /output.json\n",
    "[Container] 2021/06/11 08:27:06 Found 1 file(s)\n",
    "[Container] 2021/06/11 08:27:06 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED\n",
    "[Container] 2021/06/11 08:27:06 Phase context status code:  Message: \n"
  ]
}
Parameters
1
ParameterTypeExampleDescription
build_id required string path 7ac245b7-2f93-485-8e8-abfdfd3b0a76 Unique build ID which was returned when build was started
Response 200application/json
5 fields

200 response

FieldTypeDescription
build_idstring (uuid)Unique build ID which was returned when build was started
statusstringBuild status (IN_PROGRESS, FAILED, SUCCEEDED)
artifacts_urlstring (url)Artifact URL if build was successfully completed
logsstring[]Build Logs which can be used for build problem investigation
metadataobjectMetadata generated by build
Response 400application/json
1 fields

Request data failed validation

FieldTypeDescription
messageone ofError message in string or object format
Response 403application/json
2 fields

Forbidden

FieldTypeDescription
messagestringError message in string format
urlstring (url)URL with link to page with information how this issue can be resolved
Response 404application/json
1 fields

Build not found

FieldTypeDescription
messagestringMessage which contains information about requested entity

Errors

400403404

Type to search.