summaryrefslogtreecommitdiff
path: root/testing/kind/APKBUILD
blob: 757f9bb2a1f3d2e0a75a4b69c398f622c15606fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=kind
pkgver=0.15.0
pkgrel=0
pkgdesc="Kubernetes IN Docker - local clusters for testing Kubernetes"
url="https://kind.sigs.k8s.io/"
license="Apache-2.0"
arch="all"
makedepends="go"
subpackages="
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="https://github.com/kubernetes-sigs/kind/archive/v$pkgver/kind-$pkgver.tar.gz"

export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
export CGO_ENABLED=0
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build

	./kind completion bash > $pkgname.bash
	./kind completion fish > $pkgname.fish
	./kind completion zsh > $pkgname.zsh
}

check() {
	# skip tests that require a running Docker daemon
	local packages="$(go list ./... | \
		grep -v "sigs.k8s.io/kind/pkg/cluster/internal/providers/docker")"
	go test $packages
}

package() {
	install -Dm755 kind -t "$pkgdir"/usr/bin

	install -Dm644 $pkgname.bash "$pkgdir"/usr/share/bash-completion/completions/$pkgname
	install -Dm644 $pkgname.fish "$pkgdir"/usr/share/fish/completions/$pkgname.fish
	install -Dm644 $pkgname.zsh "$pkgdir"/usr/share/zsh/site-functions/_$pkgname
}

sha512sums="
e74fe945834566e13e84fcb6c12d9cbab48e9d17fa1aa70f2727af22c93f6732c5e7c2570fe4bbf1a0d7a906a256f1b9584fcf3bd44812e80e818cac93949823  kind-0.15.0.tar.gz
"