File System Deploy. Auto-deploys a file after saving.
Define a source and target folder structure to automatically copy a file, which was saved inside the source target structure.
For example if there is a file in your workspace under /usr/code/project/test.js and you have a source defined as /usr/code/project and a target defined as /var/www/html/foo the file test.js will get copied to/var/www/html/foo/test as soon as you hit save or execute the command fsdeploy: Deploy File.
This extension contributes the following settings
fsdeploy.nodes
: array of objects containing a source/target set.fsdeploy.deployOnSave
: boolean flag indicating if a file should get immediately deployed when saving.fsdeploy.deployWorkspaceOnSave
: boolean flag indicating if the complete workspace should get immediately deployed when saving. (Defaults to false.)
example:
{
"fsdeploy.nodes": [
{
"source":"/usr/code/project/",
"target":"/var/www/html/foo",
"include":"**/*.*",
"exclude":"**/min/*.*",
"deleteTargetOnDeploy": true,
"scp": {...}
}
],
"fsdeploy.deployOnSave": true,
"fsdeploy.deployWorkspaceOnSave": false
}
-
You can have multiple targets for the same source. Just add multiple nodes then with different targets which copy from the same source.
-
Adding include/exclude rules in the form of glob patterns
The pattern to match. e.g. **/*.js to match all JavaScript files or myFolder/** to match that folder with all children. Reference: * matches 0 or more characters ? matches 1 character ** matches zero or more directories [a-z] matches a range of characters {a,b} matches any of the patterns
example using extended glob:
Let's say you have following source structure
- opt
- usr
- projects
- foo
- templates
- main.html
- js
- main.js
- tests
- test.main.js
- src
- main.ts
- build
- combine.sh
index.html
and want it to end up in following target structre
- var
- www
- bar
- templates
- main.html
- js
- main.js
index.html
You would need to create a glob excluding src, build and /tests/:
{
"fsdeploy.nodes": [
{
"source":"/opt/usr/projects/foo",
"target":"/var/www/bar",
"exclude":"**/tests/**",
"include": "{templates,js}/**/*.*",
"deleteTargetOnDeploy": true
}
}
if the target system in unix, you can use scp to upload to the target. In this case the configuration for a node needs to be extended with the target host information and username/password: scp { host: "hostname", port: 22, username: "cpuser", password: "cppassword" }
scp doesn't support certificate authentication. It's recommended to have a user which has only write permissions to the desired remote folder used in the deploy binding. No read is required. scp doesn't allow deleteTargetOnDeploy right now
- fix compatibility issue of minimatch vs. native globe in fs-module (#16)
- minor code restructure
- fix progress bar when deploying entire workspace introduced in 0.1.10
- the single file deploy as well as the deployOnSave now considers the include/exclude globe pattern of the deploy binding (#8 (comment))
- minor bug fixes and replacing deprecated API calls
- added Remove target-folder before deploy workspace (saschamander)
- minor typo fix
- added deployWorkspaceOnSave functionality. (saschamander)
- add scp to upload to unix hosts
- minor bug fixes
- minor clean ups
- added relative path support from the workspace root. (greggbjensen)
- Updating builds and dependencies
- Moving from sync to async copy
- Adding configuration to package.json
- Don't remove leading/trailing slashes in pathes when building the effective subpaath
- Fixing path issues on non windows environments
- Adding configuration to stop auto-deploy on save
- Fixing NPE when accessing the status bar
- Fixing multiple issues to bring the extension to a more final stage
- Fixing dependencies
- Fixing issues in workspace deployment
- Minor fixes
- Minor fixes
- Added status bar icon whihc indicates if the current workspace has a deployment mapping
- Added status bar functions popping up after a click
- Some code streamlining
- Remove some annoying popup message
- Added "Deploy Workspace" command to deploy the entire workspace
- Added include/exclude config
- Only applies to "Deploy Workspace"
- Initial release