Skip to main content

Application settings

Every application carries a settings object: configuration values nullplatform keeps for the application, such as its default branch and environment, where its build assets are stored, and which code repository it's linked to. Keeping them accurate lets nullplatform resolve the right defaults and find your build assets.

You can read and update these values through the Application API. All settings are optional, so any field may be empty if it hasn't been set yet.

What's in the settings object

The settings object groups related configuration into three blocks. A fully populated object looks like this:

{
"settings": {
"defaults": {
"branch": "main",
"environment": "staging"
},
"asset": {
"docker_server": {
"uri": "registry.example.com/acme-corp/billing-api"
},
"ecr": {
"uri": "123456789012.dkr.ecr.us-east-1.amazonaws.com/billing-api",
"arn": "arn:aws:ecr:us-east-1:123456789012:repository/billing-api"
}
},
"code_repository": {
"specification_id": "7f3c910e-8138-4d65-9d09-b97d89f2c509",
"specification_slug": "github-configuration",
"specification_name": "GitHub",
"specification_icon": "github",
"provider_id": "82eee42c-46c9-4bb7-a53d-c08b027817f3"
}
}
}

Defaults

defaults holds the values nullplatform falls back to when one isn't specified explicitly.

FieldDescription
branchDefault branch name for the application.
environmentDefault environment name for the application.

Asset location

asset records where the application's build assets are stored, so nullplatform knows where to find the images it deploys.

FieldDescription
docker_server.uriLocation of the application's Docker server assets.
asset.ecr.uriAmazon ECR repository URI for the application's assets.
asset.ecr.arnAmazon ECR repository ARN for the application's assets.

Code repository

code_repository describes the repository provider the application is linked to. It references the provider specification (specification_id, specification_slug, specification_name, specification_icon) and the provider instance (provider_id).

Read the settings

Send a GET request to the Application API. The settings object is included in the application's response body.

np application get --id 123

Update the settings

Send a PATCH request to the Application API with the keys you want to change. For example, to set the default branch and environment:

np application patch
--id 123
--body '{
"settings": {
"defaults": {
"branch": "main",
"environment": "staging"
}
}
}'
Updates use JSON Merge Patch

Updates to settings follow JSON Merge Patch (RFC 7396). This means you only send the keys you want to change:

  • A key with a non-null value is created or updated.
  • A key set to null is deleted.
  • A key you omit is left untouched.
Deleting a setting

To clear a value, send the key with null rather than an empty string. For example, { "settings": { "defaults": { "branch": null } } } removes the default branch while preserving every other setting.