Deployment CLI
The general process for deploying a Velopack release (download -> pack -> upload
) can be greatly simplified by using the download
and upload
commands which are built into the vpk
command line tool.
Packing your new release with delta's
In order for delta's to be generated during the pack
command, you need to first download the current latest release. This should be done with the download command:
vpk download http --url https://the.place/you-host/updates
vpk pack -u YourAppId -v 1.0.1 -p {buildOutput}
There are providers for various sources, such GitHub, S3, HTTP, etc.
Deploying releases
In the previous example, we used the http
source, while that is very generic it does not provide any information about how to upload the releases, so in the following deployment example we will use AWS S3.
Most cloud storage providers today have an S3-compatible API (GCP, BackBlaze B2, DigitalOcean, Linode, IBM Cloud, and so forth) and can be used with this command - it is not limited to AWS.
Using AWS, you can authenticate using the aws
command line tool or you can provide access keys as below.
If you are using AWS SSO, you should check the AWS CLI SSO doc and AWS session authentication.
vpk download s3 --bucket MyApp --region us-west-1 --keyId {accessKeyId} --secret {accessKeySecret}
vpk pack -u YourAppId -v 1.0.1 -p {buildOutput}
vpk upload s3 --bucket MyApp --region us-west-1 --keyId {accessKeyId} --secret {accessKeySecret}
Note that you can specify most of these arguments as environment variables too. You can review the AWS SDK environment variables here and every vpk
option can be provided as an environment variable too, to list these in the help text use vpk -H
instead of vpk -h
.
When using a non-AWS S3-compatible API (eg. BackBlaze B2), you need to specify an endpoint instead of a region:
vpk download s3 --bucket MyApp --endpoint https://s3.eu-central-003.backblazeb2.com --keyId {accessKeyId} --secret {accessKeySecret}
vpk pack -u YourAppId -v 1.0.1 -p {buildOutput}
vpk upload s3 --bucket MyApp --endpoint https://s3.eu-central-003.backblazeb2.com --keyId {accessKeyId} --secret {accessKeySecret}