Mage targets for faster development workflow#4731
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
axw
left a comment
There was a problem hiding this comment.
Looks useful!
The main thing I'm not too happy about is that this adds dependencies to the main go.mod and consequently modifies NOTICE.txt. End-users shouldn't really be affected by this.
Could we do this as a couple of bash scripts instead? The QuickPackage target should be as simple as this:
#!/bin/bash
set -xe
version=$(mage QualifiedVersion)
builddir=build/distributions/apm-server-$version-linux-x86_64
mkdir -p $builddir
cp -f LICENSE.txt NOTICE.txt README.md apm-server.yml $builddir
GOOS=linux go build -o $builddir/apm-server ./x-pack/apm-server
tar cvzf $builddir.tar.gz $builddir(Requires the addition of a mage target called "QualifiedVersion" to magefile.go for printing out mage.BeatQualifiedVersion))
The RunAgent target looks like it should be doable by invoking the docker CLI, but I haven't pored over it so maybe I missed something.
magefile.go
Outdated
| err = sh.Run("tar", "cvf", buildDir+".tar", buildDir) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| err = sh.Run("gzip", buildDir+".tar") | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
| err = sh.Run("tar", "cvf", buildDir+".tar", buildDir) | |
| if err != nil { | |
| return err | |
| } | |
| err = sh.Run("gzip", buildDir+".tar") | |
| if err != nil { | |
| return err | |
| } | |
| err = sh.Run("tar", "cvzf", buildDir+".tar.gz", buildDir) | |
| if err != nil { | |
| return err | |
| } |
That seems so much easier... 😅 🤦 |
axw
left a comment
There was a problem hiding this comment.
Much simpler :)
Looks good, please revert NOTICE.txt and go.sum changes.
|
doh, I thought |
axw
left a comment
There was a problem hiding this comment.
Not sure why there are whitespace changes to NOTICE.txt -- probably should be reverted? Otherwise LGTM
I don't know either, but since they are removed it seems more correct like this? |
Only if it doesn't break automation (doesn't seem to have? I'm surprised). I'm not bothered otherwise. |
…chemas-to-agents * upstream/master: (111 commits) Introduce metricset.name (elastic#4857) processor/otel: test service.version handling (elastic#4853) docs: Add PHP agent information to shared docs (elastic#4740) Script for faster development workflow (elastic#4731) Update to elastic/beats@1b31c26 (elastic#4763) backport: add 7.12 to .backportrc.json (elastic#4807) backport: enable auto-merge on backport PRs (elastic#4777) Support for Node.js profiles (elastic#4728) docs: readds .NET link (elastic#4764) [DOCS] Fixes URLs on Secure communication with APM Agents page (elastic#4746) ci: set proper parameters for the tar step (elastic#4696) docs: add 7.11.1 release notes (elastic#4727) Disable sourcemap upload endpoint when data streams enabled (elastic#4735) Add service name to dataset field (elastic#4674) Update to elastic/beats@ba423212a660 (elastic#4733) sampling: require a default policy (elastic#4729) processor/otel: add unit test for span status (elastic#4734) Add support for consuming OTLP/gRPC metrics (elastic#4722) [apmpackage] Add config options supported in ESS (elastic#4690) Use the apm-server version everywhere* (elastic#4725) ...
…te-schema-json-1 * upstream/master: (111 commits) Introduce metricset.name (elastic#4857) processor/otel: test service.version handling (elastic#4853) docs: Add PHP agent information to shared docs (elastic#4740) Script for faster development workflow (elastic#4731) Update to elastic/beats@1b31c26 (elastic#4763) backport: add 7.12 to .backportrc.json (elastic#4807) backport: enable auto-merge on backport PRs (elastic#4777) Support for Node.js profiles (elastic#4728) docs: readds .NET link (elastic#4764) [DOCS] Fixes URLs on Secure communication with APM Agents page (elastic#4746) ci: set proper parameters for the tar step (elastic#4696) docs: add 7.11.1 release notes (elastic#4727) Disable sourcemap upload endpoint when data streams enabled (elastic#4735) Add service name to dataset field (elastic#4674) Update to elastic/beats@ba423212a660 (elastic#4733) sampling: require a default policy (elastic#4729) processor/otel: add unit test for span status (elastic#4734) Add support for consuming OTLP/gRPC metrics (elastic#4722) [apmpackage] Add config options supported in ESS (elastic#4690) Use the apm-server version everywhere* (elastic#4725) ...
Motivation/summary
Adds script to speed up fleet-related development:
run_agent.shbuilds and packages an apm-server binary for Linux, creates a new Elastic Agent container based off the most recent image, mount-binds the apm-server package atdistributions/apm-server-8.0.0-linux-x86_64in theinstalldirectory, connects to theapm-integration-testingnetwork, and runs it.This is useful when a developing a feature that needs to be tested while running under Fleet.