mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 00:45:19 +00:00
Update to latest gon with notarytool until we find a better solution (#14918)
Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
This commit is contained in:
parent
f9112e9038
commit
51772873bc
2
go.mod
2
go.mod
@ -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
|
||||
|
2
go.sum
2
go.sum
@ -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=
|
||||
|
@ -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(),
|
||||
¬arize.Options{
|
||||
File: path,
|
||||
BundleId: bundleIdentifier,
|
||||
Username: username,
|
||||
Password: password,
|
||||
Provider: teamID,
|
||||
File: path,
|
||||
DeveloperId: username,
|
||||
Password: password,
|
||||
Provider: teamID,
|
||||
Status: &statusHuman{
|
||||
Lock: &sync.Mutex{},
|
||||
},
|
||||
@ -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
|
||||
}
|
||||
@ -84,7 +84,8 @@ type statusHuman struct {
|
||||
Prefix string
|
||||
Lock *sync.Mutex
|
||||
|
||||
lastStatus string
|
||||
lastInfoStatus string
|
||||
lastLogStatus string
|
||||
}
|
||||
|
||||
func (s *statusHuman) Submitting() {
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user