diff --git a/.gitignore b/.gitignore index dc0efee8e25..0ba3cc27b5c 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ html_docs docker-compose.yml.bck Dockerfile.bck version.asciidoc.bck +.imported-java-agent-pubkey diff --git a/Makefile b/Makefile index 4777b6d6173..f25c373a30e 100644 --- a/Makefile +++ b/Makefile @@ -260,7 +260,28 @@ release-manager-snapshot: release .PHONY: release-manager-release release-manager-release: release +JAVA_ATTACHER_VERSION:=1.27.0 +JAVA_ATTACHER_JAR:=apm-agent-attach-cli-$(JAVA_ATTACHER_VERSION)-slim.jar +JAVA_ATTACHER_SIG:=$(JAVA_ATTACHER_JAR).asc +JAVA_ATTACHER_BASE_URL:=https://repo1.maven.org/maven2/co/elastic/apm/apm-agent-attach-cli +JAVA_ATTACHER_URL:=$(JAVA_ATTACHER_BASE_URL)/$(JAVA_ATTACHER_VERSION)/$(JAVA_ATTACHER_JAR) +JAVA_ATTACHER_SIG_URL:=$(JAVA_ATTACHER_BASE_URL)/$(JAVA_ATTACHER_VERSION)/$(JAVA_ATTACHER_SIG) + +APM_AGENT_JAVA_PUB_KEY:=apm-agent-java-public-key.asc + +.imported-java-agent-pubkey: + @gpg --import $(APM_AGENT_JAVA_PUB_KEY) + @touch $@ + +build/$(JAVA_ATTACHER_SIG): + curl -sSL $(JAVA_ATTACHER_SIG_URL) > $@ + +build/$(JAVA_ATTACHER_JAR): build/$(JAVA_ATTACHER_SIG) .imported-java-agent-pubkey + curl -sSL $(JAVA_ATTACHER_URL) > $@ + gpg --verify $< $@ + @cp $@ build/java-attacher.jar + .PHONY: release release: export PATH:=$(dir $(BIN_MAGE)):$(PATH) -release: $(MAGE) +release: $(MAGE) build/$(JAVA_ATTACHER_JAR) $(MAGE) package diff --git a/apm-agent-java-public-key.asc b/apm-agent-java-public-key.asc new file mode 100644 index 00000000000..1376947a9b9 --- /dev/null +++ b/apm-agent-java-public-key.asc @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BL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m8cD+hp +lnpU+PBQZJ5XJ2I+1l9Nixx47wPGXeClLqcdn0ayd+v+Rwf3/XUJrvccG2YZUiQ4jWZkoxsA +07xx7Bj+Lt8/FKG7sHRFvePFU0ZS6JFx9GJqjSBbHRRkam+4emW3uWgVfZxuwcUCn1ayNgRt +KiFv9jQrg2TIWEvzYx9tywTCxc+FFMWAlbCzi+m4WD+QUWWfDQ009U/WM0ks0KwwEwSk/UDu +ToxGnKU2dQARAQABiQEfBBgBAgAJBQJSNx7KAhsMAAoJENJ9ZmzYjkK0c3MIAIE9hAR20mqJ +WLcsxLtrRs6uNF1VrpB+4n/55QU7oxA1iVBO6IFu4qgsF12JTavnJ5MLaETlggXY+zDef9sy +TPXoQctpzcaNVDmedwo1SiL03uMoblOvWpMR/Y0j6rm7IgrMWUDXDPvoPGjMl2q1iTeyHkMZ +EyUJ8SKsaHh4jV9wp9KmC8C+9CwMukL7vM5w8cgvJoAwsp3Fn59AxWthN3XJYcnMfStkIuWg +R7U2r+a210W6vnUxU4oN0PmMcursYPyeV0NX/KQeUeNMwGTFB6QHS/anRaGQewijkrYYoTNt +fllxIu9XYmiBERQ/qPDlGRlOgVTd9xUfHFkzB52c70E= +=92oX +-----END PGP PUBLIC KEY BLOCK----- diff --git a/changelogs/head.asciidoc b/changelogs/head.asciidoc index dd8dcb32db3..8f68b3510a5 100644 --- a/changelogs/head.asciidoc +++ b/changelogs/head.asciidoc @@ -65,6 +65,7 @@ https://github.com/elastic/apm-server/compare/7.15\...master[View commits] - Added support for gzip compression to the experimental Elasticsearch output {pull}6449[6449] - Introduced a delete phase for all data streams. Traces, errors and logs are kept for 10 days, metrics are kept for 90 days {pull}6480[6480] - Changed RUM traces to use a dedicated data stream (`traces-apm.rum`). RUM traces are kept for 90 days {pull}6480[6480] +- `apm-server` artifacts now have the apm java-attacher.jar packaged alongside them {pull}6593[6593] - When `auth.anonymous.enabled` isn't specified and RUM is enabled (`rum.enabled:true`), `auth.anonymous.enabled` will be set to `true` {pull}6607[6607] [float] diff --git a/magefile.go b/magefile.go index 416514de5d6..a623b927b9a 100644 --- a/magefile.go +++ b/magefile.go @@ -346,11 +346,12 @@ func customizePackaging() { switch pkgType := args.Types[0]; pkgType { case mage.Zip, mage.TarGz: - // No changes required. + args.Spec.Files["java-attacher.jar"] = mage.PackageFile{Mode: 0750, Source: "build/java-attacher.jar", Owner: mage.BeatUser} case mage.Docker: args.Spec.ExtraVars["expose_ports"] = config.DefaultPort args.Spec.ExtraVars["repository"] = "docker.elastic.co/apm" + args.Spec.Files["java-attacher.jar"] = mage.PackageFile{Mode: 0750, Source: "build/java-attacher.jar", Owner: mage.BeatUser} case mage.Deb, mage.RPM: // Update config file owner. @@ -358,6 +359,7 @@ func customizePackaging() { pf.Owner = mage.BeatUser args.Spec.Files["/etc/{{.BeatName}}/{{.BeatName}}.yml"] = pf args.Spec.Files["/var/log/{{.BeatName}}"] = mage.PackageFile{Mode: 0750, Source: emptyDir, Owner: mage.BeatUser} + args.Spec.Files["/usr/share/{{.BeatName}}/bin/java-attacher.jar"] = mage.PackageFile{Mode: 0750, Source: "build/java-attacher.jar", Owner: mage.BeatUser} // Customise the pre-install and post-install scripts. args.Spec.PreInstallScript = "packaging/files/linux/pre-install.sh.tmpl"