I'm running a home-grown dotnet core application on 18.04 LTS in an AWS load-balanced environment.
Right now, I have to expose SSH/SCP to a public IP to deploy application changes to each lb node in our CD environment, but it's kludgy at best, and doesn't scale well. I want to remove the public IP, and upload my latest code base to an EFS directory off a worker server, and then loop through the load-balanced servers, first removing it from the pool, then rebooting it, and when it's back online, add it back to the pool to continue serving traffic. What I'd like to do is, upon reboot and before the services configured using systemctl start up, wipe out the current application directories and copy the new codebase into those folders from the EFS instance, so when it starts up it's always using the most recent deployed version of the code base.
I know Linux/ Ubuntu "operationally" but not to the level of where I need to make changes of this sort, or how it should be done. Advice would be appreciated... or if it's a really bad idea, I'd like to know why (alternate suggestions would be welcome). Thanks!