Re:Ask HN: What Python automation scripts do you reuse frequ...
by randjoe on Wednesday January 24, 2024 @11:57AM
(#39119621)
With python, it's more about simplifying the entire process (a.k.a. making it pythonic). In my experience, it tends to be a wrapping mechanism around some binary or api so it's hard to pin point "an exact script everyone runs". Some are clean up scripts that clear out caches manually (until a fix can be pushed), others (like this one https://gitlab.com/sunset-crew/nextrelease) wrap git so you don't need to remember all the things associated with pushing a release and/or tag. Ansible, though it's made in python it's kinda it's own langauge, might be a good place to look if you want scripts that are generic enough for everyone to use.
I've written for teams and myself.
[ Parent
| on HN ]
Re:Ask HN: What Python automation scripts do you reuse frequ...
by jimmyechan on Wednesday January 24, 2024 @12:23PM
(#39119917)
How do you usually trigger scripts? Do you do it via Ansible or manually via terminal?
Re:Ask HN: What Python automation scripts do you reuse frequ...
by cjohnson318 on Wednesday January 24, 2024 @01:50PM
(#39121162)
Not OP, but I usually trigger Python scripts from cron.
Re:Ask HN: What Python automation scripts do you reuse frequ...
by jimmyechan on Wednesday January 24, 2024 @02:36PM
(#39121690)
Is your cron running locally or do you have it set up on a server?
Re:Ask HN: What Python automation scripts do you reuse frequ...
by cjohnson318 on Friday January 26, 2024 @12:19PM
(#39145068)
I usually have cron jobs set up on servers for simple things.
If I'm doing large scale web development, I tend to use containers, so I'll use a scheduling mechanism appropriate for whatever framework I'm using. For example, if I'm building a Django application, then I use Celery.
There's always the tradeoff of just using the tools you get for free in a Linux distro, but paying the price of handling multiple DSLs, versus installing, configuring, and managing a larger system with a more homogenous interface.
Re:Ask HN: What Python automation scripts do you reuse frequ...
by randjoe on Thursday January 25, 2024 @01:29PM
(#39132851)
Both. Terminal, and some sort of automation. With Ansible, there's awx and semaphore. I think someone mentioned cronjobs, also systemd-timers. I think kubernetes has a cronjobs feature as well.