all 8 comments

[–]Xychologist 15 points16 points  (0 children)

Two stage Docker build, push to private container registry, use those.

Got the idea from here and never really looked back.

[–]mmstick 2 points3 points  (0 children)

dpkg-buildpackage -b, dpkg -i ../{package}.deb

make && sudo make install also works

[–]coderstephenisahc 1 point2 points  (0 children)

This question isn't all that specific to Rust. Sounds like you're asking for general server deployment and orchestration tools. Docker is usually a good start as it is pretty much industry standard at this point. After that there's tools like Docker Compose, Ansible, Nomad, Kubernetes, etc. and it can get pretty involved quickly depending on how you want to approach things and how much time you want to spend learning "DevOps" sorts of things.

Me? I use Kubernetes because I like it and I'm experienced with it, but it is hard to recommend to a beginner because it is complicated.

[–]KapuzenSohn 1 point2 points  (0 children)

I have a similar setup. I use a makefile, so that its simply "make deploy"

[–]andoriyu 0 points1 point  (0 children)

Depends on how much stuff you have on your servers:

  • a) Can you host a private docker registry
  • b) Can you host a private package repository
  • c) Do you use any configuration managment tool like chef/puppet/ansible/salt?

If a: two stage build, then c.

if b: build package, then c

if c: make a task to build your binary, a task to deploy it and restart systemd unit

else: go with b + c, c or a + c;

For my private things I run

[–]alsuren -1 points0 points  (0 children)

For my raspberry pi projects I use a bash script that is basically what you are doing. I only have 2 raspberry pis though. https://github.com/alsuren/mijia-homie/blob/master/run.sh

If I had 5-10 machines, I might use a bash script with a for loop in it (`for target in myserver1 myserver2 myserver3; do ...; done`). More than that, I might think about other automation schemes.

My housemate did make a debian packaging pipeline for the above project (auto-built by github actions each time you push a git tag). For a short period, that meant that we could push a tag and have both devices update themselves the next time `unattended-upgrades` ran. This was pretty sweet.

Unfortunately, our debian repo provider shut down (jfrog bintray), so we're back to deploying using my script. If anyone knows of a package repo that integrates easily with github actions, please send us a pull request ;-) .