TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you manage one-off internal scripts?

11 点作者 rolandtshen将近 4 年前
For a recent project, I've found myself writing quite a few one off scripts for database adjustments, SQL queries for analytics, etc. I've been manually running them myself in the command line, but it's a very messy process. New team members also don't know what scripts are available and where to look. Anyone know of any tools, or have any workflows to better organize these scripts?

11 条评论

villasv将近 4 年前
If they were truly one-off, you wouldn&#x27;t need to manage them. Categorize and document. SQL queries for analytics go into something like Metabase. Database migrations go into git. Frequent adhoc scripts go into something like Jenkins so you can trigger them easily. So on and so forth. All of those documented somewhere, like the team&#x27;s Confluence&#x2F;Notion&#x2F;whatever.<p>But don&#x27;t just leave them at that, do work on eliminating their need. Sisyphean task but necessary nonetheless.
评论 #28178805 未加载
Jugurtha将近 4 年前
Add them to the repository and treat them like you would treat other code. Chances are, they&#x27;ll become some sort of tooling later when people tweak them, improve them, make them modular, generalize them.<p>We introduce many things that way. First it&#x27;s just a few commands that do something useful. Then included in the repo. Then tweak. Next thing you know there&#x27;s an endpoint with that functionality because it&#x27;s useful and frequently needed.
tcbasche将近 4 年前
The classic is the &#x2F;scripts directory in your codebase (presumably in VCS). The key is also to trawl through occasionally and remove anything that hasn&#x27;t been used in a while.
评论 #28189006 未加载
SirensOfTitan将近 4 年前
If it’s truly one-off (like codemods), I put the scripts in relevant tasks and diffs for reference.<p>…otherwise we just throw everything into a scripts directory. Keep it flat until it feels messy, then start organizing. All documentation must live with the code, otherwise it gets out of date too easily.
wizwit999将近 4 年前
Funnily, wasn&#x27;t there just a launch HN yesterday that helps with this: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28156461" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28156461</a><p>Oherwise, I just use git like others said but that can be suboptimal for non technical or semi technical users.
yokoprime将近 4 年前
If it&#x27;s one-off but has to be worked on for some time, with testing and whatnot it may be placed in a folder for maintenance scripts in the repo. Once it&#x27;s been executed it can be deleted from source control
marto1将近 4 年前
I mostly..don&#x27;t. For one liners, I keep them in a git controlled org-mode file. But for everything else it&#x27;s all over the place.
fiftyacorn将近 4 年前
I have a repo and raise a jira for each script and record any history or background. Then mark the git history against the jira.
MattGaiser将近 4 年前
At a prior company we added them to a folder of misc scripts along with notes on what they were for.<p>Not the greatest solution but it did ensure they never got lost.
评论 #28176399 未加载
willcipriano将近 4 年前
Find the closest related repo and add a scripts folder has been my approach.
deeteecee将近 4 年前
you could just put them in a repo