1 | # Deploy
|
2 |
|
3 | This plugin (re)deploys the service to OpenWhisk.
|
4 |
|
5 | ## How it works
|
6 |
|
7 | `Deploy` starts by hooking into the
|
8 | [`deploy:initializeResources`](/lib/plugins/deploy) lifecycle. It fetches the
|
9 | user credentials for the OpenWhisk service being used, storing them under
|
10 | `serverless.service.defaults`.
|
11 |
|
12 | ### User Credentials
|
13 |
|
14 | The plugin attempts to parse configuration settings from the `.wskprops` file in the user's home directory. These
|
15 | settings can be set manually using the following environment parameters.
|
16 |
|
17 | - **OW_AUTH** - Authentication key for OpenWhisk provider.
|
18 | - **OW_APIHOST** - API endpoint for OpenWhisk provider.
|
19 | - **OW_NAMESPACE** - User namespace for OpenWhisk resources.
|
20 |
|
21 | If both the properties file and environment parameters are missing one of these
|
22 | values, an error will be thrown.
|
23 |
|
24 | **Note:** Other plugins (e.g. the `Compile Functions` plugin) use these
|
25 | `defaults` property when compiling resource definitions and using the OpenWhisk
|
26 | APIs.
|
27 |
|
28 | ### Deploying Functions, Triggers, Rules and Feeds
|
29 |
|
30 | Next up it hooks into the [`deploy:deploy`](/lib/plugins/deploy) lifecycle and deploys the
|
31 | previously created resource definitions for Actions, Triggers, Feeds and Rules
|
32 | using the OpenWhisk APIs.
|
33 |
|
34 | Resources are deployed in the following order:
|
35 |
|
36 | - **Actions**
|
37 | - **Triggers**
|
38 | - **Feeds**
|
39 | - **Rules**
|
40 |
|
41 | Failure to deploy a single resource at any stage will cause the entire
|
42 | deployment to halt with the error message from the failed deployment.
|