-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce Canary deployments as an experimental feature. Closes #3837 Co-authored-by: Sam Gunaratne <[email protected]> Co-authored-by: Seth Boyles <[email protected]>
- Loading branch information
1 parent
3d09a70
commit d66f46a
Showing
31 changed files
with
1,044 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module VCAP::CloudController | ||
class DeploymentContinue | ||
class Error < StandardError | ||
end | ||
class InvalidStatus < Error | ||
end | ||
|
||
class << self | ||
def continue(deployment:, user_audit_info:) | ||
deployment.db.transaction do | ||
deployment.lock! | ||
reject_invalid_state!(deployment) unless deployment.continuable? | ||
|
||
record_audit_event(deployment, user_audit_info) | ||
deployment.update( | ||
state: DeploymentModel::DEPLOYING_STATE, | ||
status_value: DeploymentModel::ACTIVE_STATUS_VALUE, | ||
status_reason: DeploymentModel::DEPLOYING_STATUS_REASON | ||
) | ||
end | ||
end | ||
|
||
private | ||
|
||
def reject_invalid_state!(deployment) | ||
raise InvalidStatus.new("Cannot continue a deployment with status: #{deployment.status_value} and reason: #{deployment.status_reason}") | ||
end | ||
|
||
def record_audit_event(deployment, user_audit_info) | ||
app = deployment.app | ||
Repositories::DeploymentEventRepository.record_continue( | ||
deployment, | ||
deployment.droplet, | ||
user_audit_info, | ||
app.name, | ||
app.space_guid, | ||
app.space.organization_guid | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
docs/v3/source/includes/resources/deployments/_continue.md.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### Continue a deployment | ||
|
||
``` | ||
Example Request | ||
``` | ||
|
||
```shell | ||
curl "https://api.example.org/v3/deployments/[guid]/actions/continue" \ | ||
-X POST \ | ||
-H "Authorization: bearer [token]" | ||
``` | ||
|
||
``` | ||
Example Response | ||
``` | ||
|
||
```http | ||
HTTP/1.1 200 OK | ||
|
||
``` | ||
|
||
#### Definition | ||
`POST /v3/deployments/:guid/actions/continue` | ||
|
||
#### Permitted roles | ||
| | ||
--- | | ||
Admin | | ||
Space Developer | | ||
Space Supporter | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.