This commit is contained in:
commit
3af909d348
4 changed files with 109 additions and 0 deletions
47
.drone.yml
Normal file
47
.drone.yml
Normal file
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: alarm-aarch64
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: build-image
|
||||
image: plugins/docker
|
||||
environment:
|
||||
TZ: Europe/Rome
|
||||
settings:
|
||||
dockerfile: Dockerfile.aarch64
|
||||
purge: true
|
||||
username: depau
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: depau/drone-makepkg
|
||||
tags:
|
||||
- aarch64
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: archlinux-x86_64
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build-image
|
||||
image: plugins/docker
|
||||
environment:
|
||||
TZ: Europe/Rome
|
||||
settings:
|
||||
dockerfile: Dockerfile.x86_64
|
||||
purge: true
|
||||
username: depau
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: depau/drone-makepkg
|
||||
tags:
|
||||
- x86_64
|
7
Dockerfile.aarch64
Normal file
7
Dockerfile.aarch64
Normal file
|
@ -0,0 +1,7 @@
|
|||
FROM depau/archlinux-makepkg:aarch64
|
||||
|
||||
USER root
|
||||
COPY makepkg.sh /usr/local/bin/drone-makepkg
|
||||
USER builder
|
||||
|
||||
ENTRYPOINT ["drone-makepkg"]
|
7
Dockerfile.x86_64
Normal file
7
Dockerfile.x86_64
Normal file
|
@ -0,0 +1,7 @@
|
|||
FROM depau/archlinux-makepkg:x86_64
|
||||
|
||||
USER root
|
||||
COPY makepkg.sh /usr/local/bin/drone-makepkg
|
||||
USER builder
|
||||
|
||||
ENTRYPOINT ["drone-makepkg"]
|
48
makepkg.sh
Normal file
48
makepkg.sh
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Building on: $DRONE_STAGE_MACHINE"
|
||||
|
||||
AUR_URL="https://aur.archlinux.org"
|
||||
OUTDIR="$DRONE_WORKSPACE_BASE/out"
|
||||
mkdir -p "$OUTDIR"
|
||||
|
||||
if [ "$PLUGIN_AUTO_MAKEFLAGS" != "no" ]; then
|
||||
echo "MAKEFLAGS='-j$(nproc)'" | sudo tee -a /etc/makepkg.conf
|
||||
fi
|
||||
|
||||
if [ "$PLUGIN_INSTALL" != "" ]; then
|
||||
echo "Installing packages before build: $PLUGIN_INSTALL"
|
||||
pikaur -Syu --noprogressbar --noconfirm $(echo "$PLUGIN_INSTALL" | tr ',' ' ')
|
||||
fi
|
||||
|
||||
if [ "$PLUGIN_INSTALL_OUTPUTS" != "no" ] && [ -n "$(ls -A "$OUTDIR")" ]; then
|
||||
echo "Installing previous build outputs"
|
||||
pikaur -U --noprogressbar --noconfirm "$OUTDIR"/*
|
||||
fi
|
||||
|
||||
# Clone package repo
|
||||
if [ "$PLUGIN_AUR" != "" ]; then
|
||||
echo "Building AUR package $PLUGIN_AUR"
|
||||
git clone "$AUR_URL/$PLUGIN_AUR.git" package
|
||||
cd package
|
||||
elif [ "$PLUGIN_REPO" != "" ]; then
|
||||
echo "Building package from git repository: $PLUGIN_REPO"
|
||||
git clone "$PLUGIN_REPO" package
|
||||
cd package
|
||||
else
|
||||
echo "Building source repository"
|
||||
fi
|
||||
|
||||
PKGBUILD="PKGBUILD"
|
||||
if [ "$PLUGIN_PKGBUILD" != "" ]; then
|
||||
echo "Using PKGBUILD: $PLUGIN_PKGBUILD"
|
||||
PKGBUILD="$PLUGIN_PKGBUILD"
|
||||
fi
|
||||
|
||||
echo "Running build"
|
||||
pikaur --noprogressbar --noconfirm -P "$PKGBUILD"
|
||||
|
||||
echo "Moving packages to output directory: $OUTDIR"
|
||||
mv *.pkg.* "$OUTDIR/"
|
Loading…
Reference in a new issue