@@ -44,6 +44,8 @@ func NewContestInitCommand() *cobra.Command {
4444type mapping struct {
4545 ProblemID string `yaml:"problem_id"`
4646 MachineImageName string `yaml:"machine_image_name"`
47+ Project string `yaml:"project"`
48+ Zone string `yaml:"zone"`
4749}
4850
4951func contestInitCommandFunc (cmd * cobra.Command , args []string ) error {
@@ -85,7 +87,13 @@ func contestInitCommandFunc(cmd *cobra.Command, args []string) error {
8587 xerrors .New ("problem_id が空になっている場所があります" )
8688 }
8789 if m .MachineImageName == "" {
88- xerrors .New ("machine-image-name が空になっている場所にあります" )
90+ xerrors .New ("machine-image-name が空になっている場所があります" )
91+ }
92+ if m .Project == "" {
93+ xerrors .New ("project が空になっている場所があります" )
94+ }
95+ if m .Zone == "" {
96+ xerrors .New ("zone が空になっている場所があります" )
8997 }
9098 }
9199
@@ -98,8 +106,8 @@ func contestInitCommandFunc(cmd *cobra.Command, args []string) error {
98106 c := count
99107 for c > 0 {
100108
101- fmt .Printf ("[INFO] creating... problemID: %s, machineImageName: %s\n " , m .ProblemID , m .MachineImageName )
102- i , err := cli .CreateInstance (m .ProblemID , m .MachineImageName )
109+ fmt .Printf ("[INFO] creating... problemID: %s, machineImageName: %s, project: %s, zone: %s \n " , m .ProblemID , m .MachineImageName , m . Project , m . Zone )
110+ i , err := cli .CreateInstance (m .ProblemID , m .MachineImageName , m . Project , m . Zone )
103111 if err != nil {
104112 fmt .Println ("[ERROR] failed to create instance." )
105113 return err
0 commit comments