diff options
| author | Shulhan <ms@kilabit.info> | 2022-07-09 13:38:11 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-07-09 13:52:17 +0700 |
| commit | 90de211ecfec1e434949ee1aea00922d5d6b4e5a (patch) | |
| tree | fdd2c4dfe55cf3890bc99eb4263b86fe2956f089 | |
| parent | fddcb64806196a308f04eeb7c6e428e90fbc998e (diff) | |
| download | google-cloud-ops-agent-git-90de211ecfec1e434949ee1aea00922d5d6b4e5a.tar.xz | |
all: add task to build package using devtools
The devtools allow package to build in clean chroot [1].
In this build, we bind the host go, go-build cache, and .gradle cache
to the chroot/build to minimize re-downloading Go and Java dependencies
on the next rebuild.
[1] https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile | 17 |
2 files changed, 18 insertions, 1 deletions
@@ -1,4 +1,6 @@ +*.log *.zst +/_build /collectd /fluent-bit /google-cloud-ops-agent-git @@ -1,4 +1,4 @@ -.PHONY: all check release +.PHONY: all check chrootpkg patch release all: makepkg -sd @@ -6,6 +6,21 @@ all: check: namcap PKGBUILD +## Build the package using devtools. +## +## We bind the host go, go-build cache, and .gradle cache to the chroot/build +## to minimize re-downloading Go and Java dependencies on the next rebuild. +chrootpkg: + mkdir -p $$HOME/go + mkdir -p $$HOME/.cache/go-build + mkdir -p $$HOME/.gradle + mkdir -p _build + mkarchroot _build/root base-devel systemd || exit 0 + makechrootpkg -d $$HOME/go:/build/go \ + -d $$HOME/.cache/go-build:/build/.cache/go-build \ + -d $$HOME/.gradle:/build/.gradle \ + -r _build + patch: git -C src/google-cloud-ops-agent-git diff > 0001-apps-hostmetrics.patch && \ makepkg -g |
