2022-11-15 23:08:47 +01:00
|
|
|
# Maintainer: nyyu <mail at nyyu dot dev>
|
|
|
|
|
2022-11-14 20:24:47 +01:00
|
|
|
pkgbase=woodpecker
|
|
|
|
pkgname=(
|
|
|
|
'woodpecker-server'
|
|
|
|
'woodpecker-agent'
|
|
|
|
'woodpecker-cli'
|
|
|
|
)
|
2023-11-24 01:07:45 +01:00
|
|
|
pkgver=2.0.0
|
2023-11-25 11:20:02 +01:00
|
|
|
pkgrel=2
|
2022-11-14 20:24:47 +01:00
|
|
|
pkgdesc="Woodpecker is a community fork of the Drone CI system"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://woodpecker-ci.org"
|
|
|
|
license=('Apache')
|
2023-11-25 11:20:02 +01:00
|
|
|
makedepends=('go' 'git' 'pnpm')
|
2022-11-14 20:24:47 +01:00
|
|
|
options=('!lto')
|
2023-07-30 16:46:26 +02:00
|
|
|
source=(git+https://github.com/woodpecker-ci/woodpecker.git#tag=v$pkgver
|
2023-11-19 19:52:11 +01:00
|
|
|
'fix-encryption.patch'
|
2022-11-14 20:24:47 +01:00
|
|
|
'woodpecker-server.service'
|
|
|
|
'woodpecker-agent.service'
|
|
|
|
'agent.conf'
|
|
|
|
'server.conf')
|
|
|
|
sha256sums=('SKIP'
|
2023-11-25 11:20:02 +01:00
|
|
|
'51ef81bb925ca4fa5db4ecacaa9377baf673454632aecd0485e3dac801d72647'
|
2022-11-15 23:08:47 +01:00
|
|
|
'6e22e6939222aaad07311e37a086935ca32dd149c3688b2809db5f55df816516'
|
2023-03-18 19:50:18 +01:00
|
|
|
'7a72ba21f385b5dcf7f2d4e8fb7a643070eb2cf722187ca1ec69a9d04b003e9e'
|
2023-11-25 11:20:02 +01:00
|
|
|
'5fd0216af98bc12983d628fe165d0f0896caf583fd3d0fd6cb30c68a599dc9fa'
|
2022-12-26 14:03:48 +01:00
|
|
|
'd983da1df22d00338aa82be5844554f27f789361f405fe381f73896623bd2c7a')
|
2022-11-15 23:08:47 +01:00
|
|
|
|
2022-11-14 20:24:47 +01:00
|
|
|
prepare() {
|
|
|
|
cd "$pkgbase"
|
|
|
|
|
2023-11-19 19:52:11 +01:00
|
|
|
git am ../fix-encryption.patch
|
2022-12-28 21:21:54 +01:00
|
|
|
|
2023-04-01 09:48:41 +02:00
|
|
|
find web/src/assets/locales ! -name 'en.json' -type f -exec rm -f {} +
|
|
|
|
|
2022-11-14 20:24:47 +01:00
|
|
|
mkdir -p build-server build-agent build-cli
|
|
|
|
|
2022-11-16 22:17:52 +01:00
|
|
|
go mod download || true
|
2022-11-14 20:24:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$pkgbase"
|
|
|
|
|
|
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
|
|
local COMMON_FLAGS=(
|
|
|
|
-trimpath
|
|
|
|
-buildmode=pie
|
|
|
|
-mod=readonly
|
|
|
|
-modcacherw
|
2023-11-24 08:35:46 +01:00
|
|
|
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\" -X go.woodpecker-ci.org/woodpecker/version.Version=${pkgver}"
|
2022-11-14 20:24:47 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
cd web
|
2023-11-25 11:20:02 +01:00
|
|
|
pnpm install --frozen-lockfile
|
|
|
|
pnpm build
|
2022-11-14 20:24:47 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
go build \
|
|
|
|
"${COMMON_FLAGS[@]}" \
|
|
|
|
-o build-server \
|
|
|
|
./cmd/server/...
|
|
|
|
|
|
|
|
go build \
|
|
|
|
"${COMMON_FLAGS[@]}" \
|
|
|
|
-o build-agent \
|
|
|
|
./cmd/agent/...
|
|
|
|
|
|
|
|
go build \
|
|
|
|
"${COMMON_FLAGS[@]}" \
|
|
|
|
-o build-cli \
|
|
|
|
./cmd/cli/...
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
|
|
|
cd "$pkgbase"
|
|
|
|
|
2022-12-28 21:21:54 +01:00
|
|
|
# go test -v ./...
|
2022-11-14 20:24:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
package_woodpecker-server() {
|
|
|
|
|
|
|
|
backup=('etc/woodpecker/server')
|
|
|
|
|
|
|
|
# service
|
|
|
|
install -Dm644 woodpecker-server.service "$pkgdir/usr/lib/systemd/system/woodpecker-server.service"
|
|
|
|
# config
|
|
|
|
install -Dm644 server.conf "$pkgdir/etc/woodpecker/server"
|
|
|
|
|
|
|
|
cd "$pkgbase"
|
|
|
|
|
|
|
|
# binary
|
|
|
|
install -vDm755 build-server/server "$pkgdir/usr/bin/woodpecker-server"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
package_woodpecker-agent() {
|
|
|
|
|
|
|
|
backup=('etc/woodpecker/agent')
|
|
|
|
|
|
|
|
# service
|
|
|
|
install -Dm644 woodpecker-agent.service "$pkgdir/usr/lib/systemd/system/woodpecker-agent.service"
|
|
|
|
# config
|
|
|
|
install -Dm644 agent.conf "$pkgdir/etc/woodpecker/agent"
|
|
|
|
|
|
|
|
cd "$pkgbase"
|
|
|
|
|
|
|
|
# binary
|
|
|
|
install -vDm755 build-agent/agent "$pkgdir/usr/bin/woodpecker-agent"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
package_woodpecker-cli() {
|
|
|
|
cd "$pkgbase"
|
|
|
|
|
|
|
|
# binary
|
2022-11-15 23:08:47 +01:00
|
|
|
install -vDm755 build-cli/cli "$pkgdir/usr/bin/woodpecker"
|
2022-11-14 20:24:47 +01:00
|
|
|
}
|