exporter

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImage

func BuildImage(ctx context.Context, dockerfile string, tag string, buildContext string) error

func PushImage

func PushImage(ctx context.Context, tag string) error

Types

type Exporter

type Exporter interface {
	ReadYmlFile(path string) (*ci.CiYml, error)
	ExportDockerArtifacts() error
	ExportKubernetesArtifacts(registry string, image string, namespace string, pullSecret string, hostname string, ingressClass string) error
	ExportImages(ctx context.Context, registry string, imagePrefix string) error
}

func NewExporterService

func NewExporterService(fs *cs.FileSystem, outputPath string, baseImage string, envVars []string, repoRoot string, force bool) Exporter

type ExporterService

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

func (*ExporterService) CreateImageTag

func (e *ExporterService) CreateImageTag(registry string, imagePrefix string, serviceName string) (string, error)

CreateImageTag creates a Docker image tag from the registry, image prefix and service name. It returns the full image tag in the format: <registry>/<imagePrefix>-<serviceName>:latest.

func (*ExporterService) ExportDockerArtifacts

func (e *ExporterService) ExportDockerArtifacts() error

ExportDockerArtifacts exports Docker artifacts based on the provided input path, output path, base image, and environment variables. ReadYmlFile has to be called before this method.

func (*ExporterService) ExportImages

func (e *ExporterService) ExportImages(ctx context.Context, registry string, imagePrefix string) error

ExportImages builds and pushes Docker images for each service defined in the CI YML file. ExportDockerArtifacts has to be called before this method.

func (*ExporterService) ExportKubernetesArtifacts

func (e *ExporterService) ExportKubernetesArtifacts(registry string, imagePrefix string, namespace string, pullSecret string, hostname string, ingressClass string) error

ExportKubernetesArtifacts generates Kubernetes artifacts for each service defined in the CI YML file. ExportDockerArtifacts has to be called before this method.

func (*ExporterService) GetExportDir

func (e *ExporterService) GetExportDir() string

func (*ExporterService) GetKubernetesDir

func (e *ExporterService) GetKubernetesDir() string

func (*ExporterService) ReadYmlFile

func (e *ExporterService) ReadYmlFile(path string) (*ci.CiYml, error)

ReadYmlFile reads the CI YML file from the given path.

type MockExporter

type MockExporter struct {
	mock.Mock
}

MockExporter is an autogenerated mock type for the Exporter type

func NewMockExporter

func NewMockExporter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockExporter

NewMockExporter creates a new instance of MockExporter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockExporter) EXPECT

func (_m *MockExporter) EXPECT() *MockExporter_Expecter

func (*MockExporter) ExportDockerArtifacts

func (_mock *MockExporter) ExportDockerArtifacts() error

ExportDockerArtifacts provides a mock function for the type MockExporter

func (*MockExporter) ExportImages

func (_mock *MockExporter) ExportImages(ctx context.Context, registry string, imagePrefix string) error

ExportImages provides a mock function for the type MockExporter

func (*MockExporter) ExportKubernetesArtifacts

func (_mock *MockExporter) ExportKubernetesArtifacts(registry string, image string, namespace string, pullSecret string, hostname string, ingressClass string) error

ExportKubernetesArtifacts provides a mock function for the type MockExporter

func (*MockExporter) ReadYmlFile

func (_mock *MockExporter) ReadYmlFile(path string) (*ci.CiYml, error)

ReadYmlFile provides a mock function for the type MockExporter

type MockExporter_Expecter

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

func (*MockExporter_Expecter) ExportDockerArtifacts

ExportDockerArtifacts is a helper method to define mock.On call

func (*MockExporter_Expecter) ExportImages

func (_e *MockExporter_Expecter) ExportImages(ctx interface{}, registry interface{}, imagePrefix interface{}) *MockExporter_ExportImages_Call

ExportImages is a helper method to define mock.On call

  • ctx
  • registry
  • imagePrefix

func (*MockExporter_Expecter) ExportKubernetesArtifacts

func (_e *MockExporter_Expecter) ExportKubernetesArtifacts(registry interface{}, image interface{}, namespace interface{}, pullSecret interface{}, hostname interface{}, ingressClass interface{}) *MockExporter_ExportKubernetesArtifacts_Call

ExportKubernetesArtifacts is a helper method to define mock.On call

  • registry
  • image
  • namespace
  • pullSecret
  • hostname
  • ingressClass

func (*MockExporter_Expecter) ReadYmlFile

func (_e *MockExporter_Expecter) ReadYmlFile(path interface{}) *MockExporter_ReadYmlFile_Call

ReadYmlFile is a helper method to define mock.On call

  • path

type MockExporter_ExportDockerArtifacts_Call

type MockExporter_ExportDockerArtifacts_Call struct {
	*mock.Call
}

MockExporter_ExportDockerArtifacts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExportDockerArtifacts'

func (*MockExporter_ExportDockerArtifacts_Call) Return

func (*MockExporter_ExportDockerArtifacts_Call) Run

func (*MockExporter_ExportDockerArtifacts_Call) RunAndReturn

type MockExporter_ExportImages_Call

type MockExporter_ExportImages_Call struct {
	*mock.Call
}

MockExporter_ExportImages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExportImages'

func (*MockExporter_ExportImages_Call) Return

func (*MockExporter_ExportImages_Call) Run

func (_c *MockExporter_ExportImages_Call) Run(run func(ctx context.Context, registry string, imagePrefix string)) *MockExporter_ExportImages_Call

func (*MockExporter_ExportImages_Call) RunAndReturn

func (_c *MockExporter_ExportImages_Call) RunAndReturn(run func(ctx context.Context, registry string, imagePrefix string) error) *MockExporter_ExportImages_Call

type MockExporter_ExportKubernetesArtifacts_Call

type MockExporter_ExportKubernetesArtifacts_Call struct {
	*mock.Call
}

MockExporter_ExportKubernetesArtifacts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExportKubernetesArtifacts'

func (*MockExporter_ExportKubernetesArtifacts_Call) Return

func (*MockExporter_ExportKubernetesArtifacts_Call) Run

func (_c *MockExporter_ExportKubernetesArtifacts_Call) Run(run func(registry string, image string, namespace string, pullSecret string, hostname string, ingressClass string)) *MockExporter_ExportKubernetesArtifacts_Call

func (*MockExporter_ExportKubernetesArtifacts_Call) RunAndReturn

func (_c *MockExporter_ExportKubernetesArtifacts_Call) RunAndReturn(run func(registry string, image string, namespace string, pullSecret string, hostname string, ingressClass string) error) *MockExporter_ExportKubernetesArtifacts_Call

type MockExporter_ReadYmlFile_Call

type MockExporter_ReadYmlFile_Call struct {
	*mock.Call
}

MockExporter_ReadYmlFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadYmlFile'

func (*MockExporter_ReadYmlFile_Call) Return

func (*MockExporter_ReadYmlFile_Call) Run

func (*MockExporter_ReadYmlFile_Call) RunAndReturn

func (_c *MockExporter_ReadYmlFile_Call) RunAndReturn(run func(path string) (*ci.CiYml, error)) *MockExporter_ReadYmlFile_Call

Jump to

Keyboard shortcuts

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