@@ -10,7 +10,7 @@ use clap::{ArgMatches, Clap, FromArgMatches};
10
10
11
11
use crate as deploy;
12
12
13
- use self :: deploy:: { DeployFlake , ParseFlakeError , settings} ;
13
+ use self :: deploy:: { data , settings} ;
14
14
use futures_util:: stream:: { StreamExt , TryStreamExt } ;
15
15
use log:: { debug, error, info, warn} ;
16
16
use serde:: Serialize ;
@@ -168,7 +168,7 @@ pub enum GetDeploymentDataError {
168
168
/// Evaluates the Nix in the given `repo` and return the processed Data from it
169
169
async fn get_deployment_data (
170
170
supports_flakes : bool ,
171
- flakes : & [ deploy :: DeployFlake < ' _ > ] ,
171
+ flakes : & [ data :: DeployFlake < ' _ > ] ,
172
172
extra_build_args : & [ String ] ,
173
173
) -> Result < Vec < settings:: Root > , GetDeploymentDataError > {
174
174
futures_util:: stream:: iter ( flakes) . then ( |flake| async move {
@@ -272,9 +272,9 @@ struct PromptPart<'a> {
272
272
273
273
fn print_deployment (
274
274
parts : & [ (
275
- & deploy :: DeployFlake < ' _ > ,
276
- deploy :: DeployData ,
277
- deploy :: DeployDefs ,
275
+ & data :: DeployFlake < ' _ > ,
276
+ data :: DeployData ,
277
+ data :: DeployDefs ,
278
278
) ] ,
279
279
) -> Result < ( ) , toml:: ser:: Error > {
280
280
let mut part_map: HashMap < String , HashMap < String , PromptPart > > = HashMap :: new ( ) ;
@@ -315,9 +315,9 @@ pub enum PromptDeploymentError {
315
315
316
316
fn prompt_deployment (
317
317
parts : & [ (
318
- & deploy :: DeployFlake < ' _ > ,
319
- deploy :: DeployData ,
320
- deploy :: DeployDefs ,
318
+ & data :: DeployFlake < ' _ > ,
319
+ data :: DeployData ,
320
+ data :: DeployDefs ,
321
321
) ] ,
322
322
) -> Result < ( ) , PromptDeploymentError > {
323
323
print_deployment ( parts) ?;
@@ -378,7 +378,7 @@ pub enum RunDeployError {
378
378
#[ error( "Profile was provided without a node name" ) ]
379
379
ProfileWithoutNode ,
380
380
#[ error( "Error processing deployment definitions: {0}" ) ]
381
- DeployDataDefs ( #[ from] deploy :: DeployDataDefsError ) ,
381
+ InvalidDeployDataDefs ( #[ from] data :: DeployDataDefsError ) ,
382
382
#[ error( "Failed to make printable TOML of deployment: {0}" ) ]
383
383
TomlFormat ( #[ from] toml:: ser:: Error ) ,
384
384
#[ error( "{0}" ) ]
@@ -388,19 +388,19 @@ pub enum RunDeployError {
388
388
}
389
389
390
390
type ToDeploy < ' a > = Vec < (
391
- & ' a deploy :: DeployFlake < ' a > ,
391
+ & ' a data :: DeployFlake < ' a > ,
392
392
& ' a settings:: Root ,
393
393
( & ' a str , & ' a settings:: Node ) ,
394
394
( & ' a str , & ' a settings:: Profile ) ,
395
395
) > ;
396
396
397
397
async fn run_deploy (
398
- deploy_flakes : Vec < deploy :: DeployFlake < ' _ > > ,
398
+ deploy_flakes : Vec < data :: DeployFlake < ' _ > > ,
399
399
data : Vec < settings:: Root > ,
400
400
supports_flakes : bool ,
401
401
check_sigs : bool ,
402
402
interactive : bool ,
403
- cmd_overrides : & deploy :: CmdOverrides ,
403
+ cmd_overrides : & data :: CmdOverrides ,
404
404
keep_result : bool ,
405
405
result_path : Option < & str > ,
406
406
extra_build_args : & [ String ] ,
@@ -508,13 +508,13 @@ async fn run_deploy(
508
508
. collect ( ) ;
509
509
510
510
let mut parts: Vec < (
511
- & deploy :: DeployFlake < ' _ > ,
512
- deploy :: DeployData ,
513
- deploy :: DeployDefs ,
511
+ & data :: DeployFlake < ' _ > ,
512
+ data :: DeployData ,
513
+ data :: DeployDefs ,
514
514
) > = Vec :: new ( ) ;
515
515
516
516
for ( deploy_flake, data, ( node_name, node) , ( profile_name, profile) ) in to_deploy {
517
- let deploy_data = deploy :: make_deploy_data (
517
+ let deploy_data = data :: make_deploy_data (
518
518
& data. generic_settings ,
519
519
node,
520
520
node_name,
@@ -550,7 +550,7 @@ async fn run_deploy(
550
550
. await ?;
551
551
}
552
552
553
- let mut succeeded: Vec < ( & deploy :: DeployData , & deploy :: DeployDefs ) > = vec ! [ ] ;
553
+ let mut succeeded: Vec < ( & data :: DeployData , & data :: DeployDefs ) > = vec ! [ ] ;
554
554
555
555
// Run all deployments
556
556
// In case of an error rollback any previoulsy made deployment.
@@ -595,7 +595,7 @@ pub enum RunError {
595
595
#[ error( "Failed to evaluate deployment data: {0}" ) ]
596
596
GetDeploymentData ( #[ from] GetDeploymentDataError ) ,
597
597
#[ error( "Error parsing flake: {0}" ) ]
598
- ParseFlake ( #[ from] deploy :: ParseFlakeError ) ,
598
+ ParseFlake ( #[ from] data :: ParseFlakeError ) ,
599
599
#[ error( "Error initiating logger: {0}" ) ]
600
600
Logger ( #[ from] flexi_logger:: FlexiLoggerError ) ,
601
601
#[ error( "{0}" ) ]
@@ -619,12 +619,12 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
619
619
. targets
620
620
. unwrap_or_else ( || vec ! [ opts. clone( ) . target. unwrap_or_else( || "." . to_string( ) ) ] ) ;
621
621
622
- let deploy_flakes: Vec < DeployFlake > = deploys
622
+ let deploy_flakes: Vec < data :: DeployFlake > = deploys
623
623
. iter ( )
624
- . map ( |f| deploy :: parse_flake ( f. as_str ( ) ) )
625
- . collect :: < Result < Vec < DeployFlake > , ParseFlakeError > > ( ) ?;
624
+ . map ( |f| data :: parse_flake ( f. as_str ( ) ) )
625
+ . collect :: < Result < Vec < data :: DeployFlake > , data :: ParseFlakeError > > ( ) ?;
626
626
627
- let cmd_overrides = deploy :: CmdOverrides {
627
+ let cmd_overrides = data :: 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