build

package
v2.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: BSD-3-Clause Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBuildWorkspaces

func RegisterBuildWorkspaces(api huma.API, workspaceService *BuildWorkspaceService, uploadService *upload.UploadService)

RegisterBuildWorkspaces registers build workspace file browser routes.

Types

type BrowseBuildsInput

type BrowseBuildsInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Path          string `query:"path" default:"/" doc:"Directory path to browse"`
}

type BrowseBuildsOutput

type BrowseBuildsOutput struct {
	Body base.ApiResponse[[]workspacetypes.FileEntry]
}

type BuildFileContentResponse

type BuildFileContentResponse struct {
	Content  []byte `json:"content"`
	MimeType string `json:"mimeType"`
}

type BuildService

type BuildService struct {
	// contains filtered or unexported fields
}

func NewBuildService

func NewBuildService(
	db *database.DB,
	settings *settings.SettingsService,
	dockerService *docker.DockerClientService,
	registryService *registry.ContainerRegistryService,
	gitRepository *gitrepo.GitRepositoryService,
	eventService *event.EventService,
) *BuildService

func (*BuildService) BuildImage

func (s *BuildService) BuildImage(ctx context.Context, environmentID string, req buildtypes.BuildRequest, progressWriter io.Writer, serviceName string, user *common.User) (*buildtypes.BuildResult, error)

func (*BuildService) BuildSettings

func (s *BuildService) BuildSettings() buildtypes.BuildSettings

func (*BuildService) GetImageBuildByID

func (s *BuildService) GetImageBuildByID(ctx context.Context, environmentID, buildID string) (*imagetypes.BuildRecord, error)

func (*BuildService) ListImageBuildsByEnvironmentPaginated

func (s *BuildService) ListImageBuildsByEnvironmentPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]imagetypes.BuildRecord, pagination.Response, error)

type BuildWorkspaceHandler

type BuildWorkspaceHandler struct {
	// contains filtered or unexported fields
}

BuildWorkspaceHandler provides file browsing endpoints for manual build workspaces.

func (*BuildWorkspaceHandler) BrowseDirectory

func (h *BuildWorkspaceHandler) BrowseDirectory(ctx context.Context, input *BrowseBuildsInput) (*BrowseBuildsOutput, error)

func (*BuildWorkspaceHandler) CreateDirectory

func (*BuildWorkspaceHandler) DeleteFile

func (*BuildWorkspaceHandler) DownloadFile

func (*BuildWorkspaceHandler) GetFileContent

func (*BuildWorkspaceHandler) UploadFile

type BuildWorkspaceService

type BuildWorkspaceService struct {
	// contains filtered or unexported fields
}

BuildWorkspaceService provides file operations for the manual build workspace.

func NewBuildWorkspaceService

func NewBuildWorkspaceService(settings *settings.SettingsService) *BuildWorkspaceService

func (*BuildWorkspaceService) CreateDirectory

func (s *BuildWorkspaceService) CreateDirectory(ctx context.Context, dirPath string) error

func (*BuildWorkspaceService) DeleteFile

func (s *BuildWorkspaceService) DeleteFile(ctx context.Context, filePath string) error

func (*BuildWorkspaceService) DownloadFile

func (s *BuildWorkspaceService) DownloadFile(ctx context.Context, filePath string) (io.ReadCloser, int64, error)

func (*BuildWorkspaceService) GetFileContent

func (s *BuildWorkspaceService) GetFileContent(ctx context.Context, filePath string, maxBytes int64) ([]byte, string, error)

func (*BuildWorkspaceService) ListDirectory

func (s *BuildWorkspaceService) ListDirectory(ctx context.Context, dirPath string) ([]workspacetypes.FileEntry, error)

func (*BuildWorkspaceService) UploadFile

func (s *BuildWorkspaceService) UploadFile(ctx context.Context, destPath string, content io.Reader, filename string, size int64) error

type CreateBuildDirectoryInput

type CreateBuildDirectoryInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Path          string `query:"path" doc:"Directory path to create"`
}

type DeleteBuildFileInput

type DeleteBuildFileInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Path          string `query:"path" doc:"File or directory path to delete"`
}

type DownloadBuildFileInput

type DownloadBuildFileInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Path          string `query:"path" doc:"File path"`
}

