Skip to content

Commit

Permalink
feat(yolo): Add beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton committed Dec 14, 2018
1 parent 9875023 commit 23dd363
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pkg/circle/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"io"
"strconv"
"strings"

circleci "github.com/jszwedko/go-circleci"
)
Expand All @@ -20,7 +21,7 @@ func (c *Client) Builds(pull string, job string, limit, offset int) ([]*circleci
var jbuild []*circleci.Build
for _, b := range bs {
if j, ok := b.BuildParameters["CIRCLE_JOB"]; ok {
if j == job {
if strings.HasPrefix(j, job) {
jbuild = append(jbuild, b)
}

Expand Down
16 changes: 12 additions & 4 deletions server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import (
)

const (
BUNDLE_ID = "chat.berty.ios"
APP_NAME = "berty"
IOS_JOB = "client.rn.ios"
ANDROID_JOB = "client.rn.android"
BUNDLE_ID = "chat.berty.ios"
APP_NAME = "berty"
IOS_JOB = "client.rn.ios"
IOS_HOUSE_JOB = "client.rn.ios-beta"
ANDROID_JOB = "client.rn.android"
)

var reIPA = regexp.MustCompile("/([^/]+).ipa$")
Expand Down Expand Up @@ -199,6 +200,10 @@ func (s *Server) ListReleaseIOS(c echo.Context) error {
return s.ListRelease(c, IOS_JOB)
}

func (s *Server) ListReleaseIOSBeta(c echo.Context) error {
return s.ListRelease(c, IOS_HOUSE_JOB)
}

func (s *Server) ListRelease(c echo.Context, job string) error {
html := `<html><head><link rel="stylesheet" href="/assets/site.css">` + faviconHTMLHeader + `</head><body><div class="container">`

Expand Down Expand Up @@ -307,6 +312,9 @@ func (s *Server) ListRelease(c echo.Context, job string) error {

var href string
switch job {
case IOS_HOUSE_JOB:
iosToken := s.getHash(prBranch)
href = fmt.Sprintf(`itms-services://?action=download-manifest&url=https://%s/auth/itms/release/%s/%s`, s.hostname, iosToken, prBranch)
case IOS_JOB:
iosToken := s.getHash(prBranch)
href = fmt.Sprintf(`itms-services://?action=download-manifest&url=https://%s/auth/itms/release/%s/%s`, s.hostname, iosToken, prBranch)
Expand Down
1 change: 1 addition & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func NewServer(cfg *ServerConfig) *Server {

e.GET("/release/ios/*", s.ReleaseIOS)
e.GET("/release/ios", s.ListReleaseIOS)
e.GET("/release/beta/ios", s.ListReleaseIOSBeta)
e.GET("/release/android", s.ListReleaseAndroid)
e.GET("/", func(c echo.Context) error {
header := c.Request().Header
Expand Down

0 comments on commit 23dd363

Please sign in to comment.