Skip to content

Commit 26d6b53

Browse files
committed
Sanity check after failed build
1 parent d6612bf commit 26d6b53

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

backend/ec2.go

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ var (
3535
defaultEC2ImageSelectorType = "env"
3636
defaultEC2SSHUserName = "travis"
3737
defaultEC2ExecCmd = "bash ~/build.sh"
38-
defaultEC2SubnetID = ""
3938
defaultEC2InstanceType = "t2.micro"
40-
defaultEC2Image = "ami-02790d1ebf3b5181d"
4139
defaultEC2SecurityGroupIDs = "default"
4240
defaultEC2EBSOptimized = false
4341
defaultEC2DiskSize = int64(8)
@@ -124,7 +122,7 @@ func newEC2Provider(cfg *config.ProviderConfig) (Provider, error) {
124122
}
125123
sshDialTimeout = sd
126124
}
127-
customTags := make(map[string]string, 0)
125+
customTags := make(map[string]string)
128126
if cfg.IsSet("CUSTOM_TAGS") {
129127
items := strings.Split(cfg.Get("CUSTOM_TAGS"), ",")
130128
for _, tag := range items {
@@ -612,28 +610,6 @@ func (i *ec2Instance) UploadScript(ctx gocontext.Context, script []byte) error {
612610
//return i.uploadScriptAttempt(ctx, script)
613611
}
614612

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-
637613
func (i *ec2Instance) uploadScriptAttempt(ctx gocontext.Context, script []byte) error {
638614
return i.uploadScriptSCP(ctx, script)
639615
}

0 commit comments

Comments
 (0)