Skip to main content

deployment_create

A deployment it's the action to upload a release of code to a scope If the deployment it's initial it will be finalized automatically but it can be cancelled If the deployment it's blue green It can be cancelled or finalized, also by default you can manage the ammount of traffic that goes to the new deployment

It's important to notice that deployments works over releases and not builds. A release is created using a build as reference

If you want to create a deployment, you can use:

np deployment create --api-key <api_key> --body '{
"scope_id": "<scope_id>",
"release_id": "<release_id>",
"asset_name": "<asset_name>" //Optional if the scope has not be deployed before you can see the available assets from build
}'

if you need to create a release, you can use:

np release create --api-key <api_key> --body '{
"status":"active",
"build_id": "<build_id>",
application_id: <application_id>,
semver: <semver to use>, //Usually you can check the last release and use the next semver
}'

You can list the builds which have a commit id reference using (check all the available options with np build list --help): example:

np build list --application_id <application_id> --api-key <api_key>

If you want to cancel a deployment, you can use:

np deployment patch --id <deployment_id> --api-key <api_key> --body '{
"status": "cancelling"
}'

if you want to finalize a deployment you can use:

np deployment patch --id <deployment_id> --api-key <api_key> --body '{
"status": "finalizing"
}'