diff options
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 43 | ||||
-rw-r--r-- | service | 11 |
4 files changed, 70 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d99de8800d1b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,14 @@ +pkgbase = cloudprober + pkgdesc = An active monitoring software to detect failures before your customers do. + pkgver = 0.12.6 + pkgrel = 1 + url = https://cloudprober.org + arch = x86_64 + license = Apache + makedepends = go + source = git+https://github.com/cloudprober/cloudprober#commit=e441335ed11f4aec93becee7d8d290b1d80ef781 + source = service + sha256sums = SKIP + sha256sums = SKIP + +pkgname = cloudprober diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..5964619aae98 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Cloudprober Git repository +/cloudprober/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..51c75d9c6173 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Franklin Yu <franklinyu@google.com> +pkgname=cloudprober +pkgver=0.12.6 +pkgrel=1 +pkgdesc='An active monitoring software to detect failures before your customers do.' +arch=(x86_64) +url="https://cloudprober.org" +license=(Apache) +makedepends=(go) +_commit='e441335ed11f4aec93becee7d8d290b1d80ef781' # v0.12.6 +source=("git+https://github.com/cloudprober/$pkgname#commit=$_commit" 'service') +sha256sums=(SKIP SKIP) + +build() { + cd "$pkgname" + local ld_flags=( + -X main.version=$pkgver + -X main.buildTimestamp=$SOURCE_DATE_EPOCH + ) + local go_flags=( + --buildmode=pie + --mod=readonly + --modcacherw + --trimpath + + # The values are used in the binary; see the upstream Makefile. + --ldflags="${ld_flags[*]}" + ) + CGO_ENABLED=0 go build "${go_flags[@]}" "./cmd/$pkgname.go" +} + +check() { + cd "$pkgname" + # See https://github.com/cloudprober/cloudprober/issues/324 + # TODO: remove “TestK8STokenSource” in next release + go test --skip='TestConnectFailures|TestK8STokenSource' ./... +} + +package() { + install -D --mode=755 "$pkgname/$pkgname" "$pkgdir/usr/bin/$pkgname" + install -D --mode=644 ../service \ + "$pkgdir/usr/lib/systemd/system/$pkgname.service" +} diff --git a/service b/service new file mode 100644 index 000000000000..59d6913d8aad --- /dev/null +++ b/service @@ -0,0 +1,11 @@ +[Unit] +Description = Cloudprober daemon +After = network.target +AssertPathExists = /etc/cloudprober.textproto + +[Service] +ExecStart = /usr/bin/cloudprober --config_file=/etc/cloudprober.textproto +Restart = always + +[Install] +WantedBy = multi-user.target |