mirror of
https://github.com/harness/drone.git
synced 2025-05-16 08:59:56 +08:00
feat: [CODE-847]: repo export
This commit is contained in:
parent
3b61f8aab4
commit
73b0d0248d
@ -199,7 +199,7 @@ func setupSpaces(r chi.Router, spaceCtrl *space.Controller) {
|
|||||||
r.Get("/secrets", handlerspace.HandleListSecrets(spaceCtrl))
|
r.Get("/secrets", handlerspace.HandleListSecrets(spaceCtrl))
|
||||||
r.Get("/connectors", handlerspace.HandleListConnectors(spaceCtrl))
|
r.Get("/connectors", handlerspace.HandleListConnectors(spaceCtrl))
|
||||||
r.Get("/templates", handlerspace.HandleListTemplates(spaceCtrl))
|
r.Get("/templates", handlerspace.HandleListTemplates(spaceCtrl))
|
||||||
r.Post("/export-progress", handlerspace.HandleExportProgress(spaceCtrl))
|
r.Get("/export-progress", handlerspace.HandleExportProgress(spaceCtrl))
|
||||||
|
|
||||||
// Child collections
|
// Child collections
|
||||||
r.Route("/paths", func(r chi.Router) {
|
r.Route("/paths", func(r chi.Router) {
|
||||||
|
@ -25,7 +25,7 @@ type Repository struct {
|
|||||||
scheduler *job.Scheduler
|
scheduler *job.Scheduler
|
||||||
}
|
}
|
||||||
|
|
||||||
type RepoImportData struct {
|
type RepoExportData struct {
|
||||||
UID string `json:"uid"`
|
UID string `json:"uid"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
IsPublic bool `json:"is_public"`
|
IsPublic bool `json:"is_public"`
|
||||||
@ -55,7 +55,7 @@ func (e *Repository) Register(executor *job.Executor) error {
|
|||||||
func (e *Repository) Run(ctx context.Context, jobGroupId string, harnessCodeInfo *HarnessCodeInfo, repos []*types.Repository) error {
|
func (e *Repository) Run(ctx context.Context, jobGroupId string, harnessCodeInfo *HarnessCodeInfo, repos []*types.Repository) error {
|
||||||
jobDefinitions := make([]job.Definition, len(repos))
|
jobDefinitions := make([]job.Definition, len(repos))
|
||||||
for i, repo := range repos {
|
for i, repo := range repos {
|
||||||
repoJobData := RepoImportData{
|
repoJobData := RepoExportData{
|
||||||
UID: repo.UID,
|
UID: repo.UID,
|
||||||
Description: repo.Description,
|
Description: repo.Description,
|
||||||
IsPublic: repo.IsPublic,
|
IsPublic: repo.IsPublic,
|
||||||
|
Loading…
Reference in New Issue
Block a user