summaryrefslogtreecommitdiff
path: root/testing/flux/APKBUILD
blob: 755e4772b14a3a519dc5af292af7a77af0af3372 (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
50
51
52
53
54
55
56
57
58
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=flux
pkgver=2.2.3
pkgrel=1
pkgdesc="Open and extensible continuous delivery solution for Kubernetes"
url="https://fluxcd.io/"
arch="all"
license="Apache-2.0"
makedepends="go bash kustomize"
subpackages="
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="https://github.com/fluxcd/flux2/archive/v$pkgver/flux-$pkgver.tar.gz"
builddir="$srcdir/flux2-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

# secfixes:
#   0.36.0-r0:
#     - CVE-2022-39272

build() {
	bash ./manifests/scripts/bundle.sh

	go build -v \
		-ldflags "-X main.VERSION=$pkgver" \
		./cmd/flux

	for shell in bash fish zsh; do
		./$pkgname completion $shell > $pkgname.$shell
	done
}

check() {
	# e2e tests require a Kubernetes cluster
	# /cmd/flux tests try to spawn a local Kubernetes cluster
	# shellcheck disable=2046
	go test -tags=unit $(go list ./... | grep -v /cmd/flux)
}

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

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

sha512sums="
5f263cb64b164967b5f66ed150384ab518783304d46e641cda048704a9cc91e011299d007e3734c18b71b660e694609a5ab16e9699ac55901d205fead4a86840  flux-2.2.3.tar.gz
"