99import com .axway .yamles .utils .merge .AbstractLookupEnabledCommand ;
1010import com .axway .yamles .utils .merge .certs .CertificatesConfigurator ;
1111import com .axway .yamles .utils .merge .config .FieldConfigurator ;
12+ import com .axway .yamles .utils .merge .files .FileGenerator ;
13+ import com .axway .yamles .utils .merge .files .FilesCommand .FilesArg ;
1214import com .axway .yamles .utils .plugins .ExecutionMode ;
1315
16+ import picocli .CommandLine .ArgGroup ;
1417import picocli .CommandLine .Command ;
1518import picocli .CommandLine .Option ;
1619
@@ -32,6 +35,9 @@ public class ConfigCommand extends AbstractLookupEnabledCommand {
3235 "--certs" }, description = "Certificate configuration file." , paramLabel = "FILE" , required = false )
3336 private List <File > certConfigs ;
3437
38+ @ ArgGroup (exclusive = false , multiplicity = "1..*" )
39+ private List <FilesArg > fileGeneratorConfigs ;
40+
3541 @ Option (names = {
3642 "--expiration-warning" }, description = "Audit warning in case of certificate expires within the next days." , paramLabel = "DAYS" , required = false )
3743 private int expirationWarningDays = CertificatesConfigurator .DEFAULT_EXP_WARNING_DAYS ;
@@ -44,7 +50,8 @@ public class ConfigCommand extends AbstractLookupEnabledCommand {
4450 "--expiration-fail" }, description = "Fail in case of certificate expires within the next days." , paramLabel = "DAYS" , required = false )
4551 private int expirationFailDays = CertificatesConfigurator .DEFAULT_EXP_FAIL_DAYS ;
4652
47- @ Option (names = { "-f" , "--fragment" , "--config" }, description = "Configuration fragment for values.yaml file." , paramLabel = "FILE" , required = false )
53+ @ Option (names = { "-f" , "--fragment" ,
54+ "--config" }, description = "Configuration fragment for values.yaml file." , paramLabel = "FILE" , required = false )
4855 private List <File > fragmentConfigs ;
4956
5057 @ Option (names = {
@@ -53,7 +60,7 @@ public class ConfigCommand extends AbstractLookupEnabledCommand {
5360
5461 @ Override
5562 public Integer call () throws Exception {
56- initializeProviderManager (this .mode );
63+ initializeProviderManager (this .mode );
5764 Integer result = 0 ;
5865
5966 YamlEs es = new YamlEs (this .projectDir );
@@ -80,6 +87,12 @@ public Integer call() throws Exception {
8087 cc .apply (es );
8188 }
8289
90+ if (requiresFileGeneratoreConfig ()) {
91+ FileGenerator fg = new FileGenerator (this .mode );
92+ fg .setFilesArgs (this .fileGeneratorConfigs );
93+ fg .apply ();
94+ }
95+
8396 return result ;
8497 }
8598
@@ -89,6 +102,9 @@ private boolean requiresFragmentConfig() {
89102
90103 private boolean requiresCertificateConfig () {
91104 return this .certConfigs != null && !this .certConfigs .isEmpty ();
105+ }
92106
107+ private boolean requiresFileGeneratoreConfig () {
108+ return this .fileGeneratorConfigs != null && !this .fileGeneratorConfigs .isEmpty ();
93109 }
94110}
0 commit comments