|
35 | 35 | defaultEC2ImageSelectorType = "env" |
36 | 36 | defaultEC2SSHUserName = "travis" |
37 | 37 | defaultEC2ExecCmd = "bash ~/build.sh" |
38 | | - defaultEC2SubnetID = "" |
39 | 38 | defaultEC2InstanceType = "t2.micro" |
40 | | - defaultEC2Image = "ami-02790d1ebf3b5181d" |
41 | 39 | defaultEC2SecurityGroupIDs = "default" |
42 | 40 | defaultEC2EBSOptimized = false |
43 | 41 | defaultEC2DiskSize = int64(8) |
@@ -124,7 +122,7 @@ func newEC2Provider(cfg *config.ProviderConfig) (Provider, error) { |
124 | 122 | } |
125 | 123 | sshDialTimeout = sd |
126 | 124 | } |
127 | | - customTags := make(map[string]string, 0) |
| 125 | + customTags := make(map[string]string) |
128 | 126 | if cfg.IsSet("CUSTOM_TAGS") { |
129 | 127 | items := strings.Split(cfg.Get("CUSTOM_TAGS"), ",") |
130 | 128 | for _, tag := range items { |
@@ -612,28 +610,6 @@ func (i *ec2Instance) UploadScript(ctx gocontext.Context, script []byte) error { |
612 | 610 | //return i.uploadScriptAttempt(ctx, script) |
613 | 611 | } |
614 | 612 |
|
615 | | -func (i *ec2Instance) waitForSSH(port, timeout int) error { |
616 | | - |
617 | | - host := *i.instance.PrivateIpAddress |
618 | | - if i.provider.publicIPConnect { |
619 | | - host = *i.instance.PublicIpAddress |
620 | | - } |
621 | | - |
622 | | - iter := 0 |
623 | | - for { |
624 | | - _, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", host, port), 1*time.Second) |
625 | | - if err == nil { |
626 | | - break |
627 | | - } |
628 | | - iter = iter + 1 |
629 | | - if iter > timeout { |
630 | | - return err |
631 | | - } |
632 | | - time.Sleep(500 * time.Millisecond) |
633 | | - } |
634 | | - return nil |
635 | | -} |
636 | | - |
637 | 613 | func (i *ec2Instance) uploadScriptAttempt(ctx gocontext.Context, script []byte) error { |
638 | 614 | return i.uploadScriptSCP(ctx, script) |
639 | 615 | } |
|
0 commit comments