mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(nix): add migrations
This commit is contained in:
parent
3c4644f3cc
commit
ae9d818f4b
2 changed files with 18 additions and 1 deletions
|
|
@ -8,10 +8,11 @@ use std::{
|
|||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let out_dir = env::var("OUT_DIR")?;
|
||||
let manifest_dir = env::var("CARGO_MANIFEST_DIR")?;
|
||||
let dest_path = Path::new(&out_dir).join("data.rs");
|
||||
let mut datafile = File::create(&dest_path)?;
|
||||
|
||||
let prefix = "../../../../../../crates/migrate/data";
|
||||
let prefix = manifest_dir + "/data";
|
||||
|
||||
let ct = fs::read_dir("data/migrations")?
|
||||
.filter(|p| {
|
||||
|
|
|
|||
16
flake.nix
16
flake.nix
|
|
@ -195,6 +195,22 @@
|
|||
# TODO: add liveness check
|
||||
ready_log_line = "Received Ready";
|
||||
};
|
||||
### migrations ###
|
||||
pluralkit-migrate-init = mkServiceInitProcess {
|
||||
name = "migrate";
|
||||
};
|
||||
pluralkit-migrate = {
|
||||
command = pkgs.writeShellApplication {
|
||||
name = "pluralkit-migrate";
|
||||
text = ''
|
||||
${sourceDotenv}
|
||||
set -x
|
||||
exec target/debug/migrate
|
||||
'';
|
||||
};
|
||||
depends_on.postgres.condition = "process_healthy";
|
||||
depends_on.pluralkit-migrate-init.condition = "process_completed_successfully";
|
||||
};
|
||||
### gateway ###
|
||||
pluralkit-gateway-init = mkServiceInitProcess {
|
||||
name = "gateway";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue