I’m using Deploy extension in VS-CODE to deploy a published ASP.NET Core Angular app straight to the production server via SFTP.
Everything runs smoothly except for one thing. In my settings.json in VS Code I make the appropriate arrangements as stated by Marcel Kloubert here.
{ "deploy": { "packages": [ { "name": "JTrade Master Publish", "description": "Package version 1.0.0", "files": [ "/bin/Debug/netcoreapp1.1/publish/*" ], "deployOnSave": false } ], "targets": [ { "type": "sftp", "name": "prod", "description": "JTrade Production version", "dir": "/var/testdeploy", "host": "139.162.216.36", "port": 22, "user": "root", "password": "*************" } ] } }
So this is the path to the folder where all the files I need are located on my hard drive localy: “/bin/Debug/netcoreapp1.1/publish/* ” and I set in the “files” setting above.
This is the directory on the server “dir”: “/var/testdeploy” where I want everything to be at.
SO, the transfer goes fine, but I get this:
/var/testdeploy/bin/Debug/netcoreapp1.1/publish/all my files here
and I want
/var/testdeploy/all my files here
Has anyone experienced this kind of issue? Thanks.
Advertisement
Answer
Take a look at the mappings section of the wiki to remap source directories to output directories. In your case, you need to add this to your targets:
"mappings": [{ "source": "/bin/Debug/netcoreapp1.1/publish", "target": "/" }]