Live data from Hacker News

My deployment platform is a shell script

j3s.sh

1–10 of 141 posts

Re: My deployment platform is a shell script

#5
I have a very similar system[1] for my personal projects, only I use GitHub actions to push a docker image to ECR and a commit to a config repo bumping the tag. I then have a cronjob to pull the config repo and reconcile using docker compose.

I wouldn't use it for serious stuff, but it's been working great for my random personal projects (biggest gap is if something crashes it'll stay crashed until manual intervention currently)

- [1] https://github.com/mnahkies/shoe-string-server/pull/2

Re: My deployment platform is a shell script

#8

Can someone ELI5 what he said in the blog post please? What does the script do?

The script does a git fetch

If the current code is behind (there are new commits), it merges them. If it fails, it stops.

If not, it runs `go build`. If it fails, it stops.

If not, it moves the binary to the right location and restarts the service.

Re: My deployment platform is a shell script

#9
Not to deride this (too much), but the 'robustness' of deployments with shell scripts is tempting bait. Things are until they aren't, 'nobody rides for free' - decide what you're willing to pay.

Example: this interprets the output of 'ls'. Reliability is dependent on good quoting/never introducing a project with spaces

Ansible is a nice middle ground, personally. I write the state that differs, use a library of scripting.

Re: My deployment platform is a shell script

#10

Not to deride this (too much), but the 'robustness' of deployments with shell scripts is tempting bait. Things are until they aren't, 'nobody rides for free' - decide what you're willing to pay. Example: this interprets the output of 'ls' . Reliability is dependent on good quoting/never introducing a project with spaces Ansible is a nice middle ground, personally. I write the state that differs, use a library of scri…

Or a project name that overlaps an init.d script they'd prefer to have kept

It also doesn't fail immediately if many of the commands fail (instead blindly moves on to the next statement). Consider using bash and these options: https://github.com/kvz/bash3boilerplate/blob/main/main.sh#L1... for most scripts.

Post reply on HN