drone: update build flags
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nyyu 2022-07-14 09:51:09 +02:00
parent 5ffff2b392
commit 620aa6d349
7 changed files with 131 additions and 72 deletions

View File

@ -1,20 +1,20 @@
pkgbase = drone-runner-docker
pkgdesc = Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant
pkgdesc = Drone pipeline runner that executes builds inside Docker containers
pkgver = 1.8.2
pkgrel = 1
pkgrel = 2
url = https://drone.io
arch = x86_64
license = Apache
license = custom
makedepends = go
makedepends = git
makedepends = gcc
depends = docker
options = !lto
backup = etc/drone/agent
source = git+https://github.com/drone-runners/drone-runner-docker.git#tag=v1.8.2
source = drone-agent.service
source = agent.conf
sha256sums = SKIP
sha256sums = dda7f52cb406beeb16024eb077ecfdd4b05929a955f796214646a16db5898ea2
sha256sums = a739e3efeffdf93dd13ba4947608ecd17ea585473de55a2323f6f3e89f787dca
sha256sums = 2c1a13f0d4bf83c1716db1b3179f38da7b9f0e762f781a8a6ab13cc683f057fe
pkgname = drone-runner-docker

View File

@ -1,35 +1,66 @@
# Maintainer: Sl@ny <webmaster [at] slany [dot] work>
pkgname=drone-runner-docker
pkgver=1.8.2
pkgrel=1
pkgdesc="Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant"
pkgrel=2
pkgdesc='Drone pipeline runner that executes builds inside Docker containers'
arch=('x86_64')
url="https://drone.io"
license=('Apache')
makedepends=('go' 'git' 'gcc')
license=('custom')
makedepends=('go' 'git')
options=('!lto')
depends=('docker')
backup=('etc/drone/agent')
source=(git+https://github.com/drone-runners/$pkgname.git#tag=v$pkgver
'drone-agent.service'
'agent.conf')
sha256sums=('SKIP'
'dda7f52cb406beeb16024eb077ecfdd4b05929a955f796214646a16db5898ea2'
'a739e3efeffdf93dd13ba4947608ecd17ea585473de55a2323f6f3e89f787dca'
'2c1a13f0d4bf83c1716db1b3179f38da7b9f0e762f781a8a6ab13cc683f057fe')
prepare() {
cd "$pkgname"
# create directory for build output
mkdir -p build
# download dependencies
go mod download
}
build() {
cd "$srcdir/$pkgname"
go build -a -v -trimpath -buildmode=pie -mod=readonly -ldflags '-w -s' .
cd "$pkgname"
# set Go flags
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
go build -v \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
-o build \
.
}
package() {
cd "$srcdir"
# binaries
install -Dm755 "$pkgname/$pkgname" "$pkgdir"/usr/bin/drone-agent
# service
install -Dm644 drone-agent.service "$pkgdir/usr/lib/systemd/system/drone-agent.service"
# config
install -Dm644 agent.conf "$pkgdir/etc/drone/agent"
cd "$pkgname"
# binary
install -vDm755 -t "$pkgdir/usr/bin" build/*
# licenses
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" licenses/* LICENSE.md
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md CHANGELOG.md
}

View File

@ -1,5 +1,5 @@
[Unit]
Description=Drone Continuous Integration platform agent
Description=Drone Runner (Docker)
After=network.target
[Service]
@ -7,7 +7,7 @@ User=drone-agent
Group=docker
Type=simple
EnvironmentFile=/etc/drone/agent
ExecStart=/usr/bin/drone-agent
ExecStart=/usr/bin/drone-runner-docker
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=on-failure
KillSignal=SIGINT

View File

@ -1,13 +1,13 @@
pkgbase = drone
pkgdesc = Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant
pkgver = 2.12.1
pkgrel = 1
pkgrel = 2
url = https://drone.io
arch = x86_64
license = Apache
license = custom
makedepends = go
makedepends = git
makedepends = gcc
options = !lto
backup = etc/drone/server
source = git+https://github.com/drone/drone.git#tag=v2.12.1
source = drone.service

View File

@ -1,12 +1,13 @@
# Maintainer: Sl@ny <webmaster [at] slany [dot] work>
pkgname=drone
pkgver=2.12.1
pkgrel=1
pkgrel=2
pkgdesc="Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant"
arch=('x86_64')
url="https://drone.io"
license=('Apache')
makedepends=('go' 'git' 'gcc')
license=('custom')
makedepends=('go' 'git')
options=('!lto')
backup=('etc/drone/server')
source=(git+https://github.com/drone/drone.git#tag=v$pkgver
'drone.service'
@ -15,23 +16,50 @@ sha256sums=('SKIP'
'3cd219b1c5611b9ff4211d4837dff11228d9a491cd41d21f4c60af77c8c21d5c'
'2b8957cd6b9f9ee6e8d831f58b0ef3fac2170a56f6259884ec7d30c3ba38c73a')
prepare() {
cd "$pkgname"
mkdir build
go mod download
}
build() {
cd "$srcdir/$pkgname"
go build -a -v -trimpath -buildmode=pie -mod=readonly -tags "nolimit" -ldflags '-w -s' ./cmd/drone-server
cd "$pkgname"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
local COMMON_FLAGS=(
-trimpath
-buildmode=pie
-mod=readonly
-modcacherw
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\""
)
go build \
"${COMMON_FLAGS[@]}" \
-tags "nolimit" \
-o build \
./cmd/...
}
check() {
cd "$pkgname"
go test -v ./...
}
package() {
cd "$srcdir"
# binaries
install -Dm755 "$pkgname/$pkgname"-server "$pkgdir"/usr/bin/"$pkgname"-server
# license
install -Dm644 "$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# service
install -Dm644 drone.service "$pkgdir/usr/lib/systemd/system/drone.service"
# config
install -Dm644 server.conf "$pkgdir/etc/drone/server"
cd "$pkgname"
# binary
install -vDm755 -t "$pkgdir/usr/bin" build/*
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE
}