makestatic-deploy-site
v1.0.18
Published
Deploys the site to a configured provider
Downloads
22
Maintainers
Readme
Deploy Site
Deploy build files
Deploys build files using a configured deployment provider.
Install
yarn add makestatic-deploy-site
Configuration
The general syntax to configure a deployment is to add a deploy
object with an environment and a deployment provider, for example to configure the stage
environment to deploy to amazon s3:
module.exports = {
deploy: {
stage: {
s3: {
domain: 'website.com',
credentials: {
profile: 'default'
}
}
}
}
}
Deployment provider modules are resolved relative to your project so you need to install the providers you wish to use.
npm i makestatic-deploy-s3 --save
You can then clean, build and deploy the application with:
makestatic --env stage --provider s3
If you have an existing build and don't want to build before deployment you can perform a deployment by itself using the --deploy
flag:
makestatic --env stage --provider s3 -d
API
DeploySite
Deploys the site to a configured deployment provider.
Deployment providers are classes that expose a deploy
method.
This plugin will (after validation) instantiate an instance of the provider
class and call the deploy
function passing the processing context
, the
deployment config
and the plugin options
.
The provider deploy
function should return a promise that resolves once
the deployment is complete.
See Also
.before
DeploySite.prototype.before(context, options)
Validates deployment for a provider.
context
Object the processing context.options
Object the plugin options.
Throws
Error
if no deployment configuration is detected.Error
if no environment has been specified.Error
if no deployment provider has been specified.Error
if no deployment for the environment is configured.Error
if the output directory does not exist.
.after
DeploySite.prototype.after(context, options)
Performs deployment for a provider.
context
Object the processing context.options
Object the plugin options.
Throws
Error
if the deployment provider module could not be found.Error
if the deployment provider module errors.
#getProviderModuleName
static getProviderModuleName(config)
Gets the name of the module to require for a deployment provider.
The convention is to prepend makestatic-deploy-
to the provider
identifier.
Returns string module name.
config
Object the deployment configuration.
#getProvider
static getProvider(config)
Requires a deployment provider module.
Deployment provider modules should resolve to a class.
Returns the deployment provider module.
config
Object the deployment configuration.
License
MIT
Created by mkdoc on March 12, 2017