aboutsummaryrefslogtreecommitdiffstats
path: root/community/nomad/APKBUILD
blob: bb6ca2bd499ebe62d34c91b89982d516285d2ee5 (plain) (blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Contributor: Matthias Neugebauer <mtneug@mailbox.org>
# Contributor: omni <omni+alpine@hack.org>
# Maintainer: Matthias Neugebauer <mtneug@mailbox.org>
pkgname=nomad
pkgver=1.1.1 # remember to update GIT_COMMIT below
pkgrel=0
pkgdesc="easy-to-use, flexible, and performant workload orchestrator"
url="https://www.nomadproject.io/"
arch="all !mips64 !riscv64 !x86"
# x86 run out of memory, mips64 & riscv64 limited by yarn/npm
license="MPL-2.0"
depends="cni-plugins"
makedepends="linux-headers bash make go yarn npm go-bindata-assetfs"
subpackages="$pkgname-openrc"
options="net !check" # cannot produce environment for testing in CI
source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/nomad/archive/v$pkgver.tar.gz
	nomad.initd
	nomad.confd
	nvidia-driver.patch
	server.hcl
	ui-remove-husky.patch"

# secfixes:
#   1.1.1-r0:
#     - CVE-2021-32575
#   1.0.4-r0:
#     - CVE-2021-3283
#   0.12.7-r0:
#     - CVE-2020-28348
#     - CVE-2020-27195
#   0.11.1-r0:
#     - CVE-2020-10944
#   0.10.3-r0:
#     - CVE-2020-7218
#   0.9.6-r0:
#     - CVE-2019-12741
#     - CVE-2019-15928
#     - CVE-2019-16742
#   0.9.5-r0:
#     - CVE-2019-14802
#     - CVE-2019-14803
#   0.9.2-r0:
#     - CVE-2019-12618

export GOPATH="$srcdir"
export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
export GIT_COMMIT="a6fab0f"

build() {
	make ember-dist
	GO_TAGS="ui release" make static-assets
	go build -v -o bin/"$pkgname" \
		-ldflags "-X github.com/hashicorp/nomad/version.GitCommit='$pkgver'" \
		-tags "ui release"
}

check() {
	go test -timeout=15m "./..."
}

package() {
	install -m755 -D "$srcdir"/"$pkgname".initd "$pkgdir"/etc/init.d/"$pkgname"
	install -m644 -D "$srcdir"/"$pkgname".confd "$pkgdir"/etc/conf.d/"$pkgname"

	install -m755 -o root -g root -D bin/"$pkgname" "$pkgdir"/usr/sbin/"$pkgname"
	install -m640 -o root -g root -D "$srcdir"/server.hcl "$pkgdir"/etc/nomad.d/server.hcl
	install -m750 -o root -g root -d "$pkgdir"/var/lib/"$pkgname"
}

sha512sums="c039dd89e28337e6728da14b938bf2d23d48274c5893f0dc28a1de6a641decd6eec3923fc5970451cdb02c33edbf13389e12fd4a97df7e3068c2e7020502401b  nomad-1.1.1.tar.gz
ac969c81150ba57871c1f75f17c11d06ffc7bcc872882416c7c0d9d43f5e352ca1b7e7bfd75e32a9d01a826496c77a657dc298f5e048f85b4d9e85bc3afee51d  nomad.initd
a4fcc9f319926e8e5257dcc902cf3e1cbacd8bee82097b7a9719611d52037431a7e953a4b0fa90fc25475d2590cd14877c8e4c87bd909dd0099a754ba6f5063c  nomad.confd
e9c0161c2a9c0e1933c266520a410764a709c7b4f65b1a81c1fb2494eae89daa847ffca5df46d6eea61d855f35d21e66433ec0afe8c08017187c917e952b8544  nvidia-driver.patch
c2ba7db5bb0858547bf346819945d24626ac761541f38350b40408e1b26227549f6aa4d6946baadbf856329c0ac9f81f84164597d11361224b62a1697f17e726  server.hcl
ea2e1475cfe34d516ba55917ce0aa0410f70e450a9943ce2a78978235213811d3159bfcd8f1ba6051a12fd89d69c7f008c5e0e95de3cf2f3a374e171d13d8da7  ui-remove-husky.patch"