44 params "github.com/redhat-developer/mapt/cmd/mapt/cmd/constants"
55 maptContext "github.com/redhat-developer/mapt/pkg/manager/context"
66 "github.com/redhat-developer/mapt/pkg/provider/aws/action/rhel"
7+ "github.com/redhat-developer/mapt/pkg/util/ghactions"
78 "github.com/redhat-developer/mapt/pkg/util/logging"
89 "github.com/spf13/cobra"
910 "github.com/spf13/pflag"
@@ -61,18 +62,30 @@ func getRHELCreate() *cobra.Command {
6162 viper .GetString (params .ConnectionDetailsOutput ),
6263 viper .GetStringMapString (params .Tags ))
6364
65+ // Initialize gh actions runner if needed
66+ if viper .IsSet (params .InstallGHActionsRunner ) {
67+ err := ghactions .InitGHRunnerArgs (viper .GetString (params .GHActionsRunnerToken ),
68+ viper .GetString (params .GHActionsRunnerName ),
69+ viper .GetString (params .GHActionsRunnerRepo ))
70+ if err != nil {
71+ logging .Error (err )
72+ }
73+ }
74+
6475 // Run create
6576 if err := rhel .Create (
6677 & rhel.Request {
67- Prefix : "main" ,
68- Version : viper .GetString (rhelVersion ),
69- Arch : viper .GetString (rhelArch ),
70- VMType : viper .GetStringSlice (vmTypes ),
71- SubsUsername : viper .GetString (subsUsername ),
72- SubsUserpass : viper .GetString (subsUserpass ),
73- ProfileSNC : viper .IsSet (profileSNC ),
74- Spot : viper .IsSet (spot ),
75- Airgap : viper .IsSet (airgap )}); err != nil {
78+ Prefix : "main" ,
79+ Version : viper .GetString (rhelVersion ),
80+ Arch : viper .GetString (rhelArch ),
81+ VMType : viper .GetStringSlice (vmTypes ),
82+ SubsUsername : viper .GetString (subsUsername ),
83+ SubsUserpass : viper .GetString (subsUserpass ),
84+ ProfileSNC : viper .IsSet (profileSNC ),
85+ Spot : viper .IsSet (spot ),
86+ Airgap : viper .IsSet (airgap ),
87+ SetupGHActionsRunner : viper .GetBool (params .InstallGHActionsRunner ),
88+ }); err != nil {
7689 logging .Error (err )
7790 }
7891 return nil
@@ -89,6 +102,7 @@ func getRHELCreate() *cobra.Command {
89102 flagSet .Bool (airgap , false , airgapDesc )
90103 flagSet .Bool (spot , false , spotDesc )
91104 flagSet .Bool (profileSNC , false , profileSNCDesc )
105+ flagSet .AddFlagSet (params .GetGHActionsFlagset ())
92106 c .PersistentFlags ().AddFlagSet (flagSet )
93107 // if err := c.MarkFlagRequired(subsUsername); err != nil {
94108 // logging.Error(err)
0 commit comments