Cleanup
1. Save output along with log inside output directory 2. Remove wip yay support
This commit is contained in:
parent
9ac300e528
commit
1d46cde88b
@ -5,7 +5,6 @@ LABEL Description="Container to build archlinux packages"
|
|||||||
COPY makepkg.conf /etc/makepkg.conf.d/custom.conf
|
COPY makepkg.conf /etc/makepkg.conf.d/custom.conf
|
||||||
COPY sudoers /etc/sudoers.d/builder
|
COPY sudoers /etc/sudoers.d/builder
|
||||||
COPY run.sh /run.sh
|
COPY run.sh /run.sh
|
||||||
# COPY ./yay /usr/bin/yay
|
|
||||||
|
|
||||||
RUN echo "169.254.1.2 archmirror.i.balki.me" >> /etc/hosts
|
RUN echo "169.254.1.2 archmirror.i.balki.me" >> /etc/hosts
|
||||||
|
|
||||||
@ -13,7 +12,6 @@ COPY mirrorlist /etc/pacman.d/mirrorlist
|
|||||||
|
|
||||||
RUN pacman -Sy --noconfirm git
|
RUN pacman -Sy --noconfirm git
|
||||||
|
|
||||||
|
|
||||||
RUN useradd builder -m
|
RUN useradd builder -m
|
||||||
|
|
||||||
WORKDIR /home/builder
|
WORKDIR /home/builder
|
||||||
|
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
podman build -t gitea.balki.me/balki/aur_builder:exp -t gitea.balki.me/balki/aur_builder:`date -I` .
|
podman build -t aur_builder:latest -t aur_builder:`date -I` .
|
||||||
|
|
||||||
pull:
|
pull:
|
||||||
podman pull docker.io/archlinux:base-devel
|
podman pull docker.io/archlinux:base-devel
|
||||||
|
14
README.md
14
README.md
@ -15,14 +15,18 @@ Build Archlinux packages in rootless podman container
|
|||||||
### Command to build
|
### Command to build
|
||||||
|
|
||||||
```
|
```
|
||||||
cd ~/projects/mine/aur_builder/
|
podman build -t aur_builder:latest .
|
||||||
podman build -t gitea.balki.me/balki/aur_builder:exp .
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Command to run
|
### Command to run
|
||||||
|
|
||||||
```
|
```
|
||||||
cd /home/balki/gotosocial_aur/
|
cd /path/to/PKGBUILD_dir
|
||||||
podman run --rm -v $PWD:/w -it gitea.balki.me/balki/aur_builder:exp
|
podman run --rm -it -v $PWD:/w aur_builder:latest
|
||||||
Y
|
```
|
||||||
|
|
||||||
|
Drop to shell before building.
|
||||||
|
|
||||||
|
```
|
||||||
|
podman run --rm -it -v $PWD:/w -e DEBUG_SHELL=y aur_builder:latest
|
||||||
```
|
```
|
||||||
|
43
run.sh
43
run.sh
@ -2,41 +2,32 @@
|
|||||||
|
|
||||||
set -xeuo pipefail
|
set -xeuo pipefail
|
||||||
|
|
||||||
sudo sh -c 'echo "169.254.1.2 archmirror.i.balki.me" >> /etc/hosts'
|
# /etc/hosts is managed by podman. Copying or editing with `sed -i` does not seem to work. Only appendig works
|
||||||
sudo sh -c 'echo "169.254.1.2 gitea.balki.me" >> /etc/hosts'
|
# podman sets up 169.254.1.2 to be the ip of the host
|
||||||
|
sudo sh -c 'echo "169.254.1.2 archmirror.i.balki.me" >> /etc/hosts'
|
||||||
|
sudo sh -c 'echo "169.254.1.2 gitea.balki.me" >> /etc/hosts'
|
||||||
|
|
||||||
sudo pacman -Syu
|
sudo pacman -Syu
|
||||||
|
|
||||||
yay_build() {
|
mkdir output
|
||||||
# not working yet
|
|
||||||
# rm-rf .git
|
|
||||||
|
|
||||||
git config --global user.email "aur_builder@balki.me"
|
|
||||||
git config --global user.name "Balakrishnan Balasubramanian"
|
|
||||||
makepkg --printsrcinfo >.SRCINFO
|
|
||||||
|
|
||||||
yay -Bi "$PWD"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
makepkg_build() {
|
|
||||||
if [ -d deps ]; then
|
|
||||||
sudo pacman -U deps/*pkg.tar*
|
|
||||||
fi
|
|
||||||
makepkg -s
|
|
||||||
}
|
|
||||||
|
|
||||||
cp -r /w .
|
cp -r /w .
|
||||||
|
|
||||||
cd ./w
|
cd ./w
|
||||||
|
|
||||||
if [ "${DEBUG_SHELL-n}" = y ]; then
|
if [ "${DEBUG_SHELL-n}" = y ]; then
|
||||||
|
echo "Stopping before build... Run 'exit 1' to skip building"
|
||||||
|
tail -12 "$0"
|
||||||
bash
|
bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# bash
|
if [ -d deps ]; then
|
||||||
# yay_build
|
sudo pacman -U deps/*pkg.tar*
|
||||||
|
fi
|
||||||
|
|
||||||
makepkg_build
|
LOGDEST=../output PKGDEST=../output makepkg --syncdeps --log
|
||||||
|
|
||||||
sudo cp ./*pkg.tar* /w
|
sudo cp -r ../output /w
|
||||||
|
|
||||||
|
if [ "${DEBUG_SHELL-n}" = y ]; then
|
||||||
|
echo "Build complete"
|
||||||
|
bash
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user