helpers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const CONTAINER_NAME = constants.PLUGIN_NAME + "-reqKick"
View Source
const REQKICK_DOCKER_IMAGE = "releases-docker.jfrog.io/jfrog/pipelines-reqkick:" + constants.BUILD_PLANE_VERSION

TODO: Make it configurable in run command

Variables

This section is empty.

Functions

func ConvertFirstRuneToLowerCase

func ConvertFirstRuneToLowerCase(name string) string

func DownloadFile

func DownloadFile(url string, targetPath string) error

func ExtractTarGz

func ExtractTarGz(gzipStream io.Reader, target string) error

func GetEnvironmentVariableFriendlyValue

func GetEnvironmentVariableFriendlyValue(value interface{}) string

func GetStructAsEnvironmentVariables

func GetStructAsEnvironmentVariables(object interface{}) map[string]string

func ResolvePathAndPanicIfNotFound

func ResolvePathAndPanicIfNotFound(path string) string

Types

type AssembleOptions

type AssembleOptions struct {
	TaskArguments        map[string]string
	EnvironmentVariables map[string]string
	StepJson             []byte

	EnableOnStepCompleteHook bool
	// contains filtered or unexported fields
}

func (*AssembleOptions) GetValueFromStepJson

func (o *AssembleOptions) GetValueFromStepJson(key string) string

type Configuration

type Configuration struct {
	AffinityGroup        string                `json:"affinityGroup"`
	InputSteps           []NamedReference      `json:"inputSteps"`
	InputResources       []NamedReference      `json:"inputResources"`
	OutputResources      []NamedReference      `json:"outputResources"`
	Integrations         []NamedReference      `json:"integrations"`
	EnvironmentVariables []EnvironmentVariable `json:"environmentVariables"`
	NodePool             string                `json:"nodePool"`
	TimeoutSeconds       int                   `json:"timeoutSeconds"`
	Runtime              Runtime               `json:"runtime"`
	IsOnDemand           bool                  `json:"isOnDemand"`
	InstanceSize         interface{}           `json:"instanceSize"`
	NodeId               int                   `json:"nodeId"`
	NodeName             string                `json:"nodeName"`
}

type DependenciesDownloadOptions

type DependenciesDownloadOptions struct {
	TargetFolder string
	Output       io.Writer
}

type DependenciesDownloader

type DependenciesDownloader interface {
	Download(options *DependenciesDownloadOptions) error
}

func NewDependenciesDownloader

func NewDependenciesDownloader() DependenciesDownloader

type DependenciesDownloaderImpl

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

func (*DependenciesDownloaderImpl) Download

type DependenciesDownloaderMock

type DependenciesDownloaderMock struct {
	mock.Mock
}

func (*DependenciesDownloaderMock) Download

type EnvironmentVariable

type EnvironmentVariable struct {
	Key        string `json:"key"`
	Value      string `json:"value"`
	IsReadOnly bool   `json:"isReadOnly"`
	Level      string `json:"level"`
}

type Execution

type Execution struct {
	OnExecute []string `json:"onExecute"`
}

type FormJSONValues

type FormJSONValues struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type Image

type Image struct {
	ImageName string `json:"imageName"`
	ImageTag  int    `json:"imageTag"`
}

type IntegrationParserMock

type IntegrationParserMock struct {
	mock.Mock
}

func (*IntegrationParserMock) GetIntegrations

func (m *IntegrationParserMock) GetIntegrations() map[string]ProjectIntegration

func (*IntegrationParserMock) GetSimplifiedIntegrations

func (m *IntegrationParserMock) GetSimplifiedIntegrations() map[string]map[string]interface{}

func (*IntegrationParserMock) Parse

type IntegrationsParser

type IntegrationsParser interface {
	Parse(*ParseIntegrationsOptions) error
	GetIntegrations() map[string]ProjectIntegration
	GetSimplifiedIntegrations() map[string]map[string]interface{}
}

func NewIntegrationParser

func NewIntegrationParser() IntegrationsParser

type IntegrationsParserImpl

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

func (*IntegrationsParserImpl) GetIntegrations

func (i *IntegrationsParserImpl) GetIntegrations() map[string]ProjectIntegration

func (*IntegrationsParserImpl) GetSimplifiedIntegrations

