Skip to content

Commit

Permalink
Update to latest gon with notarytool until we find a better solution (#…
Browse files Browse the repository at this point in the history
…14918)

Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
  • Loading branch information
georgekarrv and roperzh authored Nov 3, 2023
1 parent f9112e9 commit 5177287
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ require (
github.com/micromdm/nanomdm v0.3.0
github.com/micromdm/scep/v2 v2.1.0
github.com/mitchellh/go-ps v1.0.0
github.com/mitchellh/gon v0.2.3
github.com/mitchellh/gon v0.2.6-0.20231031204852-2d4f161ccecd
github.com/mna/redisc v1.3.2
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/ngrok/sqlmw v0.0.0-20211220175533-9d16fdc47b31
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/gon v0.2.3 h1:fObN7hD14VacGG++t27GzTW6opP0lwI7TsgTPL55wBo=
github.com/mitchellh/gon v0.2.3/go.mod h1:Ua18ZhqjZHg8VyqZo8kNHAY331ntV6nNJ9mT3s2mIo8=
github.com/mitchellh/gon v0.2.6-0.20231031204852-2d4f161ccecd h1:RQ7Xd+UzQW7IsC8z3oCg5qGRWiurC8rBsvnbhHUWvAk=
github.com/mitchellh/gon v0.2.6-0.20231031204852-2d4f161ccecd/go.mod h1:Arkk7Mvih157PG/9pRKOArPhuRdNKZRXqx2Y0LGiEMI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
Expand Down
35 changes: 23 additions & 12 deletions orbit/pkg/packaging/macos_notarize.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ func Notarize(path, bundleIdentifier string) error {
// Enterprise Dev account.
teamID, _ := os.LookupEnv("AC_TEAM_ID")

info, err := notarize.Notarize(
// FIXME Ignoring new log output for now.
_, notary_log, err := notarize.Notarize(
context.Background(),
&notarize.Options{
File: path,
BundleId: bundleIdentifier,
Username: username,
Password: password,
Provider: teamID,
File: path,
DeveloperId: username,
Password: password,
Provider: teamID,
Status: &statusHuman{
Lock: &sync.Mutex{},
},
Expand All @@ -46,7 +46,7 @@ func Notarize(path, bundleIdentifier string) error {
return fmt.Errorf("notarize: %w", err)
}

log.Info().Str("logs", info.LogFileURL).Msg("notarization completed")
log.Info().Str("logs", notary_log.JobId).Msg("notarization completed")

return nil
}
Expand Down Expand Up @@ -84,7 +84,8 @@ type statusHuman struct {
Prefix string
Lock *sync.Mutex

lastStatus string
lastInfoStatus string
lastLogStatus string
}

func (s *statusHuman) Submitting() {
Expand All @@ -103,12 +104,22 @@ func (s *statusHuman) Submitted(uuid string) {
os.Stdout, " %sWaiting for results from Apple. This can take minutes to hours.\n", s.Prefix)
}

func (s *statusHuman) Status(info notarize.Info) {
func (s *statusHuman) InfoStatus(info notarize.Info) {
s.Lock.Lock()
defer s.Lock.Unlock()

if info.Status != s.lastStatus {
s.lastStatus = info.Status
color.New().Fprintf(os.Stdout, " %sStatus: %s\n", s.Prefix, info.Status)
if info.Status != s.lastInfoStatus {
s.lastInfoStatus = info.Status
color.New().Fprintf(os.Stdout, " %sInfoStatus: %s\n", s.Prefix, info.Status)
}
}

func (s *statusHuman) LogStatus(log notarize.Log) {
s.Lock.Lock()
defer s.Lock.Unlock()

if log.Status != s.lastLogStatus {
s.lastLogStatus = log.Status
color.New().Fprintf(os.Stdout, " %sLogStatus: %s\n", s.Prefix, log.Status)
}
}

0 comments on commit 5177287

Please sign in to comment.