feat: add watch flag
This commit is contained in:
parent
bb8344958e
commit
29f4821320
@ -91,6 +91,8 @@ type PewCmd struct {
|
|||||||
Kcfg config.KernelConfig `kong:"-" json:"-"`
|
Kcfg config.KernelConfig `kong:"-" json:"-"`
|
||||||
TimeoutDeadline time.Time `kong:"-" json:"-"`
|
TimeoutDeadline time.Time `kong:"-" json:"-"`
|
||||||
|
|
||||||
|
Watch bool `help:"watch job status"`
|
||||||
|
|
||||||
repoName string
|
repoName string
|
||||||
commit string
|
commit string
|
||||||
|
|
||||||
@ -316,6 +318,8 @@ func (cmd PewCmd) watchJob(swg *sizedwaitgroup.SizedWaitGroup,
|
|||||||
func (cmd PewCmd) remote(swg *sizedwaitgroup.SizedWaitGroup,
|
func (cmd PewCmd) remote(swg *sizedwaitgroup.SizedWaitGroup,
|
||||||
ka artifact.Artifact, ki distro.KernelInfo) {
|
ka artifact.Artifact, ki distro.KernelInfo) {
|
||||||
|
|
||||||
|
defer swg.Done()
|
||||||
|
|
||||||
slog := log.With().
|
slog := log.With().
|
||||||
Str("distro_type", ki.Distro.ID.String()).
|
Str("distro_type", ki.Distro.ID.String()).
|
||||||
Str("distro_release", ki.Distro.Release).
|
Str("distro_release", ki.Distro.Release).
|
||||||
@ -337,15 +341,16 @@ func (cmd PewCmd) remote(swg *sizedwaitgroup.SizedWaitGroup,
|
|||||||
slog = slog.With().Str("uuid", uuid).Logger()
|
slog = slog.With().Str("uuid", uuid).Logger()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error().Err(err).Msg("cannot add job")
|
slog.Error().Err(err).Msg("cannot add job")
|
||||||
swg.Done() // FIXME
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
slog.Info().Msg("add")
|
slog.Info().Msg("add")
|
||||||
|
|
||||||
|
if cmd.Watch {
|
||||||
// FIXME dummy (almost)
|
// FIXME dummy (almost)
|
||||||
go cmd.watchJob(swg, slog, uuid)
|
go cmd.watchJob(swg, slog, uuid)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (cmd PewCmd) testArtifact(swg *sizedwaitgroup.SizedWaitGroup,
|
func (cmd PewCmd) testArtifact(swg *sizedwaitgroup.SizedWaitGroup,
|
||||||
ka artifact.Artifact, ki distro.KernelInfo) {
|
ka artifact.Artifact, ki distro.KernelInfo) {
|
||||||
|
Loading…
Reference in New Issue
Block a user