Good day,
Using Visual Studio Publish, I would like to automate deployment of a Blazor Server app to my Ubuntu Linux VM. Currently, when I click Publish, my app is built and pushed via FTP to my VM. Unfortunately, this is only half the battle.
In the event that I have just uploaded new files for a new library or image (for example), the file permissions are not what I need. Any new files have permissions 700 and are owned by ftpuser:ftpuser. I now have to manually SSH into the VM and chown/chmod the new file(s) so that the Apache user (www-data) can pick them up, chown-ing them to ftpuser:www-data and chmod-ing them to 750 so that Apache can read and execute them.
Is there a method by which one might automate this process? There is this github project: https://github.com/albekov/dotnet-publish-ssh, but when I tried to put the command in a csproj Target running after a folder-level Publish, it seemed to get stuck in an infinite loop, restoring NuGet packages over and over until I cancelled the build process. In addition, it appears that there hasn't been any active development in several years, so I'm not optimistic about submitting an Issue.
I saw an article describing a method using WinSCP, but I haven't been able to find it, again. And I wasn't really thrilled with the idea of needing to run a bash script with sudo commands (though if that's what I need to do, that's what I need to do). Any assistance is appreciated.
I'm open to other ideas, as well. Linux is not a strong suit for me, so I probably don't know half of what I should to be able to figure this out on my own.