Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: How do you Version Control your Scripts?
1 point by nickster on Nov 2, 2022 | hide | past | favorite | 3 comments
I have about Two Dozen Scripts in a Legacy Centralized Version Control System and looking to move towards GIT but a lot of the scripts need to be deployed at Different times so the usual branching schemes don't work without a lot of manual intervention. Git with SubModules look like they would work but would become a headache eventually. I guess what are people doing for Script Management?



Separate version control from deployment. I don’t feel sure I understand the problem from your description: what does “a lot of the scripts need to be deployed at different times” mean, and what does that have to do with branching?


In our software development we tag a git branch and code gets compiled and deployed and we would like to synchronize those systems.

The scripts might involve a change to how a user is added to the system and another might be a change for how a user is updated. The "update user" script cannot be deployed until the "add user" script is deployed.


Again, version control does not imply any particular deployment process, and deployment does not imply when scripts (or any code) gets executed. If you have all of these things mixed together -- version control, build/deploy, and execute -- then you should look at how you can separate those into discrete tasks so script A can't get run before script B. Preventing code execution dependencies like A must run before B shouldn't have anything to do with your version control system.

Your version control and deployment processes should move your applications from one working state to another working state. Temporal runtime dependencies such as "A must run before B" should get handled at run time, either by making A execute B when it successfully finishes, or writing a higher-level script that runs them in order only if both exist.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: