Development / Production Recommended Workflow?
Simon Harrison
info at simonh.uk
Thu Aug 19 14:52:13 UTC 2021
On Thu, 19 Aug 2021 07:33:03 -0700
Steve Fink <sphink at gmail.com> wrote:
> In a similar situation, I split my config files into published and
> unpublished portions. The main, unpublished config file has an include
> directive pulling in the published config file, which contains
> settings that are common between development and production.
>
> Often, I don't bother to version-control the unpublished config files.
> But when I do, I use a separate repository that I symlink to. So:
>
> main/
> shared-config.py
> config.py (symlink to ../configs/production.py)
> ...code...
> .hg/
>
> configs/
> production.py
> staging.py
> dev1.py
> dev2.py
> .hg/
>
>
> where `production.py` has some settings plus a directive `include
> "shared-config.py"`.
>
> This setup requires some sort of include directive. Or something
> similar: for my personal hgrc file, I have a published file at
> `https://hg.sr.ht/~sfink/sfink-tools/browse/conf/hgrc?rev=tip` (that I
> symlink to from ~/.hgrc) that omits keys and passwords and other
> personal configuration, and then I put the private stuff in
> `~/.config/hg/hgrc`. As far as I know, there are no include directives
> in hgrc files, but there is a list of paths that it will load so you
> can use one of them for the published stuff and another for the
> unpublished.
>
> This may not cover everything you need, but I would definitely use
> *some* setup to avoid shipping around patch files. It would make me
> nervous. It feels like it provides too many opportunities for subtle
> mistakes that would be hard to track down afterwards.
>
> Committing database snapshots with the code feels off to me too, but I
> don't personally have a good workflow around those so I won't comment.
>
Wow! That's some hgrc file. Thanks for the tips, I suppose it's the
same as with anything, when things get annoying we search for a "better
way."
To be fair, I'm quite comfortable with patching now. My workflow at the
moment is:
1. Change some stuff on localhost
2. hg diff > tip.patch
3. $ patch -p1 -i tip.patch (on server)
4. hg commit
5. Goto 1
Do you know how I can change step 3 to r123.patch? That's the only
thing bugging me at the moment.
Cheers.
--
Web: https://simonh.uk
Email: mail at simonh.uk
More information about the Mercurial
mailing list