Documentation ¶
Index ¶
- Constants
- func CheckElement(fields []string, split func(string, string, string))
- func IsUpdated(p pluginJson) (_ bool)
- type Element
- type ElementManifest
- func ExtractFeature(pluginRecord []string) (index string, pluginData *ElementManifest)
- func ExtractGroovy(pluginRecord []string) (index string, pluginData *ElementManifest)
- func ExtractPlugin(pluginRecord []string) (index string, pluginData *ElementManifest)
- func NewElementManifest(typ, name string) (ret *ElementManifest)
- type Elements
- type ElementsType
- func (e *ElementsType) Add(fields ...string) (_ Element, err error)
- func (e *ElementsType) AddElement(element Element) (ret Element, err error)
- func (e *ElementsType) AddSupport(elementTypes ...string)
- func (e *ElementsType) AddSupportContext(elementType, key, value string)
- func (e *ElementsType) Compare(newList *ElementsType) (compare *PluginsStatus, err error)
- func (e *ElementsType) DeleteElement(element Element)
- func (e *ElementsType) DeterminePluginsVersion(ref *Repository) (updates *PluginsStatus, _ error)
- func (e *ElementsType) ExtractTopElements() (identified *ElementsType)
- func (e *ElementsType) GetElement(elementType, name string) (_ Element)
- func (e *ElementsType) GetElements(elementType string) (_ Elements)
- func (e *ElementsType) GetRepoPlugin(props ...string) (ret Element)
- func (e *ElementsType) Length() (total int)
- func (e *ElementsType) PrintOut(printDetails func(element Element))
- func (e *ElementsType) Read(file string, cols int) (err error)
- func (e *ElementsType) RefreshDependencies(curElement, newElement Element)
- func (e *ElementsType) Remove(elementType, name string)
- func (e *ElementsType) SetFeaturesPath(repoPath string) error
- func (e *ElementsType) SetFeaturesRepoURL(repoURL string) error
- func (e *ElementsType) SetLocal()
- func (e *ElementsType) SetRepository(ref *Repository)
- func (e *ElementsType) UpdateElement(curElement, newElement Element) (updated bool, err error)
- func (e *ElementsType) WriteSimple(file string, cols int) (err error)
- type Feature
- func (p *Feature) AddDependencyTo(depElement Element)
- func (p *Feature) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)
- func (p *Feature) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)
- func (p *Feature) ChainElement(context *ElementsType) (ret *ElementsType, _ error)
- func (p *Feature) CompleteFromContext(_ *ElementsType) (_ error)
- func (p *Feature) DefineLatestPossibleVersion(context *ElementsType) (_ error)
- func (p *Feature) GetDependencies() (_ Elements)
- func (p *Feature) GetDependenciesFromContext(*ElementsType) (_ Elements)
- func (p *Feature) GetParents() (_ Elements)
- func (p *Feature) GetType() string
- func (p *Feature) GetVersion() (_ VersionStruct, _ error)
- func (p *Feature) IsFixed() (_ bool)
- func (p *Feature) IsVersionCandidate(version *goversion.Version) bool
- func (p *Feature) Merge(_ *ElementsType, _ Element, _ int) (_ bool, _ error)
- func (p *Feature) Name() string
- func (p *Feature) RemoveDependencyTo(depElement Element)
- func (p *Feature) SetFrom(fields ...string) (err error)
- func (p *Feature) SetVersionConstraintFromDepConstraint(*ElementsType, Element) (_ error)
- func (p *Feature) String() string
- type Groovy
- func (p *Groovy) AddDependencyTo(depElement Element)
- func (p *Groovy) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)
- func (p *Groovy) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)
- func (p *Groovy) ChainElement(*ElementsType) (_ *ElementsType, _ error)
- func (p *Groovy) CompleteFromContext(context *ElementsType) (err error)
- func (p *Groovy) DefineLatestPossibleVersion(context *ElementsType) (_ error)
- func (p *Groovy) GetDependencies() (_ Elements)
- func (p *Groovy) GetDependenciesFromContext(*ElementsType) (_ Elements)
- func (p *Groovy) GetParents() (_ Elements)
- func (p *Groovy) GetType() string
- func (p *Groovy) GetVersion() (_ VersionStruct, _ error)
- func (p *Groovy) IsFixed() (_ bool)
- func (p *Groovy) IsVersionCandidate(version *goversion.Version) bool
- func (p *Groovy) Merge(_ *ElementsType, _ Element, _ int) (_ bool, _ error)
- func (p *Groovy) Name() string
- func (p *Groovy) RemoveDependencyTo(depElement Element)
- func (p *Groovy) SetFrom(fields ...string) (err error)
- func (p *Groovy) SetVersionConstraintFromDepConstraint(*ElementsType, Element) (_ error)
- func (p *Groovy) String() string
- type GroovyStatusDetails
- type JenkinsHome
- type Plugin
- func (p *Plugin) AddDependencyTo(depElement Element)
- func (p *Plugin) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)
- func (p *Plugin) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)
- func (p *Plugin) ChainElement(context *ElementsType) (ret *ElementsType, _ error)
- func (p *Plugin) CompleteFromContext(context *ElementsType) (err error)
- func (p *Plugin) DefineLatestPossibleVersion(context *ElementsType) (_ error)
- func (p *Plugin) GetDependencies() Elements
- func (p *Plugin) GetDependenciesFromContext(context *ElementsType) Elements
- func (p *Plugin) GetParents() Elements
- func (p *Plugin) GetType() string
- func (p *Plugin) GetVersion() (ret VersionStruct, err error)
- func (p *Plugin) GetVersionString() string
- func (p *Plugin) IsFixed() (_ bool)
- func (p *Plugin) IsVersionCandidate(version *goversion.Version) bool
- func (p *Plugin) Merge(context *ElementsType, element Element, policy int) (updated bool, err error)
- func (p *Plugin) Name() string
- func (p *Plugin) RemoveDependencyTo(depElement Element)
- func (p *Plugin) SetFrom(fields ...string) (err error)
- func (p *Plugin) SetVersionConstraintFromDepConstraint(context *ElementsType, depElement Element) (err error)
- func (p *Plugin) String() string
- type Plugins
- func (p *Plugins) Add(fields ...string) (_ error)
- func (p *Plugins) AddSupport(name string, set func(data []string) (string, *ElementManifest))
- func (p *Plugins) AddSupportGroovy()
- func (p *Plugins) AddSupportPlugin(repoGet func(name string) (*RepositoryPlugin, bool))
- func (p *Plugins) ExtractTopElements() (identified *Plugins)
- func (p *Plugins) Length() (_ int)
- func (p *Plugins) PrintOut(printDetails func(element *ElementManifest))
- func (p *Plugins) Read(file string, cols int) (err error)
- func (p *Plugins) WriteSimple(file string, cols int) (err error)
- type PluginsExport
- type PluginsStatus
- func (s *PluginsStatus) AddElement(element Element, old bool) (err error)
- func (s *PluginsStatus) AddGroovyStatus(groovy *Groovy, old bool) (_ error)
- func (s *PluginsStatus) AddPluginStatus(plugin *Plugin, old bool) (_ error)
- func (s *PluginsStatus) CheckElementLine(line string, split func(string, string, string))
- func (s *PluginsStatus) CheckFeature(name string) (_ error)
- func (s *PluginsStatus) CheckGroovy(name, groovyPath string) error
- func (s *PluginsStatus) CheckMinDep() (_ bool)
- func (s *PluginsStatus) CheckPlugin(name, versionConstraints string, parentDependency *pluginsStatusDetails) error
- func (s *PluginsStatus) Compare() (_ error)
- func (s *PluginsStatus) DefinePluginsVersion() (_ bool)
- func (s *PluginsStatus) DisplayUpdates() (_ bool)
- func (s *PluginsStatus) ImportInstalled(elements *ElementsType)
- func (s *PluginsStatus) NewInstall()
- func (s *PluginsStatus) PluginsLength() int
- func (s *PluginsStatus) SetFeaturesPath(repoPath string) error
- func (s *PluginsStatus) SetFeaturesRepoURL(repoURL string) error
- func (s *PluginsStatus) SetLocal()
- func (s *PluginsStatus) WriteSimple(file string) (err error)
- type Repository
- func (r *Repository) Compare(elements *ElementsType) (updates *PluginsStatus)
- func (r *Repository) Get(pluginRequested ...string) (plugin *RepositoryPlugin, found bool)
- func (r *Repository) GetOrderedVersions(name string) (ret goversion.Collection)
- func (r *Repository) GetVersions(name string) (_ map[string]*RepositoryPlugin)
- func (r *Repository) LoadFromURL() (_ bool)
- type RepositoryDependencies
- type RepositoryDependency
- type RepositoryPlugin
- type RepositoryPlugins
- type RepositoryPluginsHistory
- type VersionStruct
Constants ¶
const ( JenkinsRepoURL = "https://updates.jenkins.io" JenkinsRepoVersion = "current" JenkinsRepoFile = "update-center.actual.json" JenkinsHistoryFile = "plugin-versions.json" // TODO: Use this to load it so we can identify better version from constraints. JenkinsPluginRepo = "download/plugins" )
Variables ¶
This section is empty.
Functions ¶
func CheckElement ¶
CheckElement call split function and ensure a type and a name are given.
Types ¶
type Element ¶
type Element interface { GetVersion() (ret VersionStruct, err error) SetFrom(fields ...string) (err error) GetType() string Name() string ChainElement(context *ElementsType) (*ElementsType, error) //GetElementsFromRepo(func (name string) (*Elements, error)) Merge(context *ElementsType, element Element, policy int) (updated bool, err error) CompleteFromContext(context *ElementsType) (err error) String() string IsFixed() bool GetParents() Elements GetDependencies() Elements GetDependenciesFromContext(context *ElementsType) Elements AddDependencyTo(element Element) RemoveDependencyTo(element Element) SetVersionConstraintFromDepConstraint(context *ElementsType, element Element) error IsVersionCandidate(version *goversion.Version) bool DefineLatestPossibleVersion(context *ElementsType) (_ error) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails) }
Element is an interface on Plugin/Groovy/Feature object
func NewElement ¶
NewElement to create a known new element type
type ElementManifest ¶
type ElementManifest struct { Version string `yaml:"Plugin-Version"` Name string `yaml:"Extension-Name"` ShortName string `yaml:"Short-Name"` JenkinsVersion string `yaml:"Jenkins-Version"` LongName string `yaml:"Long-Name"` Dependencies string `yaml:"Plugin-Dependencies"` Description string `yaml:"Specification-Title"` // contains filtered or unexported fields }
ElementManifest describe details on elements. By default, it helps reading the MANIFEST.MF from java as a yaml file, clenaed before.
func ExtractFeature ¶
func ExtractFeature(pluginRecord []string) (index string, pluginData *ElementManifest)
func ExtractGroovy ¶
func ExtractGroovy(pluginRecord []string) (index string, pluginData *ElementManifest)
func ExtractPlugin ¶
func ExtractPlugin(pluginRecord []string) (index string, pluginData *ElementManifest)
func NewElementManifest ¶
func NewElementManifest(typ, name string) (ret *ElementManifest)
NewElementManifest return a element manifest with details
func (*ElementManifest) GetVersion ¶
func (e *ElementManifest) GetVersion() (ret VersionStruct, err error)
type Elements ¶
Elements represents the list of Elements (plugins, features, etc...)
func (Elements) DisplayDependencies ¶
func (l Elements) DisplayDependencies()
DisplayDependencies display the list of dependencies of that element.
type ElementsType ¶
type ElementsType struct {
// contains filtered or unexported fields
}
ElementsType is collections of Plugins
func NewElementsType ¶
func NewElementsType() (ret *ElementsType)
NewElementsType creates the collection of plugins
func (*ElementsType) Add ¶
func (e *ElementsType) Add(fields ...string) (_ Element, err error)
Add a new element to a collection type.
func (*ElementsType) AddElement ¶
func (e *ElementsType) AddElement(element Element) (ret Element, err error)
AddElement the new element to the collection, then add their dependencies if noDeps is false.
func (*ElementsType) AddSupport ¶
func (e *ElementsType) AddSupport(elementTypes ...string)
AddSupport register a set function for a data type given
func (*ElementsType) AddSupportContext ¶
func (e *ElementsType) AddSupportContext(elementType, key, value string)
AddSupport register a set function for a data type given
func (*ElementsType) Compare ¶
func (e *ElementsType) Compare(newList *ElementsType) (compare *PluginsStatus, err error)
Compare the current list of plugins with the newList given if the list has *Repository reference, the status will gave the latest boolean value.
func (*ElementsType) DeleteElement ¶
func (e *ElementsType) DeleteElement(element Element)
DeleteElement remove the element from the list and cleanup dependencies
func (*ElementsType) DeterminePluginsVersion ¶
func (e *ElementsType) DeterminePluginsVersion(ref *Repository) (updates *PluginsStatus, _ error)
DeterminePluginsVersion apply the updates repository ref to the list of plugins to set proper version of plugins from rules Rules can change and a rule validation will be executed at the end of the process
func (*ElementsType) ExtractTopElements ¶
func (e *ElementsType) ExtractTopElements() (identified *ElementsType)
ExtractTopElements identifies top plugins (remove all dependencies)
func (*ElementsType) GetElement ¶
func (e *ElementsType) GetElement(elementType, name string) (_ Element)
GetElement return the collection type requested.
func (*ElementsType) GetElements ¶
func (e *ElementsType) GetElements(elementType string) (_ Elements)
GetElements return the collection type requested.
func (*ElementsType) GetRepoPlugin ¶
func (e *ElementsType) GetRepoPlugin(props ...string) (ret Element)
GetRepoPlugin return a plugin information from the updates repository
func (*ElementsType) Length ¶
func (e *ElementsType) Length() (total int)
Length the list of plugins as Simple format
func (*ElementsType) PrintOut ¶
func (e *ElementsType) PrintOut(printDetails func(element Element))
PrintOut loop on plugins to display them
func (*ElementsType) Read ¶
func (e *ElementsType) Read(file string, cols int) (err error)
Read the file given
func (*ElementsType) RefreshDependencies ¶
func (e *ElementsType) RefreshDependencies(curElement, newElement Element)
RefreshDependencies refresh Dependencies between old element list and new element list
func (*ElementsType) Remove ¶
func (e *ElementsType) Remove(elementType, name string)
Remove a named element type.
func (*ElementsType) SetFeaturesPath ¶
func (e *ElementsType) SetFeaturesPath(repoPath string) error
SetFeaturesPath defines where a features repository is located like `jenkins-install-inits`
func (*ElementsType) SetFeaturesRepoURL ¶
func (e *ElementsType) SetFeaturesRepoURL(repoURL string) error
SetFeaturesRepoURL validate and store the repoURL It can be executed several times to store multiple URLs
func (*ElementsType) SetLocal ¶
func (e *ElementsType) SetLocal()
SetLocal set the useLocal to true When set to true, jplugin do not clone a remote repo URL to store on cache
func (*ElementsType) SetRepository ¶
func (e *ElementsType) SetRepository(ref *Repository)
SetRepository set a Repository object to the Elementstype object.
func (*ElementsType) UpdateElement ¶
func (e *ElementsType) UpdateElement(curElement, newElement Element) (updated bool, err error)
UpdateElement the new element to the collection, then add their dependencies if noDeps is false.
func (*ElementsType) WriteSimple ¶
func (e *ElementsType) WriteSimple(file string, cols int) (err error)
WriteSimple the list of plugins as Simple format
type Feature ¶
type Feature struct { Version string // contains filtered or unexported fields }
Feature describe details on Feature.
func (*Feature) AddDependencyTo ¶
func (*Feature) AsNewGrooviesStatusDetails ¶
func (p *Feature) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)
func (*Feature) AsNewPluginsStatusDetails ¶
func (p *Feature) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)
func (*Feature) ChainElement ¶
func (p *Feature) ChainElement(context *ElementsType) (ret *ElementsType, _ error)
ChainElement load the feature details (groovy and plugins)
func (*Feature) CompleteFromContext ¶
func (p *Feature) CompleteFromContext(_ *ElementsType) (_ error)
CompleteFromContext nothing to complete.
func (*Feature) DefineLatestPossibleVersion ¶
func (p *Feature) DefineLatestPossibleVersion(context *ElementsType) (_ error)
func (*Feature) GetDependencies ¶
GetDependencies return the list of features depedencies required by this feature.
func (*Feature) GetDependenciesFromContext ¶
func (p *Feature) GetDependenciesFromContext(*ElementsType) (_ Elements)
GetDependenciesFromContext return the list of features depedencies required by this feature.
func (*Feature) GetParents ¶
GetParents return the list of features which depends on this feature.
func (*Feature) GetVersion ¶
func (p *Feature) GetVersion() (_ VersionStruct, _ error)
GetVersion return the plugin Version struct.
func (*Feature) IsVersionCandidate ¶
IsVersionCandidate return true systematically
func (*Feature) Merge ¶
Merge execute a merge between 2 features and keep the one corresponding to the constraint given It is based on 3 policies: choose oldest, keep existing and choose newest
func (*Feature) RemoveDependencyTo ¶
func (*Feature) SetVersionConstraintFromDepConstraint ¶
func (p *Feature) SetVersionConstraintFromDepConstraint(*ElementsType, Element) (_ error)
SetVersionConstraintFromDepConstraint add a constraint to match the dependency version constraints
type Groovy ¶
type Groovy struct { Version string ShortName string Dependencies string Description string CommitID string Md5 string // contains filtered or unexported fields }
Groovy describe details on Groovy.
func (*Groovy) AddDependencyTo ¶
func (*Groovy) AsNewGrooviesStatusDetails ¶
func (p *Groovy) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)
AsNewGrooviesStatusDetails add the current groovy as a NEW groovy in statusDetails
func (*Groovy) AsNewPluginsStatusDetails ¶
func (p *Groovy) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)
AsNewPluginsStatusDetails to be replaced by a renamed version.
func (*Groovy) ChainElement ¶
func (p *Groovy) ChainElement(*ElementsType) (_ *ElementsType, _ error)
ChainElement do nothing for a Groovy object
func (*Groovy) CompleteFromContext ¶
func (p *Groovy) CompleteFromContext(context *ElementsType) (err error)
CompleteFromContext nothing to complete.
func (*Groovy) DefineLatestPossibleVersion ¶
func (p *Groovy) DefineLatestPossibleVersion(context *ElementsType) (_ error)
func (*Groovy) GetDependencies ¶
GetDependencies return the list of features depedencies required by this feature.
func (*Groovy) GetDependenciesFromContext ¶
func (p *Groovy) GetDependenciesFromContext(*ElementsType) (_ Elements)
GetDependenciesFromContext return the list of features depedencies required by this feature.
func (*Groovy) GetParents ¶
GetParents return the list of features which depends on this feature.
func (*Groovy) GetVersion ¶
func (p *Groovy) GetVersion() (_ VersionStruct, _ error)
GetVersion return the plugin Version struct.
func (*Groovy) IsVersionCandidate ¶
IsVersionCandidate return true systematically
func (*Groovy) Merge ¶
Merge execute a merge between 2 groovies and keep the one corresponding to the constraint given It is based on 3 policies: choose oldest, keep existing and choose newest
func (*Groovy) RemoveDependencyTo ¶
func (*Groovy) SetVersionConstraintFromDepConstraint ¶
func (p *Groovy) SetVersionConstraintFromDepConstraint(*ElementsType, Element) (_ error)
SetVersionConstraintFromDepConstraint add a constraint to match the dependency version constraints
type GroovyStatusDetails ¶
type GroovyStatusDetails struct {
// contains filtered or unexported fields
}
GroovyStatusDetails contains groovy update status
type JenkinsHome ¶
type JenkinsHome struct {
// contains filtered or unexported fields
}
JenkinsHome represents the Jenkins home where we install or identify plugins
func NewJenkinsHome ¶
func NewJenkinsHome(jenkinsHomePath string) (ret *JenkinsHome)
NewJenkinsHome creates a new JenkinsHome object
func (*JenkinsHome) GetPlugins ¶
func (j *JenkinsHome) GetPlugins() (elements *ElementsType, _ error)
GetPlugins read the list of plugins in Jenkins and load them in a Plugins object
func (*JenkinsHome) Install ¶
func (j *JenkinsHome) Install(elements *ElementsType, featureRepoPath string) error
Install execute an installation of plugins/groovies to the right path.
func (*JenkinsHome) IsValid ¶
func (j *JenkinsHome) IsValid() bool
IsValid is true if Jenkins home and sub
type Plugin ¶
type Plugin struct { Version string `yaml:"Plugin-Version"` ExtensionName string `yaml:"Extension-Name"` ShortName string `yaml:"Short-Name"` JenkinsVersion string `yaml:"Jenkins-Version"` LongName string `yaml:"Long-Name"` Dependencies string `yaml:"Plugin-Dependencies"` Description string `yaml:"Specification-Title"` // contains filtered or unexported fields }
Plugin describe details on Plugin element. By default, it helps reading the MANIFEST.MF from java as a yaml file, cleaned before.
func (*Plugin) AddDependencyTo ¶
AddDependencyTo creates the bi-directionnel dependency
func (*Plugin) AsNewGrooviesStatusDetails ¶
func (p *Plugin) AsNewGrooviesStatusDetails(context *ElementsType) (sd *GroovyStatusDetails)
AsNewGrooviesStatusDetails to be removed.
func (*Plugin) AsNewPluginsStatusDetails ¶
func (p *Plugin) AsNewPluginsStatusDetails(context *ElementsType) (sd *pluginsStatusDetails)
AsNewPluginsStatusDetails return a PluginsStatusDetails object from this plugin, considered as new.
func (*Plugin) ChainElement ¶
func (p *Plugin) ChainElement(context *ElementsType) (ret *ElementsType, _ error)
ChainElement load plugins dependency tree from the repo
The constraint is added as expected, but the version is the highest possible. (latest)
func (*Plugin) CompleteFromContext ¶
func (p *Plugin) CompleteFromContext(context *ElementsType) (err error)
CompleteFromContext update the plugin information from repo DB if found
func (*Plugin) DefineLatestPossibleVersion ¶
func (p *Plugin) DefineLatestPossibleVersion(context *ElementsType) (_ error)
DefineLatestPossibleVersion check on version history which latest version is possible from version rules given.
func (*Plugin) GetDependencies ¶
GetDependencies return the list of plugins depedencies required by this plugin.
func (*Plugin) GetDependenciesFromContext ¶
func (p *Plugin) GetDependenciesFromContext(context *ElementsType) Elements
GetDependenciesFromContext return the list of plugins depedencies required by this plugin. Required when elements were simply listed by ChainElements to update their dependencies
func (*Plugin) GetParents ¶
GetParents return the list of plugins which depends on this plugin.
func (*Plugin) GetVersion ¶
func (p *Plugin) GetVersion() (ret VersionStruct, err error)
GetVersion return the plugin Version struct.
func (*Plugin) GetVersionString ¶
GetVersionString return the plugin value as string.
func (*Plugin) IsVersionCandidate ¶
IsVersionCandidate return true if version given respect the rule
func (*Plugin) Merge ¶
func (p *Plugin) Merge(context *ElementsType, element Element, policy int) (updated bool, err error)
Merge execute a merge between 2 plugins and keep the one corresponding to the constraint given It is based on 3 policies: choose oldest, keep existing and choose newest
func (*Plugin) RemoveDependencyTo ¶
RemoveDependencyTo remove a bi-directionnel dependency
func (*Plugin) SetFrom ¶
SetFrom set data from an array of fields If the version is given, it will be interpreted as a constraint
func (*Plugin) SetVersionConstraintFromDepConstraint ¶
func (p *Plugin) SetVersionConstraintFromDepConstraint(context *ElementsType, depElement Element) (err error)
SetVersionConstraintFromDepConstraint add a constraint to match the dependency version constraints on plugins parent dependencies
This function check parent plugin of the dependency given to change version constraint if needed.
type Plugins ¶
type Plugins struct {
// contains filtered or unexported fields
}
Plugins contains a collection of plugins manifest. (see ElementManifest)
func (*Plugins) AddSupport ¶
func (p *Plugins) AddSupport(name string, set func(data []string) (string, *ElementManifest))
AddSupport register a set function for a data type given
func (*Plugins) AddSupportGroovy ¶
func (p *Plugins) AddSupportGroovy()
AddSupportGroovy define how groovy type data is extracted
func (*Plugins) AddSupportPlugin ¶
func (p *Plugins) AddSupportPlugin(repoGet func(name string) (*RepositoryPlugin, bool))
AddSupportPlugin define how plugin type data is extracted.
func (*Plugins) ExtractTopElements ¶
ExtractTopElements identifies top plugins (remove all dependencies)
func (*Plugins) PrintOut ¶
func (p *Plugins) PrintOut(printDetails func(element *ElementManifest))
PrintOut loop on plugins to display them
type PluginsExport ¶
type PluginsExport struct {
// contains filtered or unexported fields
}
func NewPluginsExport ¶
func NewPluginsExport(exportFile, templateFile string, size int) (ret *PluginsExport)
func (*PluginsExport) DoItOn ¶
func (e *PluginsExport) DoItOn(list *PluginsStatus) (err error)
type PluginsStatus ¶
type PluginsStatus struct { PluginsStatus map[string]*pluginsStatusDetails // contains filtered or unexported fields }
PluginsStatus represents the jenkins update status
func NewPluginsStatus ¶
func NewPluginsStatus(installed *ElementsType, ref *Repository) (pluginsCompared *PluginsStatus)
NewPluginsStatus creates an a plugin update status with a Ref repository
func (*PluginsStatus) AddElement ¶
func (s *PluginsStatus) AddElement(element Element, old bool) (err error)
AddElement register an element version (plugin or groovy) as an old or new element
TODO: replace switch by Element interface.
func (*PluginsStatus) AddGroovyStatus ¶
func (s *PluginsStatus) AddGroovyStatus(groovy *Groovy, old bool) (_ error)
AddGroovyStatus register the groovy commitID as an old or new groovy commit
TODO: replace switch by Element interface.
func (*PluginsStatus) AddPluginStatus ¶
func (s *PluginsStatus) AddPluginStatus(plugin *Plugin, old bool) (_ error)
AddPluginStatus register the plugin version as an old or new plugin
TODO: replace switch by Element interface.
func (*PluginsStatus) CheckElementLine ¶
func (s *PluginsStatus) CheckElementLine(line string, split func(string, string, string))
CheckElementLine analyzes a line and split with the split function.
func (*PluginsStatus) CheckFeature ¶
func (s *PluginsStatus) CheckFeature(name string) (_ error)
func (*PluginsStatus) CheckGroovy ¶
func (s *PluginsStatus) CheckGroovy(name, groovyPath string) error
func (*PluginsStatus) CheckMinDep ¶
func (s *PluginsStatus) CheckMinDep() (_ bool)
func (*PluginsStatus) CheckPlugin ¶
func (s *PluginsStatus) CheckPlugin(name, versionConstraints string, parentDependency *pluginsStatusDetails) error
func (*PluginsStatus) Compare ¶
func (s *PluginsStatus) Compare() (_ error)
Compare only plugins against repository. TODO: Compare groovies
func (*PluginsStatus) DefinePluginsVersion ¶
func (s *PluginsStatus) DefinePluginsVersion() (_ bool)
DefinePluginsVersion will apply latest version of each plugin except if jplugins.lst or *.desc apply a constraints
func (*PluginsStatus) DisplayUpdates ¶
func (s *PluginsStatus) DisplayUpdates() (_ bool)
DisplayUpdates show updates as result
func (*PluginsStatus) ImportInstalled ¶
func (s *PluginsStatus) ImportInstalled(elements *ElementsType)
ImportInstalled import a list of plugins considered as pre-installed It stores the list of plugins and constraints '>=' in the structure, so those plugins are installed at minimum to that list.
func (*PluginsStatus) NewInstall ¶
func (s *PluginsStatus) NewInstall()
NewInstall consider the installed list as newly installed. So, the display updates will display it all when we newly install it.
func (*PluginsStatus) PluginsLength ¶
func (s *PluginsStatus) PluginsLength() int
PluginsLength return the number of plugins candidate for updates
func (*PluginsStatus) SetFeaturesPath ¶
func (s *PluginsStatus) SetFeaturesPath(repoPath string) error
SetFeaturesPath defines where a features repository is located like `jenkins-install-inits`
func (*PluginsStatus) SetFeaturesRepoURL ¶
func (s *PluginsStatus) SetFeaturesRepoURL(repoURL string) error
SetFeaturesRepoURL validate and store the repoURL It can be executed several times to store multiple URLs
func (*PluginsStatus) SetLocal ¶
func (s *PluginsStatus) SetLocal()
SetLocal set the useLocal to true When set to true, jplugin do not clone a remote repo URL to store on cache
func (*PluginsStatus) WriteSimple ¶
func (s *PluginsStatus) WriteSimple(file string) (err error)
WriteSimple write list of plugins and groovies in a simple file format.
type Repository ¶
type Repository struct { RepositoryPlugins // Loaded from json with LoadFromURL and JenkinsRepoFile // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository() (ret *Repository)
func (*Repository) Compare ¶
func (r *Repository) Compare(elements *ElementsType) (updates *PluginsStatus)
Compare creates a PluginsStatus which store old and new version of each elements.
func (*Repository) Get ¶
func (r *Repository) Get(pluginRequested ...string) (plugin *RepositoryPlugin, found bool)
Get return the plugin requested (name with or without version) as described by Jenkins updates.
If the version is defined but not found, it will return the closest higher version matching this unknown version
func (*Repository) GetOrderedVersions ¶
func (r *Repository) GetOrderedVersions(name string) (ret goversion.Collection)
GetOrderedVersions return the list of a plugin version for a given plugin ordered from latest to oldest.
func (*Repository) GetVersions ¶
func (r *Repository) GetVersions(name string) (_ map[string]*RepositoryPlugin)
GetVersions return the list of a plugin version for a given plugin
func (*Repository) LoadFromURL ¶
func (r *Repository) LoadFromURL() (_ bool)
LoadFromURL read an URL file containing the Jenkins updates repository data as json.
type RepositoryDependencies ¶
type RepositoryDependencies []RepositoryDependency
RepositoryDependencies is a array of dependencies
func (RepositoryDependencies) GetVersion ¶
func (r RepositoryDependencies) GetVersion(name string) *goversion.Version
GetVersion return the dependency version of a given plugin name.
type RepositoryDependency ¶
type RepositoryPlugin ¶
type RepositoryPlugin struct { Dependencies RepositoryDependencies Name string Version string Title string Description string `json:"excerpt"` JenkinsVersion string `json:"requiredCore"` Sha256Version string `json:"sha256"` // contains filtered or unexported fields }
RepositoryPlugin define the plugin from the referenced repository
func (*RepositoryPlugin) DetermineVersion ¶
func (p *RepositoryPlugin) DetermineVersion(plugin *pluginsStatusDetails) (version VersionStruct, latest bool, err error)
DetermineVersion select the appropriate version of a plugin depending on constraints.
func (*RepositoryPlugin) GetVersion ¶
func (p *RepositoryPlugin) GetVersion() (ret VersionStruct, err error)
GetVersion returns a version struct of the plugin.
type RepositoryPlugins ¶
type RepositoryPlugins struct {
Plugins map[string]*RepositoryPlugin
}
type RepositoryPluginsHistory ¶
type RepositoryPluginsHistory struct {
Plugins map[string]map[string]*RepositoryPlugin
}
RepositoryHistory is the plugin-versions.json data representation
type VersionStruct ¶
type VersionStruct struct {
// contains filtered or unexported fields
}
func (VersionStruct) Get ¶
func (v VersionStruct) Get() (ret *goversion.Version)
func (*VersionStruct) Set ¶
func (v *VersionStruct) Set(value string) (err error)
func (VersionStruct) String ¶
func (v VersionStruct) String() string
Source Files ¶
- element-collection.go
- element-manifest.go
- element.go
- elements.go
- elements_type.go
- feature.go
- groovy-status-details.go
- groovy.go
- jenkins-home.go
- plugin-json.go
- plugin.go
- plugins-export.go
- plugins-json.go
- plugins-status-details.go
- plugins-status.go
- plugins.go
- plugins_extract.go
- repository-dependencies.go
- repository-plugin.go
- repository.go
- version-struct.go