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')
'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