<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>darkr</author><text>Ideally you want some atomic deployment strategy, rather than having to deal with whatever crap might have been in the directory previously. Something like - extract your deployment artefact to a new, unique directory - and then read-only bind-mount that directory as &amp;#x2F;var&amp;#x2F;www&amp;#x2F;html.&lt;p&gt;&amp;gt; and probably very stupid) method is an Expect script that lets me supply a password to sudo.&lt;p&gt;The old school sysadmin way of doing this would be to have a dedicated deployment user (ssh pubkey auth only - possibly restricting only specific commands), with a sudoers[.d] configuration to allow that user to run an explicit group commands without a password (NOPASSWD)</text><parent_chain><item><author>gglitch</author><text>Naive question: what&amp;#x27;s the correct way of doing this when you need to cp your content to a dir like &amp;#x2F;var&amp;#x2F;www&amp;#x2F;html that your user doesn&amp;#x27;t own (when logging in as root is prohibited)? My &amp;quot;spooky&amp;quot; (and probably very stupid) method is an Expect script that lets me supply a password to sudo.</text></item><item><author>davedx</author><text>&amp;gt; spooky arcane oldhat sysadmin deploy techniques (scp release to prod hosts, run deploy script&lt;p&gt;I never realised I was using spooky arcane oldhat stuff! I feel wizardly now.&lt;p&gt;My projects (for small clients and myself) basically use this.&lt;p&gt;- A &amp;quot;build.sh&amp;quot; script that does a local build of back end and front end&lt;p&gt;- A &amp;quot;deploy.sh&amp;quot; script that scp&amp;#x27;s everything to the server (either a digital ocean VPS or an EC2 instance), runs npm install, runs database migrations and restarts with pm2&lt;p&gt;So running my entire CI pipeline in terminal is: .&amp;#x2F;build.sh &amp;amp;&amp;amp; .&amp;#x2F;deploy.sh</text></item><item><author>malwrar</author><text>Not a solo founder, but I do a lot of ops professionally. Unless you have a specific reason, I say it’s best to avoid complicated tooling until later.&lt;p&gt;k8s, ci, etc are all really useful and solve a lot of hard problems, but god are they a bitch to set up and then monitor, fix when something weird happens, secure from nasty people outside, patch when some update becomes necessary, resist the urge to “improve”, etc. This doesn’t include the time it takes to work these tools into your project, like k8s for example really requires you grok its model of how stuff it runs is supposed to look. There’s a reason entire companies exist that simply offer managed versions of these services!&lt;p&gt;If you’re using fewer than like 10 boxes and don’t work with many people, you can get away with spooky arcane oldhat sysadmin deploy techniques (scp release to prod hosts, run deploy script, service or cron to keep running) and honestly it’s pretty fun to just run a command and poof you’re deployed. Then you can just wait until it starts making sense to use fancier tooling (more load, more sites&amp;#x2F;DCs, more services, more people&amp;#x2F;teams, etc). Monitoring is always good to start with, for other stuff a  good litmus test is that price points for hosted k8s &amp;amp; ops stuff will start to make sense, you’ll be paying in time in any case. Who knows, maybe when that happens something new will pop up that makes even more sense. Until then, reducing the amount of stuff you need to worry about is always a good strategy.</text></item></parent_chain></comment><story><title>Ask HN: Solo-preneurs, how do you DevOps to save time?</title><text>When you&amp;#x27;re 1 man show (or tiny team) working on some web oriented application beyond POC level and beyond heroku (for whatever reason) — managing  your CI, deployments&amp;#x2F;rollbacks, DBs etc. looks like a nightmare to me.&lt;p&gt;Just properly setting up and maintaining a small k8s cluster looks almost like a fulltime job.&lt;p&gt;I wonder how do your CI, deployment workflows look like?&lt;p&gt;Any particular tools, practices, guidelines, architecture patterns to reduce pain &amp;amp; timewaste?&lt;p&gt;How do you CI =&amp;gt; deploy&amp;#x2F;rollback stateless instances?
How do you manage your DBs and backups?
Etc.</text></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>quells</author><text>Usually these directories are owned by another group (www or www-data) so that your web server program (nginx, apache, etc) can access them without running as root. If you add your user to that group, you should be able to manage files in your web root without sudo. Be careful with permissions, though - you may need to chown to set the group after copying so that the files are readable by your web server.</text><parent_chain><item><author>gglitch</author><text>Naive question: what&amp;#x27;s the correct way of doing this when you need to cp your content to a dir like &amp;#x2F;var&amp;#x2F;www&amp;#x2F;html that your user doesn&amp;#x27;t own (when logging in as root is prohibited)? My &amp;quot;spooky&amp;quot; (and probably very stupid) method is an Expect script that lets me supply a password to sudo.</text></item><item><author>davedx</author><text>&amp;gt; spooky arcane oldhat sysadmin deploy techniques (scp release to prod hosts, run deploy script&lt;p&gt;I never realised I was using spooky arcane oldhat stuff! I feel wizardly now.&lt;p&gt;My projects (for small clients and myself) basically use this.&lt;p&gt;- A &amp;quot;build.sh&amp;quot; script that does a local build of back end and front end&lt;p&gt;- A &amp;quot;deploy.sh&amp;quot; script that scp&amp;#x27;s everything to the server (either a digital ocean VPS or an EC2 instance), runs npm install, runs database migrations and restarts with pm2&lt;p&gt;So running my entire CI pipeline in terminal is: .&amp;#x2F;build.sh &amp;amp;&amp;amp; .&amp;#x2F;deploy.sh</text></item><item><author>malwrar</author><text>Not a solo founder, but I do a lot of ops professionally. Unless you have a specific reason, I say it’s best to avoid complicated tooling until later.&lt;p&gt;k8s, ci, etc are all really useful and solve a lot of hard problems, but god are they a bitch to set up and then monitor, fix when something weird happens, secure from nasty people outside, patch when some update becomes necessary, resist the urge to “improve”, etc. This doesn’t include the time it takes to work these tools into your project, like k8s for example really requires you grok its model of how stuff it runs is supposed to look. There’s a reason entire companies exist that simply offer managed versions of these services!&lt;p&gt;If you’re using fewer than like 10 boxes and don’t work with many people, you can get away with spooky arcane oldhat sysadmin deploy techniques (scp release to prod hosts, run deploy script, service or cron to keep running) and honestly it’s pretty fun to just run a command and poof you’re deployed. Then you can just wait until it starts making sense to use fancier tooling (more load, more sites&amp;#x2F;DCs, more services, more people&amp;#x2F;teams, etc). Monitoring is always good to start with, for other stuff a  good litmus test is that price points for hosted k8s &amp;amp; ops stuff will start to make sense, you’ll be paying in time in any case. Who knows, maybe when that happens something new will pop up that makes even more sense. Until then, reducing the amount of stuff you need to worry about is always a good strategy.</text></item></parent_chain></comment><story><title>Ask HN: Solo-preneurs, how do you DevOps to save time?</title><text>When you&amp;#x27;re 1 man show (or tiny team) working on some web oriented application beyond POC level and beyond heroku (for whatever reason) — managing  your CI, deployments&amp;#x2F;rollbacks, DBs etc. looks like a nightmare to me.&lt;p&gt;Just properly setting up and maintaining a small k8s cluster looks almost like a fulltime job.&lt;p&gt;I wonder how do your CI, deployment workflows look like?&lt;p&gt;Any particular tools, practices, guidelines, architecture patterns to reduce pain &amp;amp; timewaste?&lt;p&gt;How do you CI =&amp;gt; deploy&amp;#x2F;rollback stateless instances?
How do you manage your DBs and backups?
Etc.</text></story>