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
|
COPY makepkg.sh /usr/local/bin/drone-makepkg
|
||||||
USER builder
|
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
|
COPY makepkg.sh /usr/local/bin/drone-makepkg
|
||||||
USER builder
|
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"
|
AUR_URL="https://aur.archlinux.org"
|
||||||
OUTDIR="$DRONE_WORKSPACE_BASE/out"
|
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
|
if [ "$PLUGIN_AUTO_MAKEFLAGS" != "no" ]; then
|
||||||
echo "MAKEFLAGS='-j$(nproc)'" | sudo tee -a /etc/makepkg.conf
|
echo "MAKEFLAGS='-j$(nproc)'" | sudo tee -a /etc/makepkg.conf
|
||||||
|
@ -14,35 +21,30 @@ fi
|
||||||
|
|
||||||
if [ "$PLUGIN_INSTALL" != "" ]; then
|
if [ "$PLUGIN_INSTALL" != "" ]; then
|
||||||
echo "Installing packages before build: $PLUGIN_INSTALL"
|
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
|
fi
|
||||||
|
|
||||||
if [ "$PLUGIN_INSTALL_OUTPUTS" != "no" ] && [ -n "$(ls -A "$OUTDIR")" ]; then
|
if [ "$PLUGIN_INSTALL_OUTPUTS" != "no" ] && [ -n "$(ls -A "$OUTDIR")" ]; then
|
||||||
echo "Installing previous build outputs"
|
echo "Installing previous build outputs"
|
||||||
pikaur -U --noprogressbar --noconfirm "$OUTDIR"/*
|
yay -U --noprogressbar --noconfirm "$OUTDIR"/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clone package repo
|
# Clone package repo
|
||||||
if [ "$PLUGIN_AUR" != "" ]; then
|
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
|
git clone "$AUR_URL/$PLUGIN_AUR.git" package
|
||||||
cd package
|
cd package
|
||||||
elif [ "$PLUGIN_GIT" != "" ]; then
|
elif [ "$PLUGIN_GIT" != "" ]; then
|
||||||
echo "Building package from git repository: $PLUGIN_GIT"
|
echo "Building package from git repository: $PLUGIN_GIT"
|
||||||
|
cd ~
|
||||||
git clone "$PLUGIN_GIT" package
|
git clone "$PLUGIN_GIT" package
|
||||||
cd package
|
cd package
|
||||||
else
|
else
|
||||||
echo "Building source repository"
|
echo "Building source repository"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKGBUILD="PKGBUILD"
|
|
||||||
if [ "$PLUGIN_PKGBUILD" != "" ]; then
|
|
||||||
echo "Using PKGBUILD: $PLUGIN_PKGBUILD"
|
|
||||||
PKGBUILD="$PLUGIN_PKGBUILD"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Running build"
|
echo "Running build"
|
||||||
pikaur --noprogressbar --noconfirm -P "$PKGBUILD"
|
makepkg -sAc --skippgpcheck --noconfirm --noprogressbar
|
||||||
|
|
||||||
echo "Moving packages to output directory: $OUTDIR"
|
sudo chown -R root:root "$OUTDIR"
|
||||||
mv *.pkg.* "$OUTDIR/"
|
|
||||||
|
|
Loading…
Reference in a new issue