feat(store): available ref, update mode and services-by-repo for the webhook (#8)
This commit is contained in:
@@ -46,7 +46,7 @@ const (
|
||||
JobFailed JobStatus = "failed"
|
||||
)
|
||||
|
||||
// JobTrigger says what created a job. Only TriggerManual is used in phase 2.
|
||||
// JobTrigger says what created a job. TriggerManual comes from the UI, TriggerWebhook from POST /update.
|
||||
type JobTrigger string
|
||||
|
||||
// Job triggers.
|
||||
|
||||
@@ -51,11 +51,35 @@ type Service struct {
|
||||
ActualDigest string
|
||||
Status string
|
||||
Self bool
|
||||
Built bool // Compose service with a build: section; never updated
|
||||
UpdateMode string
|
||||
FirstSeenAt time.Time
|
||||
UpdatedAt time.Time
|
||||
RemovedAt *time.Time
|
||||
Built bool // Compose service with a build: section; never updated
|
||||
UpdateMode string // ModeManual or ModeAuto
|
||||
// AvailableRef is the newest ref a webhook or poll reported for this
|
||||
// service; "" if none, or if a later job already deployed it.
|
||||
AvailableRef string
|
||||
AvailableSource string // SourceWebhook or SourcePoll; "" when AvailableRef is empty
|
||||
AvailableAt *time.Time
|
||||
FirstSeenAt time.Time
|
||||
UpdatedAt time.Time
|
||||
RemovedAt *time.Time
|
||||
}
|
||||
|
||||
// Update modes of a service.
|
||||
const (
|
||||
ModeManual = "manual"
|
||||
ModeAuto = "auto"
|
||||
)
|
||||
|
||||
// Sources of an available ref.
|
||||
const (
|
||||
SourceWebhook = "webhook"
|
||||
SourcePoll = "poll"
|
||||
)
|
||||
|
||||
// Available is a newer ref reported for a service.
|
||||
type Available struct {
|
||||
Ref string
|
||||
Source string // SourceWebhook or SourcePoll
|
||||
At time.Time
|
||||
}
|
||||
|
||||
// DisplayName is the human-facing name of the service.
|
||||
|
||||
Reference in New Issue
Block a user