Have got publishing to Netlify
This commit is contained in:
parent
8e0ffb6c24
commit
7ef6725bdb
23 changed files with 667 additions and 109 deletions
|
|
@ -57,9 +57,28 @@ func (s *Service) CreateSite(ctx context.Context, name string) (models.Site, err
|
|||
return models.Site{}, err
|
||||
}
|
||||
|
||||
// TEMP
|
||||
if err := s.db.InsertPublishTarget(ctx, &models.PublishTarget{
|
||||
SiteID: newSite.ID,
|
||||
Role: models.TargetRoleProduction,
|
||||
Type: models.TargetTypeNetlify,
|
||||
URL: "https://meek-meringue-060cfc.netlify.app",
|
||||
TargetRef: "e628dc6e-e6e1-45a9-847a-982adef940a8",
|
||||
}); err != nil {
|
||||
return models.Site{}, err
|
||||
}
|
||||
|
||||
return newSite, s.jobs.Queue(ctx, s.sb.CreateNewSite(newSite))
|
||||
}
|
||||
|
||||
func (s *Service) Rebuild(ctx context.Context, site models.Site) error {
|
||||
if site.ID == 0 {
|
||||
return errors.New("site id required")
|
||||
}
|
||||
|
||||
return s.jobs.Queue(ctx, s.sb.RebuildSite(site))
|
||||
}
|
||||
|
||||
func normaliseName(name string) string {
|
||||
var sb strings.Builder
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue