Crates.io | dorc |
lib.rs | dorc |
version | 0.1.0 |
source | src |
created_at | 2021-08-12 02:46:49.877426 |
updated_at | 2021-08-16 15:50:33.508671 |
description | devin's orchestrator - a stupid deployment utility |
homepage | |
repository | https://github.com/dwbrite/dorc |
max_upload_size | |
id | 435031 |
size | 60,138 |
TODO: add badges
dorc
) - a stupid deployment utilitydorc
is a tool for deploying simple backend services with a green–blue strategy.
dorc
as it stands will only function on linux systems that use SystemD.
That's pretty much the only requirement.
dorc
!Binaries need to have a way to set which port they listen on (e.g., ./yourbin --port 8081
)
You may run into trouble if your software uses filesystem as permanent storage if that data is stored relative to the working directory.
That means you should be storing data in an external database, or a bucket, or in some absolute path like /etc/yourapp/data
.
If you need more (or different) functionality, use a more mainstream deployment tool like k8s or docker swarm.
dorc
To understand more about dorc
, we need to talk terminology.
An application includes a release directory and a release binary. This is the location you should upload files for your software.
Applications also consist of services (also referred to as subservices).
A service is a living version of your software.
Each application has two subservices: green-{app}
and blue-{app}
,
only one of which receives traffic at a given moment.
That is to say, one is considered active and the other is inactive.
dorc
services are also registered as SystemD services.
The daemon is a background process that:
With that out of the way, let's talk about how everything works in practice.
First you should configure your CI/CD workflow to upload a release to your server. You can see how I do that for my website here.
Install dorc
on your server.
It will be registered as a SystemD service that starts the daemon on boot.
If SystemD neglects to start the daemon on install, just run systemctl start dorc
.
You can run dorc register
to register an application and its subservices.
Once you've uploaded a new version of your software, dorc
will copy that to the inactive service.
Then you can call dorc switch {app}
to swap which subservice is considered active.
If you have any problems, simply call dorc switch {app}
again to roll-back to the previous version.
Happy deploying!
dorc
Just run cargo install dorc
! When you run a command with dorc
for the first time (e.g., dorc register
)
it will automatically install its SystemD service file, which you can start with systemctl start dorc
.