type DownloadBuildFileOutput

type DownloadBuildFileOutput struct {
	ContentType        string `header:"Content-Type"`
	ContentDisposition string `header:"Content-Disposition"`
	ContentLength      int64  `header:"Content-Length"`
	Body               io.ReadCloser
}

type GetBuildFileContentInput

type GetBuildFileContentInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Path          string `query:"path" doc:"File path"`
	MaxBytes      int64  `query:"maxBytes" default:"1048576" doc:"Maximum bytes to read (default 1MB)"`
}

type GetBuildFileContentOutput

type GetBuildFileContentOutput struct {
	Body base.ApiResponse[BuildFileContentResponse]
}

type ImageBuild added in v2.8.1

type ImageBuild struct {
	database.BaseModel

	BuildArgs       database.JSON        `json:"buildArgs,omitempty" gorm:"column:build_args;type:text"`
	Labels          database.JSON        `json:"labels,omitempty" gorm:"column:labels;type:text"`
	Ulimits         database.JSON        `json:"ulimits,omitempty" gorm:"column:ulimits;type:text"`
	UserID          *string              `json:"userId,omitempty" gorm:"column:user_id"`
	Username        *string              `json:"username,omitempty" gorm:"column:username"`
	Digest          *string              `json:"digest,omitempty" gorm:"column:digest"`
	ErrorMessage    *string              `json:"errorMessage,omitempty" gorm:"column:error_message"`
	Output          *string              `json:"output,omitempty" gorm:"column:output;type:text"`
	CompletedAt     *time.Time           `json:"completedAt,omitempty" gorm:"column:completed_at" sortable:"true"`
	DurationMs      *int64               `json:"durationMs,omitempty" gorm:"column:duration_ms"`
	EnvironmentID   string               `json:"environmentId" gorm:"column:environment_id;index"`
	Status          ImageBuildStatus     `json:"status" gorm:"column:status;index" sortable:"true"`
	Provider        string               `json:"provider,omitempty" gorm:"column:provider"`
	ContextDir      string               `json:"contextDir" gorm:"column:context_dir"`
	Dockerfile      string               `json:"dockerfile,omitempty" gorm:"column:dockerfile"`
	Target          string               `json:"target,omitempty" gorm:"column:target"`
	BuildNetwork    string               `json:"network,omitempty" gorm:"column:build_network"`
	Isolation       string               `json:"isolation,omitempty" gorm:"column:isolation"`
	Tags            database.StringSlice `json:"tags,omitempty" gorm:"column:tags;type:text"`
	Platforms       database.StringSlice `json:"platforms,omitempty" gorm:"column:platforms;type:text"`
	CacheFrom       database.StringSlice `json:"cacheFrom,omitempty" gorm:"column:cache_from;type:text"`
	CacheTo         database.StringSlice `json:"cacheTo,omitempty" gorm:"column:cache_to;type:text"`
	Entitlements    database.StringSlice `json:"entitlements,omitempty" gorm:"column:entitlements;type:text"`
	ExtraHosts      database.StringSlice `json:"extraHosts,omitempty" gorm:"column:extra_hosts;type:text"`
	ShmSize         int64                `json:"shmSize,omitempty" gorm:"column:shm_size"`
	NoCache         bool                 `json:"noCache" gorm:"column:no_cache;default:false"`
	Pull            bool                 `json:"pull" gorm:"column:pull;default:false"`
	Privileged      bool                 `json:"privileged" gorm:"column:privileged;default:false"`
	Push            bool                 `json:"push" gorm:"column:push"`
	Load            bool                 `json:"load" gorm:"column:load"`
	OutputTruncated bool                 `json:"outputTruncated" gorm:"column:output_truncated;default:false"`
}

func (ImageBuild) TableName added in v2.8.1

func (ImageBuild) TableName() string

type ImageBuildStatus added in v2.8.1

type ImageBuildStatus string
const (
	ImageBuildStatusRunning ImageBuildStatus = "running"
	ImageBuildStatusSuccess ImageBuildStatus = "success"
	ImageBuildStatusFailed  ImageBuildStatus = "failed"
)

type UploadBuildFileInput

type UploadBuildFileInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	Path          string `query:"path" default:"/" doc:"Destination path"`
	Body          uploadtypes.ConsumeRequest
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL