This commit is contained in:
sfigato 2021-02-20 20:41:42 +01:00
commit a2610bd88d
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F
5 changed files with 226 additions and 0 deletions

168
.drone.yml Normal file
View File

@ -0,0 +1,168 @@
---
kind: pipeline
type: docker
name: electron-ozone
platform:
os: linux
arch: amd64
workspace:
base: /src
steps:
- name: build_electron-ozone
pull: if-not-exists
image: leophys/pikaur-root:0.1
commands:
- -Sy --noconfirm electron-ozone
volumes:
- name: build_electron-ozone
path: /build
volumes:
- name: build_electron-ozone
host:
path: /var/builds/archlinux/electron-ozone
trigger:
branch:
- master
event:
- push
- cron
---
kind: pipeline
type: docker
name: notify_failure-electron-ozone
clone:
disable: true
steps:
- name: notify_failure
pull: if-not-exists
image: leophys/mailer:0.5
environment:
M_SERVER_ADDRESS:
from_secret: m_server_address
M_USER:
from_secret: m_user
M_PASSWORD:
from_secret: m_password
M_FROM:
from_secret: m_from
M_TO:
from_secret: m_to
M_SUB: "[electron-ozone] FAILURE"
M_TEXT: "Failed building electron-ozone"
trigger:
status:
- failure
depends_on:
- electron-ozone
---
kind: pipeline
type: docker
name: discord_arch_electron
platform:
os: linux
arch: amd64
workspace:
base: /src
steps:
- name: build_electron-ozone
pull: if-not-exists
image: leophys/pikaur-root:0.1
commands:
- -Sy --noconfirm discord_arch_electron
volumes:
- name: build_discord_arch_electron
path: /build
volumes:
- name: build_discord_arch_electron
host:
path: /var/builds/archlinux/discord_arch_electron
trigger:
branch:
- master
event:
- push
- cron
---
kind: pipeline
type: docker
name: notify_failure-discord_arch_electron
clone:
disable: true
steps:
- name: notify_failure
pull: if-not-exists
image: leophys/mailer:0.5
environment:
M_SERVER_ADDRESS:
from_secret: m_server_address
M_USER:
from_secret: m_user
M_PASSWORD:
from_secret: m_password
M_FROM:
from_secret: m_from
M_TO:
from_secret: m_to
M_SUB: "[discord_arch_electron] FAILURE"
M_TEXT: "Failed building discord_arch_electron"
trigger:
status:
- failure
depends_on:
- discord_arch_electron
---
kind: pipeline
type: docker
name: notify_success
clone:
disable: true
steps:
- name: notify_success
pull: if-not-exists
image: leophys/mailer:0.5
environment:
M_SERVER_ADDRESS:
from_secret: m_server_address
M_USER:
from_secret: m_user
M_PASSWORD:
from_secret: m_password
M_FROM:
from_secret: m_from
M_TO:
from_secret: m_to
M_SUB: "[archlinux] SUCCESS"
M_TEXT: "Success building archlinux packages"
trigger:
status:
- success
depends_on:
- electron-ozone
- discord_arch_electron

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
FROM archlinux:latest
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} doer \
&& useradd -u ${uid} -g doer -m -d /doer doer \
&& pacman -Sy --noconfirm \
base-devel \
glibc \
git \
sudo \
python-commonmark \
pyalpm \
&& chmod 600 /etc/sudoers \
&& sed -i"" '/root ALL.*/a doer ALL=(ALL) NOPASSWD:ALL' /etc/sudoers \
&& chmod 440 /etc/sudoers
VOLUME ["/var/lib/pacman", "/var/cache/pacman"]
USER doer
WORKDIR /doer
RUN git clone https://aur.archlinux.org/pikaur.git \
&& cd pikaur \
&& makepkg -fsri --noconfirm
ENTRYPOINT ["/usr/bin/pikaur"]
CMD []

20
Dockerfile.root Normal file
View File

@ -0,0 +1,20 @@
FROM archlinux:latest
RUN pacman -Sy --noconfirm \
base-devel \
glibc \
git \
sudo \
python-commonmark \
pyalpm \
&& mkdir /build
VOLUME ["/var/lib/pacman", "/var/cache/pacman"]
WORKDIR /build
RUN git clone https://aur.archlinux.org/pikaur.git \
&& cd pikaur \
&& makepkg -fsri --noconfirm
ENTRYPOINT ["/usr/bin/pikaur"]
CMD []

3
build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
docker build --build-arg uid=$(uid) --build-arg gid=$(gid) -t leophys/pikaur .

6
run.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env sh
docker run \
--rm \
-v $PWD/build/doer:/doer \
-ti leophys/pikaur ${@}