From a2610bd88d386cf7a6ea53249876e7a25494e2e0 Mon Sep 17 00:00:00 2001 From: Blallo Date: Sat, 20 Feb 2021 20:41:42 +0100 Subject: [PATCH] Init --- .drone.yml | 168 ++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 29 +++++++++ Dockerfile.root | 20 ++++++ build.sh | 3 + run.sh | 6 ++ 5 files changed, 226 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 Dockerfile.root create mode 100755 build.sh create mode 100755 run.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..562ab36 --- /dev/null +++ b/.drone.yml @@ -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 + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9123394 --- /dev/null +++ b/Dockerfile @@ -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 [] diff --git a/Dockerfile.root b/Dockerfile.root new file mode 100644 index 0000000..4b4d553 --- /dev/null +++ b/Dockerfile.root @@ -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 [] diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..e6a5401 --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +docker build --build-arg uid=$(uid) --build-arg gid=$(gid) -t leophys/pikaur . diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..55c748d --- /dev/null +++ b/run.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +docker run \ + --rm \ + -v $PWD/build/doer:/doer \ + -ti leophys/pikaur ${@}