This repository was archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 160
feat: Updates to deployment process to enable rollback (Part 1) #183
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,37 @@ | ||
| # Rollback | ||
|
|
||
| ##### `sls rollback` | ||
| - Description - Roll back deployment of Function App & Resource Group | ||
| - Options: | ||
| - `-t` or `--timestamp` - Timestamp associated with version to target | ||
| - Use `sls deploy list` to discover timestamps | ||
| - Defaults to previous deployment | ||
| - **Important to note that there is no option for rolling back an individual function. A function app is considered one unit and will be rolled back as such.** | ||
| - In order to roll back your function app, make sure your `deploy.rollback` is either set to `true` or not specified (defaults to `true`). The container in Azure Blob Storage which contains the packaged code artifacts can also be specified, defaults to `DEPLOYMENT_ARTIFACTS` (see [deploy documentation](./DEPLOY.md)) | ||
|
|
||
| ##### Example usage | ||
|
|
||
| ```bash | ||
| # List all deployments to know the timestamp for rollback | ||
| $ sls deploy list | ||
| Serverless: | ||
| ----------- | ||
| Name: myFunctionApp-t1561479533 | ||
| Timestamp: 1561479533 | ||
| Datetime: 2019-06-25T16:18:53+00:00 | ||
| ----------- | ||
| Name: myFunctionApp-t1561479506 | ||
| Timestamp: 1561479506 | ||
| Datetime: 2019-06-25T16:18:26+00:00 | ||
| ----------- | ||
| Name: myFunctionApp-t1561479444 | ||
| Timestamp: 1561479444 | ||
| Datetime: 2019-06-25T16:17:24+00:00 | ||
| ----------- | ||
|
|
||
| $ sls rollback -t 1561479506 | ||
| ``` | ||
|
|
||
| ##### Sequence diagram for rollback | ||
|
|
||
|  |
This file contains hidden or 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,17 @@ | ||
| ```mermaid | ||
| sequenceDiagram | ||
| participant s as Serverless CLI | ||
| participant r as Resource Group | ||
| participant f as Function App | ||
| participant b as Blob Storage | ||
|
|
||
| note right of s: `sls deploy` | ||
| s ->> r: Create resource group | ||
| s ->> r: Deploy ARM template | ||
| r ->> f: Included in ARM template | ||
| r ->> b: Included in ARM template | ||
| note right of s: Zip code | ||
| s ->> b: Deploy zip code with name {serviceName}-t{timestamp}.zip | ||
| s ->> f: Set package path in settings | ||
| note right of s: Log URLs | ||
| ``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,20 @@ | ||
|
|
||
| ```mermaid | ||
| sequenceDiagram | ||
| participant s as Serverless CLI | ||
| participant r as Resource Group | ||
| participant f as Function App | ||
| participant b as Blob Storage | ||
|
|
||
| note right of s: `sls rollback` | ||
| s ->> r: Request deployments | ||
| r ->> s: Return deployments | ||
| note right of s: Select deployment | ||
| s ->> r: Deploy ARM template | ||
| s ->> b: Request names of previously deployed artifacts | ||
| b ->> s: Return names | ||
| note right of s: Select artifact | ||
| s ->> r: Re-deploy template | ||
| s ->> f: Update RUN_FROM_PACKAGE path (could be done with above step) | ||
| note right of s: Log URLs | ||
| ``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, i like the flexibility 👍