mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-02 14:32:14 +01:00
72 lines
2.1 KiB
Plaintext
72 lines
2.1 KiB
Plaintext
# Contributor: techknowlogick <techknowlogick@gitea.io>
|
|
# Maintainer: techknowlogick <techknowlogick@gitea.io>
|
|
pkgname=ytt
|
|
pkgver=0.35.1
|
|
pkgrel=0
|
|
pkgdesc="YAML templating tool that works on YAML structure instead of text"
|
|
url="https://get-ytt.io/"
|
|
arch="all !armhf !armv7 !x86 !mips !mips64"
|
|
license="Apache-2.0"
|
|
makedepends="go"
|
|
options="chmod-clean net"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/vmware-tanzu/carvel-ytt/archive/v$pkgver.tar.gz
|
|
0001-e2e-tests.patch"
|
|
builddir="$srcdir/src/github.com/k14s/$pkgname"
|
|
|
|
prepare() {
|
|
mkdir -p ${builddir%/*}
|
|
mv "$srcdir"/carvel-$pkgname-$pkgver "$builddir"/
|
|
default_prepare
|
|
}
|
|
|
|
build() {
|
|
local ldflags="-w -s -X github.com/k14s/ytt/pkg/version.Version=$pkgver"
|
|
export GOPATH="$srcdir"
|
|
export CGO_ENABLED=0
|
|
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="
|
|
4c681578cdfe3f57c20a0dc8c233e0682053ec24619352ac70675bb048bc4772cfc3a028fa07118173d32c1b6a5a8890ab1b83334ef3b44c857c6aed5c66d317 ytt-0.35.1.tar.gz
|
|
7e90b64b9f5ed789002f30e1dfbe0c0a8176f1e619c14aa1e9d541359f2f24ff17165785c09b2f7b7bcc21082b568527506c20b6a33987a03f9c88a0c418cfaf 0001-e2e-tests.patch
|
|
"
|