vs-deploy
vs-deploy copied to clipboard
Deploy using sftp sync
netcore has a load of larger dependencies that don't often change in my app. Does this extension do sync?
eg only copy newer
Im sorry I dont understand
You also can set deployOnChange to (true), what means, that you have to setup deployOnSave property. If you DO NOT set useTargetList to (true), you have to setup deployOnSave property.
@mikes-gh
Oh, thats right ... I must find a much better description for that.
- if you set
deployOnChange
to(true)
, it will use the same targets for deploying asdeployOnSave
and watches for changes in files, you have defined in your package - in a package, you can define an explicit target list (by setting up
targets
setting)... to use this explicit target list, you have to setuseTargetList
to(true)
Where are the files, that should be deployed when they change, inside your project?
Maybe I can create an example for you.
Im sorry its still very confusing for me.
deployOnChange seems the same as deployOnSave to me.
Could you explain the difference.
I am after a folder comparison (like rsync) and only deploy files that are different.
@mikes-gh
Ah, OK.
"onSave" and "onChange" are two different kind of events.
"onSave" is explicit: The event is only fired, when you have an open document and you use the save command (e.g. CTRL + S
) for it ... s. onDidSaveTextDocument
of vscode API ... if that file is part of one of your packages, a deployment will be started for it
"onChange" is implicit: There is a FileSystemWatcher, very similar to .NET, that watches for all changes inside your workspace ... in that case it is not important if you or a separate service, like a C# compiler, changes files ... if there is now a file that is part of one of your packages, a deployment will be started for it
Both events run parallel. They do not care what the other does.
What you have to keep in mind for files that fits both events: If you save a document in your editor: on the one hand "onSave" is fired, because you used the "save" command of VSCode ... AND parallel the file system watcher for "onChange" is fired
Thanks for clear explanation
This bit of code looks good to use
https://github.com/robogeek/node-ssh2sync
@mkloubert make a exemple for me! I trying with this code but onlu manual (right click menu) deploy works. On save and On Change dont works. Whats wrong in my code? my settings.json file:
{
"deploy": {
"packages": [
{
"name": "Vallefrutas Odin Theme",
"deployOnChange": {
"files": [
"/assets/**/**/**"
],
"exclude": [
"/**/*.less",
"/**/*.ts"
],
"useTargetList": true
},
"deployOnSave": true,
"targets": [ "Vallefrutas AWS EC2t" ],
"files": [
"**/**/**/**/**/**/**/**/**"
]
}
],
"targets": [
{
"name": "Vallefrutas AWS EC2",
"type": "sftp",
"description": "A WP Theme folder on AWS EC2 instance for vallefrutas.com.br site",
"dir": "/var/www/vallefrutas.com.br/wp-content/themes/odin/",
"host": "ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com",
"port": 22,
"user": "ubuntu",
"privateKey": "B:\\Users\\Adson\\Web\\AWS\\keypair\\vallefrutas-aws.pem",
"closing": [
"sudo chown -R www-data:www-data /var/www/vallefrutas.com.br/wp-content/themes/odin"
],
"ignore": [
"/.vscode/**/*",
"/.git/**/*",
"/src",
"/src/**/*",
"/node_modules",
"/node_modules/**/*",
"/.remote-sync.json",
"/.DS_Store",
"/Thumbs.db",
"/desktop.ini",
"/*.md",
"/gulpfile.js",
"/yarn.lock",
"/package.json",
"/.gitignore",
"/.bowerrc",
"/bower.json",
"/*.zip",
"/*.tar.gz",
"/*.sublime-project",
"/*.sublime-workspace",
"/.ftppass"
]
}
]
}
}
@AdsonCicilioti
You have a typo in your target list of your package:
You defined Vallefrutas AWS EC2t
, but your target is called Vallefrutas AWS EC2
(without the ending t
). The mistake in your settings is, that the 'deploy on change / save' feature cannot find your target. This is the reason why it only works manually (from menu or command list).
On the other hand, the ignore
property must be defined as direct child of deploy
.
Try this config:
{
"deploy": {
"packages": [
{
"name": "Vallefrutas Odin Theme",
"deployOnChange": {
"files": [
"/assets/**/**/**"
],
"exclude": [
"/**/*.less",
"/**/*.ts"
],
"useTargetList": true
},
"deployOnSave": true,
"targets": [ "Vallefrutas AWS EC2" ],
"files": [
"**/**/**/**/**/**/**/**/**"
]
}
],
"targets": [
{
"name": "Vallefrutas AWS EC2",
"type": "sftp",
"description": "A WP Theme folder on AWS EC2 instance for vallefrutas.com.br site",
"dir": "/var/www/vallefrutas.com.br/wp-content/themes/odin/",
"host": "ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com",
"port": 22,
"user": "ubuntu",
"privateKey": "B:\\Users\\Adson\\Web\\AWS\\keypair\\vallefrutas-aws.pem",
"closing": [
"sudo chown -R www-data:www-data /var/www/vallefrutas.com.br/wp-content/themes/odin"
]
}
],
"ignore": [
"/.vscode/**/*",
"/.git/**/*",
"/src",
"/src/**/*",
"/node_modules",
"/node_modules/**/*",
"/.remote-sync.json",
"/.DS_Store",
"/Thumbs.db",
"/desktop.ini",
"/*.md",
"/gulpfile.js",
"/yarn.lock",
"/package.json",
"/.gitignore",
"/.bowerrc",
"/bower.json",
"/*.zip",
"/*.tar.gz",
"/*.sublime-project",
"/*.sublime-workspace",
"/.ftppass"
]
}
}
Nothing yet. Now it does not even work manually.
Showing this errors with a high cpu core ... @mkloubert Any idea?