2.7 KiB
Read this on the main serverless docs site
Tencent-SCF - Deploying
The Serverless Framework was designed to provision your Serverless Cloud Functions, Events and infrastructure Resources safely and quickly. It does this via a couple of methods designed for different types of deployments.
Deploy All
This is the main method for doing deployments with the Serverless Framework:
serverless deploy
Use this method when you have updated your Function, Event or Resource configuration in serverless.yml and you want to deploy that change (or multiple changes at the same time) to Tencent Cloud.
Note: You can always enforce a deployment using the --force option, or specify a different configuration file name with the the --config option.
Tips
-
Use this in your CI/CD systems, as it is the safest method of deployment.
-
You can print the progress during the deployment if you use
verbosemode, like this:serverless deploy --verbose -
This method defaults to
devstage andap-guangzhouregion. You can change the default stage and region in yourserverless.ymlfile by setting thestageandregionproperties inside aproviderobject as the following example shows:# serverless.yml service: service-name provider: name: tencent stage: production region: ap-beijing -
You can also deploy to different stages and regions by passing in flags to the command:
serverless deploy --stage production --region ap-beijing -
You can specify your own COS bucket which should be used to store all the deployment artifacts. The
cosBucketconfig which is nested underproviderlets you e.g. set thenamefor this bucket. If you don't provide your own bucket, Serverless will create a bucket which by default.
Deploy Function
This deployment method simply overwrites the zip file of the current function on Tencent Cloud.
serverless deploy function --function myFunction
Tips
- Use this when you are developing and want to test because it's much faster.
- During development, people will often run this command several times, as opposed to
serverless deploywhich is only run when larger infrastructure provisioning is required.
Check out the deploy command docs for all details and options.