func (i *IntegrationsParserImpl) GetSimplifiedIntegrations() map[string]map[string]interface{}

func (*IntegrationsParserImpl) Parse

type NamedReference

type NamedReference struct {
	Name string `json:"name"`
}

type ParseIntegrationsOptions

type ParseIntegrationsOptions struct {
	PathToIntegrationsFile string
}

type ProjectIntegration

type ProjectIntegration struct {
	Id                    int              `json:"id"`
	MasterIntegrationId   int              `json:"masterIntegrationId"`
	Name                  string           `json:"name"`
	MasterIntegrationType string           `json:"masterIntegrationType"`
	ProjectId             int              `json:"projectId"`
	MasterIntegrationName string           `json:"masterIntegrationName"`
	ProviderId            int              `json:"providerId"`
	Environments          interface{}      `json:"environments"`
	IsInternal            bool             `json:"isInternal"`
	CreatedByUserName     string           `json:"createdByUserName"`
	UpdatedByUserName     string           `json:"updatedByUserName"`
	FormJSONValues        []FormJSONValues `json:"formJSONValues"`
	CreatedBy             int              `json:"createdBy"`
	UpdatedBy             int              `json:"updatedBy"`
	CreatedAt             time.Time        `json:"createdAt"`
	UpdatedAt             time.Time        `json:"updatedAt"`
}

func (ProjectIntegration) GetIntegrationAsEnvironmentVariable

func (p ProjectIntegration) GetIntegrationAsEnvironmentVariable() map[string]string

type RunnerMock

type RunnerMock struct {
	mock.Mock
}

func (*RunnerMock) GetRuntimeConfiguration

func (m *RunnerMock) GetRuntimeConfiguration() *runners.RuntimeConfiguration

func (*RunnerMock) Run

func (m *RunnerMock) Run(options *runners.RunnerOptions) error

type Runtime

type Runtime struct {
	Type  string `json:"type"`
	Image Image  `json:"image"`
}

type ScriptAssembler

type ScriptAssembler interface {
	Assemble(options *AssembleOptions) ([]byte, error)
}

func NewScriptAssembler

func NewScriptAssembler(runner runners.Runner, integrationsParser IntegrationsParser) ScriptAssembler

type ScriptAssemblerImpl

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

func (*ScriptAssemblerImpl) Assemble

func (s *ScriptAssemblerImpl) Assemble(options *AssembleOptions) ([]byte, error)

type ScriptAssemblerMock

type ScriptAssemblerMock struct {
	mock.Mock
}

func (*ScriptAssemblerMock) Assemble

func (m *ScriptAssemblerMock) Assemble(options *AssembleOptions) ([]byte, error)

type Step

type Step struct {
	Id             int           `json:"id"`
	Name           string        `json:"name"`
	RunId          int           `json:"runId"`
	PipelineId     int           `json:"pipelineId"`
	PipelineStepId int           `json:"pipelineStepId"`
	Type           string        `json:"type"`
	Execution      Execution     `json:"execution"`
	Configuration  Configuration `json:"configuration"`
}

type StepJson

type StepJson struct {
	Step      Step `json:"step"`
	Resources struct {
	} `json:"resources"`
	Integrations       map[string]map[string]interface{} `json:"integrations"`
	AffinityGroupSteps struct {
	} `json:"affinityGroupSteps"`
	InputStepIds []string `json:"inputStepIds"`
}

type StepJsonAssembleOptions

type StepJsonAssembleOptions struct {
}

type StepJsonAssembler

type StepJsonAssembler interface {
	Assemble(options *StepJsonAssembleOptions) ([]byte, error)
}

func NewStepJsonAssembler

func NewStepJsonAssembler(integrationsParser IntegrationsParser) StepJsonAssembler

type StepJsonAssemblerImpl

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

func (*StepJsonAssemblerImpl) Assemble

func (s *StepJsonAssemblerImpl) Assemble(options *StepJsonAssembleOptions) ([]byte, error)

type StepJsonAssemblerMock

type StepJsonAssemblerMock struct {
	mock.Mock
}

func (*StepJsonAssemblerMock) Assemble

func (m *StepJsonAssemblerMock) Assemble(options *StepJsonAssembleOptions) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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