storeden-deploy
v0.1.5
Published
Utility to deploy store template on a Storeden instance
Downloads
7
Maintainers
Readme
Storeden Deploy
deploy template made easy
Utility to deploy store theme on a Storeden instance.
Installation
npm install storeden-deploy
Usage
import deploy from 'storeden-deploy'
deploy({
apiKey: '<api-key>',
apiExchange: '<api-exchange>',
sourcePath: { source: '<source-path>', exclude: '<glob-pattern>' }
})
Parameters
| Parameter | Type | Mandatory | Default | Description |
| ------------- | :------------: | :-------: | :-----: | ------------------------------------------------------------------- |
| apiKey
| String | yes | | API Key associated with your Storeden Store |
| apiExchange
| String | yes | | API Exchange associated with your Storeden Store |
| sourcePath
| String, Object | yes | | Local source path where the script will look for template to deploy |
Returns
A Promise
fulfilled with true
if deploy process succeded, otherwise an error object.
Example - Deploy template
import deploy from 'storeden-deploy'
let deployed
try {
deployed = await deploy({
apiKey: '927f134fe4c92986a528376f34a16c3FAKEd9b4d198359435da5f4f1f1a2d78042566d',
apiExchange: '23c79cc5fb832839465df5d96fef55cae10584b58ab937FAKEecbdd9bbe33ad3',
sourcePath: './myProject/dist'
})
} catch (e) {
deployed = false
}
console.log(deployed) // true for sure!
Example - Deploy template excluding some directory or file
import deploy from 'storeden-deploy'
let deployed
try {
deployed = await deploy({
apiKey: '927f134fe4c92986a528376f34a16c3FAKEd9b4d198359435da5f4f1f1a2d78042566d',
apiExchange: '23c79cc5fb832839465df5d96fef55cae10584b58ab937FAKEecbdd9bbe33ad3',
sourcePath: {
source: './myProject/dist',
exclude: '**/{widgets,generated/**'
} // `exclude` property value must be a glob pattern'
})
} catch (e) {
deployed = false
}
console.log(deployed) // true for sure!
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
MIT. Copyright (C) 2019 H-FARM (Enabling Solutions) - Francesco Pasqua.