Skip to content

Commit

Permalink
Merge pull request #6 from deweb-services/feat/dws-1230-add-cpu-deps
Browse files Browse the repository at this point in the history
Fix binds
  • Loading branch information
rybnovdws authored Jan 17, 2024
2 parents 29afc4b + a4588f0 commit fb2067e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions cmd/deploy_script/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ func init() {
gpuCreateCmd.Flags().StringVar(&gpuCreateCfg.SSHKey, "ssh_key", "ssh_key", "ssh key to connect to instance")
gpuCreateCmd.Flags().Int64Var(&gpuCreateCfg.GPUCount, "count", 1, "count of gpus to deploy")
gpuCreateCmd.Flags().StringVar(&gpuCreateCfg.Region, "region", "Europe", "region to deploy instance")
_ = viper.BindPFlag("name", rootCmd.Flags().Lookup("name"))
_ = viper.BindPFlag("image", rootCmd.Flags().Lookup("image"))
_ = viper.BindPFlag("ssh_key", rootCmd.Flags().Lookup("ssh_key"))
_ = viper.BindPFlag("count", rootCmd.Flags().Lookup("count"))
_ = viper.BindPFlag("region", rootCmd.Flags().Lookup("region"))
_ = viper.BindPFlag("name", gpuCreateCmd.Flags().Lookup("name"))
_ = viper.BindPFlag("image", gpuCreateCmd.Flags().Lookup("image"))
_ = viper.BindPFlag("ssh_key", gpuCreateCmd.Flags().Lookup("ssh_key"))
_ = viper.BindPFlag("count", gpuCreateCmd.Flags().Lookup("count"))
_ = viper.BindPFlag("region", gpuCreateCmd.Flags().Lookup("region"))
gpuCmd.AddCommand(gpuCreateCmd)

gpuDeleteCmd.Flags().StringVar(&gpuDeleteCfg, "uuid", "uuid", "uuid of deployment to delete")
_ = viper.BindPFlag("uuid", rootCmd.Flags().Lookup("uuid"))

_ = viper.BindPFlag("uuid", gpuDeleteCmd.Flags().Lookup("uuid"))
gpuCmd.AddCommand(gpuDeleteCmd)

cpuCreateCmd.Flags().StringVar(&cpuCreateCfg.Region, "region", "region", "Region where you want to deploy like 'USA'")
Expand All @@ -62,24 +61,25 @@ func init() {
cpuCreateCmd.Flags().StringVar(&cpuCreateCfg.NetworkUUID, "vpc_id", "", "ID of the vpc to deploy your VM into")
cpuCreateCmd.Flags().StringVar(&cpuCreateCfg.SSHKey, "ssh_key", "", "SSH key to add to the target VM to make it possible to connect to your VM")
cpuCreateCmd.Flags().StringVar(&cpuCreateCfg.HostName, "host_name", "", "Host name for your Deployment")
_ = viper.BindPFlag("region", rootCmd.Flags().Lookup("region"))
_ = viper.BindPFlag("image", rootCmd.Flags().Lookup("image"))
_ = viper.BindPFlag("cpu", rootCmd.Flags().Lookup("cpu"))
_ = viper.BindPFlag("ram", rootCmd.Flags().Lookup("ram"))
_ = viper.BindPFlag("disk_size", rootCmd.Flags().Lookup("disk_size"))
_ = viper.BindPFlag("disk_type", rootCmd.Flags().Lookup("disk_type"))
_ = viper.BindPFlag("assign_public_ipv4", rootCmd.Flags().Lookup("assign_public_ipv4"))
_ = viper.BindPFlag("assign_public_ipv6", rootCmd.Flags().Lookup("assign_public_ipv6"))
_ = viper.BindPFlag("assign_ygg_ip", rootCmd.Flags().Lookup("assign_ygg_ip"))
_ = viper.BindPFlag("vpc_id", rootCmd.Flags().Lookup("vpc_id"))
_ = viper.BindPFlag("ssh_key", rootCmd.Flags().Lookup("ssh_key"))
_ = viper.BindPFlag("host_name", rootCmd.Flags().Lookup("host_name"))
_ = viper.BindPFlag("region", cpuCreateCmd.Flags().Lookup("region"))
_ = viper.BindPFlag("image", cpuCreateCmd.Flags().Lookup("image"))
_ = viper.BindPFlag("cpu", cpuCreateCmd.Flags().Lookup("cpu"))
_ = viper.BindPFlag("ram", cpuCreateCmd.Flags().Lookup("ram"))
_ = viper.BindPFlag("disk_size", cpuCreateCmd.Flags().Lookup("disk_size"))
_ = viper.BindPFlag("disk_type", cpuCreateCmd.Flags().Lookup("disk_type"))
_ = viper.BindPFlag("assign_public_ipv4", cpuCreateCmd.Flags().Lookup("assign_public_ipv4"))
_ = viper.BindPFlag("assign_public_ipv6", cpuCreateCmd.Flags().Lookup("assign_public_ipv6"))
_ = viper.BindPFlag("assign_ygg_ip", cpuCreateCmd.Flags().Lookup("assign_ygg_ip"))
_ = viper.BindPFlag("vpc_id", cpuCreateCmd.Flags().Lookup("vpc_id"))
_ = viper.BindPFlag("ssh_key", cpuCreateCmd.Flags().Lookup("ssh_key"))
_ = viper.BindPFlag("host_name", cpuCreateCmd.Flags().Lookup("host_name"))
cpuCmd.AddCommand(cpuCreateCmd)

cpuDeleteCmd.Flags().StringVar(&cpuDeleteCfg, "uuid", "uuid", "uuid of deployment to delete")
_ = viper.BindPFlag("uuid", rootCmd.Flags().Lookup("uuid"))
_ = viper.BindPFlag("uuid", cpuDeleteCmd.Flags().Lookup("uuid"))
cpuCmd.AddCommand(cpuDeleteCmd)

rootCmd.AddCommand(gpuCmd)
rootCmd.AddCommand(cpuCmd)
}

Expand Down

0 comments on commit fb2067e

Please sign in to comment.