PushFile pushes a local file to a GCE instance.
(srcPath, destPath string)
| 156 | |
| 157 | // PushFile pushes a local file to a GCE instance. |
| 158 | func (ins *Instance) PushFile(srcPath, destPath string) error { |
| 159 | if ins.ExternalIP == "" { |
| 160 | ins.populateExternalIP() |
| 161 | } |
| 162 | output, err := exec.Command("scp", "-o", "StrictHostKeyChecking no", |
| 163 | "-i", ins.SshKey, |
| 164 | srcPath, fmt.Sprintf("%s@%s:%s", ins.SshUser, ins.ExternalIP, destPath)).CombinedOutput() |
| 165 | if err != nil { |
| 166 | return fmt.Errorf("Error running scp: %v.\nHere is the output for the command: %v", err, string(output)) |
| 167 | } |
| 168 | return nil |
| 169 | } |
| 170 | |
| 171 | // DeleteInstance deletes a GCE instance. |
| 172 | func (ins *Instance) DeleteInstance() error { |
no test coverage detected