-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathdeploy.js
24 lines (21 loc) · 818 Bytes
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { deploy } = require('sftp-sync-deploy')
const { HOST: host, PASSWORD: password, REMOTEDIR: remoteDir } = process.env
const config = {
host, // Required.
username: 'root', // Required.
password, // Optional.
localDir: './dist', // Required, Absolute or relative to cwd.
remoteDir // Required, Absolute path only.
}
const options = {
dryRun: false, // Enable dry-run mode. Default to false
exclude: [
// exclude patterns (glob)
'node_modules',
'src/**/*.spec.ts'
],
excludeMode: 'remove', // Behavior for excluded files ('remove' or 'ignore'), Default to 'remove'.
forceUpload: false, // Force uploading all files, Default to false(upload only newer files).
concurrency: 100 // Max number of SFTP tasks processed concurrently. Default to 100.
}
return deploy(config, options)