Re:CapRover: Build your own PaaS
by xu6ahb8E on Tuesday June 09, 2020 @07:22AM
(#23465591)
Here is an example of post-receive script I use for that:
[ Parent
| on HN ]
You should at least use `set -u` in this script, otherwise, at some point, you'll fail to set $APP and end up running:
rm -rf /home/username/apps/
Guess how I learned this lesson? :)Ooooh, I need to start documenting my war stories. They'll make for a fun read at some point years down the line.
FYI, you can avoid the $APP directory removal and clone by doing:
GIT_WORK_TREE=/home/username/apps/$APP git checkout masterYes, that's true, thanks for mentioning it. It comes from a time when I did not use docker so I wanted to get rid of build artifacts, but building within docker, this is not a problem anymore.