install

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:    "install",
	Short:  "Install New Relic.",
	Hidden: true,
	Run: func(cmd *cobra.Command, args []string) {
		ic := InstallerContext{
			RecipePaths:        recipePaths,
			RecipeNames:        recipeNames,
			SkipDiscovery:      skipDiscovery,
			SkipInfraInstall:   skipInfraInstall,
			SkipIntegrations:   skipIntegrations,
			SkipLoggingInstall: skipLoggingInstall,
		}

		client.WithClientAndProfile(func(nrClient *newrelic.NewRelic, profile *credentials.Profile) {
			err := assertProfileIsValid(profile)
			if err != nil {
				log.Fatal(err)
			}

			i := NewRecipeInstaller(ic, nrClient)

			if err := i.Install(); err != nil {
				log.Fatalf("Could not install New Relic: %s", err)
			}
		})
	},
}

Command represents the install command.

View Source
var TestCommand = &cobra.Command{
	Use:    "installTest",
	Short:  "Run a UX test of the install command.",
	Hidden: true,
	Run: func(cmd *cobra.Command, args []string) {
		ic := InstallerContext{
			RecipePaths:        recipePaths,
			RecipeNames:        recipeNames,
			SkipDiscovery:      skipDiscovery,
			SkipInfraInstall:   skipInfraInstall,
			SkipIntegrations:   skipIntegrations,
			SkipLoggingInstall: skipLoggingInstall,
		}

		b := NewScenarioBuilder(ic)
		i := b.BuildScenario(TestScenario(testScenario))

		if i == nil {
			log.Fatalf("Scenario %s is not valid.  Valid values are %s", testScenario, strings.Join(TestScenarioValues(), ","))
		}

		if err := i.Install(); err != nil {
			log.Fatalf("test failed: %s", err)
		}
	},
}

TestCommand represents the test command for the install command.

View Source
var (
	TestScenarios = []TestScenario{
		Basic,
	}
)

Functions

func TestScenarioValues

func TestScenarioValues() []string

Types

type InstallerContext

type InstallerContext struct {
	SkipDiscovery      bool
	SkipLoggingInstall bool
	SkipInfraInstall   bool
	SkipIntegrations   bool
	RecipeNames        []string
	RecipePaths        []string
}

func (*InstallerContext) RecipeNamesProvided

func (i *InstallerContext) RecipeNamesProvided() bool

func (*InstallerContext) RecipePathsProvided

func (i *InstallerContext) RecipePathsProvided() bool

func (*InstallerContext) RecipesProvided

func (i *InstallerContext) RecipesProvided() bool

func (*InstallerContext) ShouldInstallInfraAgent

func (i *InstallerContext) ShouldInstallInfraAgent() bool

func (*InstallerContext) ShouldInstallIntegrations

func (i *InstallerContext) ShouldInstallIntegrations() bool

func (*InstallerContext) ShouldInstallLogging

func (i *InstallerContext) ShouldInstallLogging() bool

func (*InstallerContext) ShouldRunDiscovery

func (i *InstallerContext) ShouldRunDiscovery() bool

type RecipeInstaller

type RecipeInstaller struct {
	InstallerContext
	// contains filtered or unexported fields
}

func NewRecipeInstaller

func NewRecipeInstaller(ic InstallerContext, nrClient *newrelic.NewRelic) *RecipeInstaller

func (*RecipeInstaller) Install

func (i *RecipeInstaller) Install() error

type ScenarioBuilder

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

func NewScenarioBuilder

func NewScenarioBuilder(ic InstallerContext) *ScenarioBuilder

func (*ScenarioBuilder) Basic

func (b *ScenarioBuilder) Basic() *RecipeInstaller

func (*ScenarioBuilder) BuildScenario

func (b *ScenarioBuilder) BuildScenario(s TestScenario) *RecipeInstaller

type TestScenario

type TestScenario string
const (
	Basic TestScenario = "BASIC"
)

Directories

Path Synopsis
Code generated by tutone: DO NOT EDIT
Code generated by tutone: DO NOT EDIT

Jump to

Keyboard shortcuts

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