Skip to content

Commit

Permalink
[Ingest Manager] Enabled dev builds (elastic#21241)
Browse files Browse the repository at this point in the history
[Ingest Manager] Enabled dev builds (elastic#21241)
  • Loading branch information
michalpristas authored Sep 24, 2020
1 parent cb63be2 commit dcee412
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions x-pack/elastic-agent/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,36 @@ type Format mg.Namespace
// Demo runs agent out of container.
type Demo mg.Namespace

// Dev runs package and build for dev purposes.
type Dev mg.Namespace

// Env returns information about the environment.
func (Prepare) Env() {
mg.Deps(Mkdir("build"), Build.GenerateConfig)
RunGo("version")
RunGo("env")
}

// Build builds the agent binary with DEV flag set.
func (Dev) Build() {
dev := os.Getenv(devEnv)
defer os.Setenv(devEnv, dev)

os.Setenv(devEnv, "true")
devtools.DevBuild = true
mg.Deps(Build.All)
}

// Package packages the agent binary with DEV flag set.
func (Dev) Package() {
dev := os.Getenv(devEnv)
defer os.Setenv(devEnv, dev)

os.Setenv(devEnv, "true")
devtools.DevBuild = true
Package()
}

// InstallGoLicenser install go-licenser to check license of the files.
func (Prepare) InstallGoLicenser() error {
return GoGet(goLicenserRepo)
Expand Down
5 changes: 5 additions & 0 deletions x-pack/elastic-agent/pkg/agent/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors"
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/cli"
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger"
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/release"
)

func newRunCommandWithArgs(flags *globalFlags, _ []string, streams *cli.IOStreams) *cobra.Command {
Expand Down Expand Up @@ -82,6 +83,10 @@ func run(flags *globalFlags, streams *cli.IOStreams) error { // Windows: Mark se
return err
}

if allowEmptyPgp, _ := release.PGP(); allowEmptyPgp {
logger.Warn("Artifact has been build with security disabled. Elastic Agent will not verify signatures of used artifacts.")
}

execPath, err := os.Executable()
if err != nil {
return err
Expand Down

0 comments on commit dcee412

Please sign in to comment.