Skip to content

Commit 76a4122

Browse files
authored
Merge pull request #563 from DefangLabs/kevin/deployerURL
2 parents 85e5b05 + 0351f3c commit 76a4122

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

tools/testing/deployer/deployer.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,23 @@ func (d *CliDeployer) Deploy(ctx context.Context) error {
120120
return err
121121
}
122122

123-
var urlRegex = regexp.MustCompile(`DEPLOYMENT_COMPLETED\s*([^\s]+)`)
123+
var urlRegex = regexp.MustCompile(`DEPLOYMENT_COMPLETED.+(https://\S+)`)
124124
var internalURLRegex = regexp.MustCompile(`\.internal:\d+$`)
125125

126126
func findUrlsInOutput(output string) []string {
127127
var urls []string
128128
match := urlRegex.FindAllStringSubmatch(output, -1)
129+
130+
// Will never be nil if there is a match
129131
for _, m := range match {
130-
if m[1] == "" {
131-
continue
132-
}
132+
// Skip internal URLs
133133
if internalURLRegex.MatchString(m[1]) {
134134
log.Printf("Skipping internal URL %v", m[1])
135135
continue
136136
}
137-
// Check if the URL starts with a scheme (http, https, etc.)
138-
if strings.HasPrefix(m[1], "https://") {
139-
urls = append(urls, m[1])
140-
}
137+
138+
// Add the URL if there a https URL found
139+
urls = append(urls, m[1])
141140
}
142141
return urls
143142
}

0 commit comments

Comments
 (0)