Have got publishing to Netlify
This commit is contained in:
parent
8e0ffb6c24
commit
7ef6725bdb
23 changed files with 667 additions and 109 deletions
|
|
@ -5,3 +5,14 @@ import "context"
|
|||
type Job struct {
|
||||
Do func(ctx context.Context) error
|
||||
}
|
||||
|
||||
func Jobs(jobs ...Job) Job {
|
||||
return Job{Do: func(ctx context.Context) error {
|
||||
for _, job := range jobs {
|
||||
if err := job.Do(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}}
|
||||
}
|
||||
|
|
|
|||
22
models/publish.go
Normal file
22
models/publish.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package models
|
||||
|
||||
type TargetRole string
|
||||
|
||||
const (
|
||||
TargetRoleProduction TargetRole = "production"
|
||||
)
|
||||
|
||||
type TargetType string
|
||||
|
||||
const (
|
||||
TargetTypeNetlify TargetType = "netlify"
|
||||
)
|
||||
|
||||
type PublishTarget struct {
|
||||
ID int64
|
||||
SiteID int64
|
||||
Role TargetRole
|
||||
Type TargetType
|
||||
URL string
|
||||
TargetRef string
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue