Merge branch 'master' of git.depau.eu:docker/drone-makepkg
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
44464674a0
3 changed files with 17 additions and 15 deletions
|
@ -4,4 +4,4 @@ USER root
|
|||
COPY makepkg.sh /usr/local/bin/drone-makepkg
|
||||
USER builder
|
||||
|
||||
ENTRYPOINT ["drone-makepkg"]
|
||||
ENTRYPOINT ["/usr/local/bin/drone-makepkg"]
|
||||
|
|
|
@ -4,4 +4,4 @@ USER root
|
|||
COPY makepkg.sh /usr/local/bin/drone-makepkg
|
||||
USER builder
|
||||
|
||||
ENTRYPOINT ["drone-makepkg"]
|
||||
ENTRYPOINT ["/usr/local/bin/drone-makepkg"]
|
||||
|
|
28
makepkg.sh
Normal file → Executable file
28
makepkg.sh
Normal file → Executable file
|
@ -6,7 +6,14 @@ echo "Building on: $DRONE_STAGE_MACHINE"
|
|||
|
||||
AUR_URL="https://aur.archlinux.org"
|
||||
OUTDIR="$DRONE_WORKSPACE_BASE/out"
|
||||
mkdir -p "$OUTDIR"
|
||||
sudo mkdir -p "$OUTDIR"
|
||||
sudo chown -R builder:builder "$OUTDIR"
|
||||
|
||||
export PKGDEST="$OUTDIR"
|
||||
export SRCDEST="$HOME/sources"
|
||||
export BUILDDIR="$HOME/builddir"
|
||||
mkdir -p "$SRCDEST"
|
||||
mkdir -p "$BUILDDIR"
|
||||
|
||||
if [ "$PLUGIN_AUTO_MAKEFLAGS" != "no" ]; then
|
||||
echo "MAKEFLAGS='-j$(nproc)'" | sudo tee -a /etc/makepkg.conf
|
||||
|
@ -14,35 +21,30 @@ fi
|
|||
|
||||
if [ "$PLUGIN_INSTALL" != "" ]; then
|
||||
echo "Installing packages before build: $PLUGIN_INSTALL"
|
||||
pikaur -Syu --noprogressbar --noconfirm $(echo "$PLUGIN_INSTALL" | tr ',' ' ')
|
||||
yay -Syu --noprogressbar --noconfirm --mflags=-A $(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"/*
|
||||
yay -U --noprogressbar --noconfirm "$OUTDIR"/*
|
||||
fi
|
||||
|
||||
# Clone package repo
|
||||
if [ "$PLUGIN_AUR" != "" ]; then
|
||||
echo "Building AUR package $PLUGIN_AUR"
|
||||
echo "Building AUR package: $PLUGIN_AUR"
|
||||
cd ~
|
||||
git clone "$AUR_URL/$PLUGIN_AUR.git" package
|
||||
cd package
|
||||
elif [ "$PLUGIN_GIT" != "" ]; then
|
||||
echo "Building package from git repository: $PLUGIN_GIT"
|
||||
cd ~
|
||||
git clone "$PLUGIN_GIT" 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"
|
||||
makepkg -sAc --skippgpcheck --noconfirm --noprogressbar
|
||||
|
||||
echo "Moving packages to output directory: $OUTDIR"
|
||||
mv *.pkg.* "$OUTDIR/"
|
||||
sudo chown -R root:root "$OUTDIR"
|
||||
|
|
Loading…
Reference in a new issue