mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-12 18:26:39 +02:00
67 lines
2 KiB
Text
67 lines
2 KiB
Text
# Contributor: techknowlogick <techknowlogick@gitea.com>
|
|
# Maintainer: techknowlogick <techknowlogick@gitea.com>
|
|
pkgname=ytt
|
|
pkgver=0.47.0
|
|
pkgrel=9
|
|
pkgdesc="YAML templating tool that works on YAML structure instead of text"
|
|
url="https://carvel.dev/ytt/"
|
|
arch="all !armhf !armv7 !x86"
|
|
license="Apache-2.0"
|
|
makedepends="go"
|
|
options="chmod-clean net"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/carvel-dev/ytt/archive/v$pkgver.tar.gz
|
|
0001-e2e-tests.patch"
|
|
|
|
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
|
|
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
|
|
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
|
|
|
|
build() {
|
|
local ldflags="-X github.com/vmware-tanzu/carvel-ytt/pkg/version.Version=$pkgver"
|
|
export GOPATH="$srcdir"
|
|
rm -f website/generated.go
|
|
|
|
go fmt ./cmd/... ./pkg/...
|
|
go mod vendor
|
|
go mod tidy
|
|
|
|
rm -f pkg/website/generated.go
|
|
go build -trimpath -ldflags="$ldflags" -o ytt ./cmd/ytt/...
|
|
./ytt version
|
|
|
|
(
|
|
# Use newly built binary to template all website assets
|
|
# into a single Go file
|
|
cd pkg/website
|
|
./../../ytt \
|
|
-f . \
|
|
-f ../../examples/playground/basics \
|
|
-f ../../examples/playground/overlays \
|
|
-f ../../examples/playground/getting-started \
|
|
--file-mark 'alt-example**/*:type=data' \
|
|
--file-mark 'example**/*:type=data' \
|
|
--file-mark 'generated.go.txt:exclusive-for-output=true' \
|
|
--dangerous-emptied-output-directory ../../tmp/
|
|
)
|
|
mv tmp/generated.go.txt pkg/website/generated.go
|
|
|
|
# Rebuild ytt with website assets
|
|
rm -f ./ytt
|
|
go build -trimpath -ldflags="$ldflags" -o ytt ./cmd/ytt/...
|
|
}
|
|
|
|
check() {
|
|
# disable specific shellcheck test as wordsplitting is wanted
|
|
# shellcheck disable=SC2046
|
|
go test -v $(go list ./...|grep -v yaml.v2) "$@"
|
|
./ytt version
|
|
}
|
|
|
|
package() {
|
|
install -D -m 755 $pkgname "$pkgdir"/usr/bin/$pkgname
|
|
}
|
|
|
|
sha512sums="
|
|
820441b1fa7d3e89213f8187823005a6e1996cd7458f70f36a75bdd6e3bcfb779a95be0bbb7f73b0871e24eba6e5490dca75b51a31e69e037cf45147f34648be ytt-0.47.0.tar.gz
|
|
7e90b64b9f5ed789002f30e1dfbe0c0a8176f1e619c14aa1e9d541359f2f24ff17165785c09b2f7b7bcc21082b568527506c20b6a33987a03f9c88a0c418cfaf 0001-e2e-tests.patch
|
|
"
|