News for hackers. Stuff that matters.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by alfonsodev on Tuesday October 12, 2021 @10:57AM (#28840533)
a pattern I have seen before is to clone the branch commit of each release to a folder /var/releases/{release_commit} and then html is not a folder but a soft link so /var/www/html -> /var/releases/latest_release_commit this is useful if you need to revert back quickly. But then releases folder needs to be cleaned up, or you can run out of space.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by Sohcahtoa82 on Tuesday October 12, 2021 @11:19AM (#28840805)
That's dangerous unless you've properly configured your web server to block access to your .git directory.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by handrous on Tuesday October 12, 2021 @11:34AM (#28841016)
Safer/easier to keep the .git somewhere else entirely, rather than in the working directory. Git's got arguments that let you do that. Then you can check out to a dir that doesn't have the .git dir in it at all.

Alternatively, it's pretty easy to use git-archive (optionally, with an exclusions list to keep out files you don't want to serve publicly) to do something similar without ever cloning the remote repo. You can fetch a zip or tar.gz with a given commit's files, straight from a remote repo.