@@ -8,7 +8,7 @@ use std::io::{stdin, stdout, Write};
8
8
9
9
use clap:: Clap ;
10
10
11
- use deploy :: { DeployFlake , ParseFlakeError } ;
11
+ use yeet :: { DeployFlake , ParseFlakeError } ;
12
12
use futures_util:: stream:: { StreamExt , TryStreamExt } ;
13
13
use log:: { debug, error, info, warn} ;
14
14
use serde:: Serialize ;
@@ -169,9 +169,9 @@ enum GetDeploymentDataError {
169
169
/// Evaluates the Nix in the given `repo` and return the processed Data from it
170
170
async fn get_deployment_data (
171
171
supports_flakes : bool ,
172
- flakes : & [ deploy :: DeployFlake < ' _ > ] ,
172
+ flakes : & [ yeet :: DeployFlake < ' _ > ] ,
173
173
extra_build_args : & [ String ] ,
174
- ) -> Result < Vec < deploy :: data:: Data > , GetDeploymentDataError > {
174
+ ) -> Result < Vec < yeet :: data:: Data > , GetDeploymentDataError > {
175
175
futures_util:: stream:: iter ( flakes) . then ( |flake| async move {
176
176
177
177
info ! ( "Evaluating flake in {}" , flake. repo) ;
@@ -273,9 +273,9 @@ struct PromptPart<'a> {
273
273
274
274
fn print_deployment (
275
275
parts : & [ (
276
- & deploy :: DeployFlake < ' _ > ,
277
- deploy :: DeployData ,
278
- deploy :: DeployDefs ,
276
+ & yeet :: DeployFlake < ' _ > ,
277
+ yeet :: DeployData ,
278
+ yeet :: DeployDefs ,
279
279
) ] ,
280
280
) -> Result < ( ) , toml:: ser:: Error > {
281
281
let mut part_map: HashMap < String , HashMap < String , PromptPart > > = HashMap :: new ( ) ;
@@ -316,9 +316,9 @@ enum PromptDeploymentError {
316
316
317
317
fn prompt_deployment (
318
318
parts : & [ (
319
- & deploy :: DeployFlake < ' _ > ,
320
- deploy :: DeployData ,
321
- deploy :: DeployDefs ,
319
+ & yeet :: DeployFlake < ' _ > ,
320
+ yeet :: DeployData ,
321
+ yeet :: DeployDefs ,
322
322
) ] ,
323
323
) -> Result < ( ) , PromptDeploymentError > {
324
324
print_deployment ( parts) ?;
@@ -369,39 +369,39 @@ fn prompt_deployment(
369
369
#[ derive( Error , Debug ) ]
370
370
enum RunDeployError {
371
371
#[ error( "Failed to deploy profile: {0}" ) ]
372
- DeployProfile ( #[ from] deploy :: deploy:: DeployProfileError ) ,
372
+ DeployProfile ( #[ from] yeet :: deploy:: DeployProfileError ) ,
373
373
#[ error( "Failed to push profile: {0}" ) ]
374
- PushProfile ( #[ from] deploy :: push:: PushProfileError ) ,
374
+ PushProfile ( #[ from] yeet :: push:: PushProfileError ) ,
375
375
#[ error( "No profile named `{0}` was found" ) ]
376
376
ProfileNotFound ( String ) ,
377
377
#[ error( "No node named `{0}` was found" ) ]
378
378
NodeNotFound ( String ) ,
379
379
#[ error( "Profile was provided without a node name" ) ]
380
380
ProfileWithoutNode ,
381
381
#[ error( "Error processing deployment definitions: {0}" ) ]
382
- DeployDataDefs ( #[ from] deploy :: DeployDataDefsError ) ,
382
+ DeployDataDefs ( #[ from] yeet :: DeployDataDefsError ) ,
383
383
#[ error( "Failed to make printable TOML of deployment: {0}" ) ]
384
384
TomlFormat ( #[ from] toml:: ser:: Error ) ,
385
385
#[ error( "{0}" ) ]
386
386
PromptDeployment ( #[ from] PromptDeploymentError ) ,
387
387
#[ error( "Failed to revoke profile: {0}" ) ]
388
- RevokeProfile ( #[ from] deploy :: deploy:: RevokeProfileError ) ,
388
+ RevokeProfile ( #[ from] yeet :: deploy:: RevokeProfileError ) ,
389
389
}
390
390
391
391
type ToDeploy < ' a > = Vec < (
392
- & ' a deploy :: DeployFlake < ' a > ,
393
- & ' a deploy :: data:: Data ,
394
- ( & ' a str , & ' a deploy :: data:: Node ) ,
395
- ( & ' a str , & ' a deploy :: data:: Profile ) ,
392
+ & ' a yeet :: DeployFlake < ' a > ,
393
+ & ' a yeet :: data:: Data ,
394
+ ( & ' a str , & ' a yeet :: data:: Node ) ,
395
+ ( & ' a str , & ' a yeet :: data:: Profile ) ,
396
396
) > ;
397
397
398
398
async fn run_deploy (
399
- deploy_flakes : Vec < deploy :: DeployFlake < ' _ > > ,
400
- data : Vec < deploy :: data:: Data > ,
399
+ deploy_flakes : Vec < yeet :: DeployFlake < ' _ > > ,
400
+ data : Vec < yeet :: data:: Data > ,
401
401
supports_flakes : bool ,
402
402
check_sigs : bool ,
403
403
interactive : bool ,
404
- cmd_overrides : & deploy :: CmdOverrides ,
404
+ cmd_overrides : & yeet :: CmdOverrides ,
405
405
keep_result : bool ,
406
406
result_path : Option < & str > ,
407
407
extra_build_args : & [ String ] ,
@@ -438,7 +438,7 @@ async fn run_deploy(
438
438
None => return Err ( RunDeployError :: NodeNotFound ( node_name. to_owned ( ) ) ) ,
439
439
} ;
440
440
441
- let mut profiles_list: Vec < ( & str , & deploy :: data:: Profile ) > = Vec :: new ( ) ;
441
+ let mut profiles_list: Vec < ( & str , & yeet :: data:: Profile ) > = Vec :: new ( ) ;
442
442
443
443
for profile_name in [
444
444
node. node_settings . profiles_order . iter ( ) . collect ( ) ,
@@ -469,7 +469,7 @@ async fn run_deploy(
469
469
let mut l = Vec :: new ( ) ;
470
470
471
471
for ( node_name, node) in & data. nodes {
472
- let mut profiles_list: Vec < ( & str , & deploy :: data:: Profile ) > = Vec :: new ( ) ;
472
+ let mut profiles_list: Vec < ( & str , & yeet :: data:: Profile ) > = Vec :: new ( ) ;
473
473
474
474
for profile_name in [
475
475
node. node_settings . profiles_order . iter ( ) . collect ( ) ,
@@ -511,13 +511,13 @@ async fn run_deploy(
511
511
. collect ( ) ;
512
512
513
513
let mut parts: Vec < (
514
- & deploy :: DeployFlake < ' _ > ,
515
- deploy :: DeployData ,
516
- deploy :: DeployDefs ,
514
+ & yeet :: DeployFlake < ' _ > ,
515
+ yeet :: DeployData ,
516
+ yeet :: DeployDefs ,
517
517
) > = Vec :: new ( ) ;
518
518
519
519
for ( deploy_flake, data, ( node_name, node) , ( profile_name, profile) ) in to_deploy {
520
- let deploy_data = deploy :: make_deploy_data (
520
+ let deploy_data = yeet :: make_deploy_data (
521
521
& data. generic_settings ,
522
522
node,
523
523
node_name,
@@ -540,7 +540,7 @@ async fn run_deploy(
540
540
}
541
541
542
542
for ( deploy_flake, deploy_data, deploy_defs) in & parts {
543
- deploy :: push:: push_profile ( deploy :: push:: PushProfileData {
543
+ yeet :: push:: push_profile ( yeet :: push:: PushProfileData {
544
544
supports_flakes,
545
545
check_sigs,
546
546
repo : deploy_flake. repo ,
@@ -553,14 +553,14 @@ async fn run_deploy(
553
553
. await ?;
554
554
}
555
555
556
- let mut succeeded: Vec < ( & deploy :: DeployData , & deploy :: DeployDefs ) > = vec ! [ ] ;
556
+ let mut succeeded: Vec < ( & yeet :: DeployData , & yeet :: DeployDefs ) > = vec ! [ ] ;
557
557
558
558
// Run all deployments
559
559
// In case of an error rollback any previoulsy made deployment.
560
560
// Rollbacks adhere to the global seeting to auto_rollback and secondary
561
561
// the profile's configuration
562
562
for ( _, deploy_data, deploy_defs) in & parts {
563
- if let Err ( e) = deploy :: deploy:: deploy_profile ( deploy_data, deploy_defs, dry_activate) . await
563
+ if let Err ( e) = yeet :: deploy:: deploy_profile ( deploy_data, deploy_defs, dry_activate) . await
564
564
{
565
565
error ! ( "{}" , e) ;
566
566
if dry_activate {
@@ -573,7 +573,7 @@ async fn run_deploy(
573
573
// the command line)
574
574
for ( deploy_data, deploy_defs) in & succeeded {
575
575
if deploy_data. merged_settings . auto_rollback . unwrap_or ( true ) {
576
- deploy :: deploy:: revoke ( * deploy_data, * deploy_defs) . await ?;
576
+ yeet :: deploy:: revoke ( * deploy_data, * deploy_defs) . await ?;
577
577
}
578
578
}
579
579
}
@@ -588,17 +588,17 @@ async fn run_deploy(
588
588
#[ derive( Error , Debug ) ]
589
589
enum RunError {
590
590
#[ error( "Failed to deploy profile: {0}" ) ]
591
- DeployProfile ( #[ from] deploy :: deploy:: DeployProfileError ) ,
591
+ DeployProfile ( #[ from] yeet :: deploy:: DeployProfileError ) ,
592
592
#[ error( "Failed to push profile: {0}" ) ]
593
- PushProfile ( #[ from] deploy :: push:: PushProfileError ) ,
593
+ PushProfile ( #[ from] yeet :: push:: PushProfileError ) ,
594
594
#[ error( "Failed to test for flake support: {0}" ) ]
595
595
FlakeTest ( std:: io:: Error ) ,
596
596
#[ error( "Failed to check deployment: {0}" ) ]
597
597
CheckDeployment ( #[ from] CheckDeploymentError ) ,
598
598
#[ error( "Failed to evaluate deployment data: {0}" ) ]
599
599
GetDeploymentData ( #[ from] GetDeploymentDataError ) ,
600
600
#[ error( "Error parsing flake: {0}" ) ]
601
- ParseFlake ( #[ from] deploy :: ParseFlakeError ) ,
601
+ ParseFlake ( #[ from] yeet :: ParseFlakeError ) ,
602
602
#[ error( "Error initiating logger: {0}" ) ]
603
603
Logger ( #[ from] flexi_logger:: FlexiLoggerError ) ,
604
604
#[ error( "{0}" ) ]
@@ -608,10 +608,10 @@ enum RunError {
608
608
async fn run ( ) -> Result < ( ) , RunError > {
609
609
let opts: Opts = Opts :: parse ( ) ;
610
610
611
- deploy :: init_logger (
611
+ yeet :: init_logger (
612
612
opts. debug_logs ,
613
613
opts. log_dir . as_deref ( ) ,
614
- deploy :: LoggerType :: Deploy ,
614
+ yeet :: LoggerType :: Deploy ,
615
615
) ?;
616
616
617
617
let deploys = opts
@@ -621,10 +621,10 @@ async fn run() -> Result<(), RunError> {
621
621
622
622
let deploy_flakes: Vec < DeployFlake > = deploys
623
623
. iter ( )
624
- . map ( |f| deploy :: parse_flake ( f. as_str ( ) ) )
624
+ . map ( |f| yeet :: parse_flake ( f. as_str ( ) ) )
625
625
. collect :: < Result < Vec < DeployFlake > , ParseFlakeError > > ( ) ?;
626
626
627
- let cmd_overrides = deploy :: CmdOverrides {
627
+ let cmd_overrides = yeet :: CmdOverrides {
628
628
ssh_user : opts. ssh_user ,
629
629
profile_user : opts. profile_user ,
630
630
ssh_opts : opts. ssh_opts ,
0 commit comments