News for hackers. Stuff that matters.
Re:My deployment platform is a shell script by mattbuilds on Wednesday April 10, 2024 @09:04AM (#39990252)
It’s funny because in my many years of development I don’t think I’ve ever encounter a “mess of shell scripts” that was difficult to maintain. They were clear, did their job and if they needed to be replaced it was usually simple and straightforward.

Can’t say the same for whenever the new abstraction of the day comes along. In my experience what the OP is saying is exactly my experience. The abstractions get picked not because they are best but because they reduce liability.

Re:My deployment platform is a shell script by from-nibly on Wednesday April 10, 2024 @09:14AM (#39990337)
Hello. I have found the mess of shell scripts. Please don't do this.

I was able to deal with the weird skaffold mess by getting rid of it, and replacing it with argocd. I was able to get rid of jenkins by migrating to github actions. I have yet to replace the magic servers with magic bash scripts. They take just enough effort that i can't spend the time.

Use a tool i can google. If your bash script is really this straight forward and takes you from standard A to standard B, and it's in version control then bash is AMAZING. Please don't shove a rondom script that does a random thing on a random server.

Re:My deployment platform is a shell script by Danjoe4 on Wednesday April 10, 2024 @04:05PM (#39995157)
Bash is good but can grow out of control. The problem is solo engineers and managers who push/approve 500+ line bash scripts that do way too much. A good engineer will say it's getting too complicated and reimplement it in Python.
Re:My deployment platform is a shell script by ffsm8 on Wednesday April 10, 2024 @08:30PM (#39997209)
Wasn't there a rule about that?

Something like "in software development the only solution that sticks is the bad one, because the good ones will keep getting replaced until it's so bad, nobody can replace it anymore"

Re:My deployment platform is a shell script by kragen on Wednesday April 10, 2024 @09:52AM (#39990752)
i have encountered messes of shell scripts that were difficult to maintain; in my first sysadmin job in 01996 i inherited a version control system written as a bunch of csh scripts, built on top of rcs

but they were messy not because they lacked 'abstractions' but because they had far too many

i think shell scripts are significantly more bug-prone per line than programs in most other programming languages, but if the choice is hundreds of thousands of lines in an external dependency, or a ten-line or hundred-line shell script, it's easy for the shell script to be safer

Re:My deployment platform is a shell script by chasil on Wednesday April 10, 2024 @10:42AM (#39991240)
If it was in RCS, then you could directly move the archives under a CVSROOT and use them natively.

CVS had been out since Brian Berliner's version of 1989.

I actually moved a PVCS archive into RCS->CVS this way, and I'm still using it.

Re:My deployment platform is a shell script by kragen on Wednesday April 10, 2024 @03:51PM (#39995035)
that version control system provided a number of facilities cvs didn't (locking, and also a certain degree of integration with our build system permitting the various developers to only recompile the part of the system they were working on, which was important because recompiling the whole thing usually took me about a week, once a month), but it had never actually occurred to me that turning an rcs repository into a cvs repository like that was a possibility. also i never realized pvcs used rcs under the covers. thank you very much
Re:My deployment platform is a shell script by chasil on Wednesday April 10, 2024 @04:57PM (#39995637)
PVCS did not use the RCS format, but the RPM distribution included a perl script to convert the archives.

  $ rpm -ql cvs | grep pvcs
  /usr/share/cvs/contrib/pvcs2rcs
Re:My deployment platform is a shell script by kragen on Wednesday April 10, 2024 @05:45PM (#39996042)
ooh. that would have been very useful two jobs later when i got stuck with pvcs
Re:My deployment platform is a shell script by redman25 on Wednesday April 10, 2024 @09:53AM (#39990767)
Shell seems great until your tens of lines in googling every other line of obscure error-prone syntax.
Re:My deployment platform is a shell script by anonzzzies on Wednesday April 10, 2024 @01:21PM (#39993284)
… or maybe you are not proficient at shell scripting? I never had this issue, including large projects written in tcl, bash or perl in the 90s when it was more normal to do so.

The modern answer seems to be some kind of dsl with yaml syntax mixed with Unix (and thus bash) snippets which are often incredibly verbose and definitely not easier to read than a well written bash script. The only thing I think of when I see those great solutions is; another greenspun’s tenth rule in action.

Re:My deployment platform is a shell script by red-iron-pine on Wednesday April 10, 2024 @02:32PM (#39994132)
bash and other sh related approaches have a lot of "foot guns". python, or powershell, or even C++ are often easier to read and follow.

> are often incredibly verbose and definitely not easier to read than a well written bash script

define well written -- getting into no true scotsman here.

bash is fine for what it was and what it did, and i'm glad to know enough sed and awk to be dangerous, but it's a PITA unless we're forced to use it