M APKBUILD => APKBUILD +9 -0
@@ 17,6 17,10 @@ license="MIT"
# !tracedeps — CGO_ENABLED=0 with -tags gms_pure_go, so the binaries are
# static: no ICU, no gozstd, nothing to trace
options="!check !tracedeps"
+# The hook subpackage carries dolt-git-hook alone: it is installed into the
+# git.sr.ht container (as its post-update-script), not the dolt one, and
+# pulling the full service package in there would drag doltsrht along.
+subpackages="$pkgname-hook:hook"
source=""
builddir="$startdir"
@@ 58,3 62,8 @@ package() {
# MIGRATIONDIR and STATICDIR are both derived from SHAREDIR, so they follow.
make install PREFIX="$pkgdir/usr"
}
+
+hook() {
+ pkgdesc="post-update hook that provisions companion Dolt databases (for the git.sr.ht container)"
+ amove usr/bin/dolt-git-hook
+}
M Makefile => Makefile +10 -1
@@ 27,7 27,8 @@ GOBUILD=$(GO) build $(if $(GO_TAGS),-tags "$(GO_TAGS)",)
BINARIES=\
doltsrht \
- doltsrht-migrate
+ doltsrht-migrate \
+ dolt-git-hook
# Default target builds the Go binaries only. CSS (all-share) is deliberately
# kept off the default path because sassc/minify are not always installed on
@@ 58,6 59,14 @@ doltsrht-migrate:
echo "skip $@: ./cmd/doltsrht-migrate not present yet"; \
fi
+dolt-git-hook:
+ @if [ -d ./cmd/dolt-git-hook ]; then \
+ echo "$(GOBUILD) -o $@ ./cmd/dolt-git-hook"; \
+ $(GOBUILD) -o $@ ./cmd/dolt-git-hook; \
+ else \
+ echo "skip $@: ./cmd/dolt-git-hook not present yet"; \
+ fi
+
# Compile every buildable package; used as the CI build gate.
build:
$(GOBUILD) ./...