Skip to content

Commit

Permalink
Merge pull request #922 from paketo-buildpacks/tomee-fix
Browse files Browse the repository at this point in the history
Fix Tomee #102
  • Loading branch information
dmikusa authored Nov 25, 2022
2 parents 112570d + a2ed663 commit a892992
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actions/maven-dependency/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func main() {

versionRegex, ok := inputs["version_regex"]
if !ok {
fmt.Println(`No version_regex set, using default: ^[\d]+\.[\d]+\.[\d]+/$`)
fmt.Println(`No version_regex set, using default: ^[\d]+\.[\d]+\.[\d]+$`)
versionRegex = `^[\d]+\.[\d]+\.[\d]+$`
}
versionPattern := regexp.MustCompile(versionRegex)
Expand Down
10 changes: 6 additions & 4 deletions actions/tomee-dependency/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/paketo-buildpacks/pipeline-builder/actions"
)

var TomeeVersionPattern = regexp.MustCompile(`^tomee-?([\d]+)\.?([\d]+)?\.?([\d]+)?[-+.]?(.*)/$`)
var TomeeVersionPattern = regexp.MustCompile(`^tomee-?([\d]+)\.?([\d]+)?\.?([\d]+)?([-+.])?(.*)/$`)

func main() {
inputs := actions.NewInputs()
Expand All @@ -52,12 +52,14 @@ func main() {
c.OnHTML("a[href]", func(element *colly.HTMLElement) {
if p := TomeeVersionPattern.FindStringSubmatch(element.Attr("href")); p != nil {
if major == "" || major == p[1] {
v := fmt.Sprintf("%s.%s.%s", p[1], p[2], p[3])
verKey := fmt.Sprintf("%s.%s.%s", p[1], p[2], p[3])
verVal := fmt.Sprintf("%s.%s.%s", p[1], p[2], p[3])
if p[4] != "" {
v = fmt.Sprintf("%s-%s", v, p[4])
verKey = fmt.Sprintf("%s-%s", verKey, p[5])
verVal = fmt.Sprintf("%s%s%s", verVal, p[4], p[5])
}

versions[v] = fmt.Sprintf("%s/tomee-%[2]s/apache-tomee-%[2]s-%s.tar.gz", uri, v, dist)
versions[verKey] = fmt.Sprintf("%s/tomee-%[2]s/apache-tomee-%[2]s-%s.tar.gz", uri, verVal, dist)
}
}
})
Expand Down

0 comments on commit a892992

Please sign in to comment.