pikaur_builder/.drone.yml

464 lines
9.5 KiB
YAML
Raw Normal View History

2021-02-22 19:43:57 +01:00
---
kind: pipeline
type: docker
name: pre_clean
platform:
os: linux
arch: amd64
workspace:
path: /drone
steps:
2021-02-23 00:04:54 +01:00
- name: remove-locks
2021-02-22 19:43:57 +01:00
pull: if-not-exists
image: leophys/pikaur:0.3
user: root
commands:
- rm -f /output/lock
volumes:
- name: output
path: /output
volumes:
- name: output
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/output
2021-02-22 19:43:57 +01:00
2021-02-23 00:04:54 +01:00
2021-02-20 20:41:42 +01:00
---
kind: pipeline
type: docker
name: electron-ozone
platform:
os: linux
arch: amd64
workspace:
2021-02-21 11:25:52 +01:00
path: /drone
2021-02-20 20:41:42 +01:00
steps:
2021-02-21 11:25:52 +01:00
- name: cache-init_electron-ozone
pull: if-not-exists
2021-02-22 19:22:43 +01:00
image: leophys/pikaur:0.3
2021-02-21 11:42:32 +01:00
user: root
2021-02-21 11:25:52 +01:00
commands:
- |
2021-02-21 15:35:10 +01:00
if ! [ "$(ls -A /cache_stage/etc)" ]; then
cp -r /etc/. /cache_stage/etc/
2021-02-21 15:53:28 +01:00
getfacl -p -R /etc > /cache_stage/etc/permissions.acl
2021-02-21 11:25:52 +01:00
fi
- |
2021-02-21 15:35:10 +01:00
if ! [ "$(ls -A /cache_stage/opt)" ]; then
cp -r /opt/. /cache_stage/opt/
2021-02-21 15:53:28 +01:00
getfacl -p -R /opt > /cache_stage/opt/permissions.acl
2021-02-21 15:35:10 +01:00
fi
- |
if ! [ "$(ls -A /cache_stage/var)" ]; then
cp -r /var/. /cache_stage/var/
2021-02-21 15:53:28 +01:00
getfacl -p -R /var > /cache_stage/var/permissions.acl
2021-02-21 15:35:10 +01:00
fi
- |
2021-02-21 15:36:53 +01:00
if ! [ "$(ls -A /cache_stage/usr)" ]; then
cp -r /usr/. /cache_stage/usr/
2021-02-21 15:53:28 +01:00
getfacl -p -R /usr > /cache_stage/usr/permissions.acl
2021-02-21 11:25:52 +01:00
fi
2021-02-22 19:34:26 +01:00
- |
if ! [ "$(ls -A /build2)" ]; then
cp -r /build/. /build2/
getfacl -p -R /usr > /build2/permissions.acl
fi
2021-02-22 19:29:55 +01:00
- chmod a+rw /output
2021-02-21 11:25:52 +01:00
volumes:
2021-02-22 19:34:26 +01:00
- name: build_electron-ozone
path: /build2
2021-02-21 15:35:10 +01:00
- name: etc_electron-ozone
path: /cache_stage/etc
- name: opt_electron-ozone
path: /cache_stage/opt
- name: var_electron-ozone
path: /cache_stage/var
- name: usr_electron-ozone
path: /cache_stage/usr
2021-02-22 12:57:47 +01:00
- name: output
path: /output
2021-02-21 11:25:52 +01:00
2021-02-21 15:44:40 +01:00
- name: cache-acl_electron-ozone
pull: if-not-exists
2021-02-22 19:22:43 +01:00
image: leophys/pikaur:0.3
2021-02-21 15:44:40 +01:00
user: root
commands:
2021-02-21 15:50:31 +01:00
- setfacl --restore=/etc/permissions.acl
- setfacl --restore=/opt/permissions.acl
- setfacl --restore=/var/permissions.acl
- setfacl --restore=/usr/permissions.acl
2021-02-22 19:34:26 +01:00
- setfacl --restore=/build/permissions.acl
2021-02-22 19:45:18 +01:00
- chown -R 1000:33 /build
2021-02-21 15:44:40 +01:00
volumes:
- name: build_electron-ozone
path: /build
- name: etc_electron-ozone
path: /etc
- name: opt_electron-ozone
path: /opt
- name: var_electron-ozone
path: /var
- name: usr_electron-ozone
path: /usr
2021-02-20 20:41:42 +01:00
- name: build_electron-ozone
pull: if-not-exists
2021-02-22 19:22:43 +01:00
image: leophys/pikaur:0.3
2021-02-20 20:41:42 +01:00
commands:
2021-02-23 16:04:26 +01:00
- git config --global http.version HTTP/1.1
2021-02-22 19:16:46 +01:00
- |
if [ -f /output/lock ]; then
while [ -f /output/lock ]; do
sleep 10
echo "Waiting $(cat /output/lock)"
done
else
echo "electron-ozone" >> /output/lock
fi
- |
set -euo pipefail
2021-02-23 00:15:40 +01:00
cd /build
2021-02-23 00:12:28 +01:00
/usr/bin/pikaur -G --noconfirm electron-ozone 2>&1|tee /output/electron-ozone.log
/usr/bin/pikaur -Py --keepbuilddeps --noconfirm electron-ozone/PKGBUILD 2>&1|tee /output/electron-ozone.log
2021-02-22 19:16:46 +01:00
- rm -f /output/lock
2021-02-20 20:41:42 +01:00
volumes:
- name: build_electron-ozone
path: /build
2021-02-21 15:35:10 +01:00
- name: etc_electron-ozone
path: /etc
- name: opt_electron-ozone
path: /opt
- name: var_electron-ozone
path: /var
- name: usr_electron-ozone
path: /usr
2021-02-22 11:21:08 +01:00
- name: output
path: /output
2021-02-20 20:41:42 +01:00
volumes:
- name: build_electron-ozone
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/electron-ozone
2021-02-21 15:35:10 +01:00
- name: etc_electron-ozone
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/etc/electron-ozone
2021-02-21 15:35:10 +01:00
- name: opt_electron-ozone
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/opt/electron-ozone
2021-02-21 15:35:10 +01:00
- name: var_electron-ozone
2021-02-21 00:58:30 +01:00
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/var/electron-ozone
2021-02-21 15:35:10 +01:00
- name: usr_electron-ozone
2021-02-21 00:58:30 +01:00
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/usr/electron-ozone
2021-02-22 11:21:08 +01:00
- name: output
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/output
2021-02-20 20:41:42 +01:00
trigger:
branch:
- master
event:
- push
- cron
2021-02-22 19:43:57 +01:00
depends_on:
- pre_clean
2021-02-20 20:41:42 +01:00
---
kind: pipeline
type: docker
name: notify_failure-electron-ozone
clone:
disable: true
steps:
- name: notify_failure
pull: if-not-exists
2021-02-22 12:00:50 +01:00
image: leophys/mailer:0.5-1
2021-02-20 20:41:42 +01:00
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"
2021-02-22 11:21:08 +01:00
commands:
2021-02-22 12:00:50 +01:00
- /sendmail.sh /output/electron-ozone.log
2021-02-22 19:43:57 +01:00
volumes:
- name: output
path: /output
- name: clean_lock
pull: if-not-exists
image: leophys/pikaur:0.3
user: root
commands:
2021-02-22 19:16:46 +01:00
- rm -f /output/lock
volumes:
- name: output
path: /output
2021-02-22 11:21:08 +01:00
volumes:
- name: output
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/output
2021-02-20 20:41:42 +01:00
trigger:
status:
- failure
depends_on:
- electron-ozone
2021-02-23 00:04:54 +01:00
2021-02-20 20:41:42 +01:00
---
kind: pipeline
type: docker
name: discord_arch_electron
platform:
os: linux
arch: amd64
workspace:
2021-02-21 11:25:52 +01:00
path: /drone
2021-02-20 20:41:42 +01:00
steps:
2021-02-21 11:25:52 +01:00
- name: cache-init_discord_arch_electron
pull: if-not-exists
2021-02-22 19:22:43 +01:00
image: leophys/pikaur:0.3
2021-02-21 11:42:32 +01:00
user: root
2021-02-21 11:25:52 +01:00
commands:
- |
2021-02-21 15:35:10 +01:00
if ! [ "$(ls -A /cache_stage/etc)" ]; then
cp -r /etc/. /cache_stage/etc/
2021-02-21 15:53:28 +01:00
getfacl -p -R /etc > /cache_stage/etc/permissions.acl
2021-02-21 11:25:52 +01:00
fi
- |
2021-02-21 15:35:10 +01:00
if ! [ "$(ls -A /cache_stage/opt)" ]; then
cp -r /opt/. /cache_stage/opt/
2021-02-21 15:53:28 +01:00
getfacl -p -R /opt > /cache_stage/opt/permissions.acl
2021-02-21 15:35:10 +01:00
fi
- |
if ! [ "$(ls -A /cache_stage/var)" ]; then
cp -r /var/. /cache_stage/var/
2021-02-21 15:53:28 +01:00
getfacl -p -R /var > /cache_stage/var/permissions.acl
2021-02-21 15:35:10 +01:00
fi
- |
2021-02-21 15:36:53 +01:00
if ! [ "$(ls -A /cache_stage/usr)" ]; then
cp -r /usr/. /cache_stage/usr/
2021-02-21 15:53:28 +01:00
getfacl -p -R /usr > /cache_stage/usr/permissions.acl
2021-02-21 11:25:52 +01:00
fi
2021-02-22 19:34:26 +01:00
- |
if ! [ "$(ls -A /build2)" ]; then
cp -r /build/. /build2/
getfacl -p -R /usr > /build2/permissions.acl
fi
2021-02-22 19:29:55 +01:00
- chmod a+rw /output
2021-02-21 11:25:52 +01:00
volumes:
2021-02-22 19:34:26 +01:00
- name: build_discord_arch_electron
path: /build2
2021-02-21 15:35:10 +01:00
- name: etc_discord_arch_electron
path: /cache_stage/etc
- name: opt_discord_arch_electron
path: /cache_stage/opt
- name: var_discord_arch_electron
path: /cache_stage/var
- name: usr_discord_arch_electron
path: /cache_stage/usr
2021-02-22 12:57:47 +01:00
- name: output
path: /output
2021-02-21 11:25:52 +01:00
2021-02-21 15:44:40 +01:00
- name: cache-acl_discord_arch_electron
pull: if-not-exists
2021-02-22 19:22:43 +01:00
image: leophys/pikaur:0.3
2021-02-21 15:44:40 +01:00
user: root
commands:
2021-02-21 15:50:31 +01:00
- setfacl --restore=/etc/permissions.acl
- setfacl --restore=/opt/permissions.acl
- setfacl --restore=/var/permissions.acl
- setfacl --restore=/usr/permissions.acl
2021-02-22 19:34:26 +01:00
- setfacl --restore=/build/permissions.acl
2021-02-22 19:45:18 +01:00
- chown -R 1000:33 /build
2021-02-21 15:44:40 +01:00
volumes:
- name: build_discord_arch_electron
path: /build
- name: etc_discord_arch_electron
path: /etc
- name: opt_discord_arch_electron
path: /opt
- name: var_discord_arch_electron
path: /var
- name: usr_discord_arch_electron
path: /usr
2021-02-21 11:25:52 +01:00
- name: build_discord_arch_electron
2021-02-20 20:41:42 +01:00
pull: if-not-exists
2021-02-22 19:22:43 +01:00
image: leophys/pikaur:0.3
2021-02-20 20:41:42 +01:00
commands:
2021-02-22 19:16:46 +01:00
- |
if [ -f /output/lock ]; then
while [ -f /output/lock ]; do
sleep 10
echo "Waiting $(cat /output/lock)"
done
else
echo "discord_arch_electron" >> /output/lock
fi
- |
set -euo pipefail
2021-02-23 00:15:40 +01:00
cd /build
2021-02-23 00:12:28 +01:00
/usr/bin/pikaur -G --noconfirm discord_arch_electron 2>&1|tee /output/discord_arch_electron.log
/usr/bin/pikaur -Py --keepbuilddeps --noconfirm discord_arch_electron/PKGBUILD 2>&1|tee /output/discord_arch_electron.log
2021-02-22 19:16:46 +01:00
- rm -f /output/lock
2021-02-20 20:41:42 +01:00
volumes:
- name: build_discord_arch_electron
path: /build
2021-02-21 15:35:10 +01:00
- name: etc_discord_arch_electron
path: /etc
- name: opt_discord_arch_electron
path: /opt
- name: var_discord_arch_electron
path: /var
- name: usr_discord_arch_electron
path: /usr
2021-02-22 11:21:08 +01:00
- name: output
path: /output
2021-02-20 20:41:42 +01:00
volumes:
- name: build_discord_arch_electron
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/discord_arch_electron
2021-02-21 15:35:10 +01:00
- name: etc_discord_arch_electron
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/etc/discord_arch_electron
2021-02-21 15:35:10 +01:00
- name: opt_discord_arch_electron
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/opt/discord_arch_electron
2021-02-21 15:35:10 +01:00
- name: var_discord_arch_electron
2021-02-21 00:58:30 +01:00
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/var/discord_arch_electron
2021-02-21 15:35:10 +01:00
- name: usr_discord_arch_electron
2021-02-21 00:58:30 +01:00
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/usr/discord_arch_electron
2021-02-22 11:21:08 +01:00
- name: output
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/output
2021-02-20 20:41:42 +01:00
trigger:
branch:
- master
event:
- push
- cron
2021-02-22 19:43:57 +01:00
depends_on:
- pre_clean
2021-02-20 20:41:42 +01:00
---
kind: pipeline
type: docker
name: notify_failure-discord_arch_electron
clone:
disable: true
steps:
- name: notify_failure
pull: if-not-exists
2021-02-22 12:00:50 +01:00
image: leophys/mailer:0.5-1
2021-02-20 20:41:42 +01:00
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"
2021-02-22 11:21:08 +01:00
commands:
2021-02-22 12:00:50 +01:00
- /sendmail.sh /output/discord_arch_electron.log
2021-02-22 19:43:57 +01:00
volumes:
- name: output
path: /output
- name: clean_lock
pull: if-not-exists
image: leophys/pikaur:0.3
user: root
commands:
2021-02-22 19:16:46 +01:00
- rm -f /output/lock
volumes:
- name: output
path: /output
2021-02-22 11:21:08 +01:00
volumes:
- name: output
host:
2021-02-23 17:33:12 +01:00
path: /store/builds/packages/output
2021-02-20 20:41:42 +01:00
trigger:
status:
- failure
depends_on:
- discord_arch_electron
2021-02-23 00:04:54 +01:00
2021-02-20 20:41:42 +01:00
---
kind: pipeline
type: docker
name: notify_success
clone:
disable: true
steps:
- name: notify_success
pull: if-not-exists
2021-02-22 12:00:50 +01:00
image: leophys/mailer:0.5-1
2021-02-20 20:41:42 +01:00
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
2021-02-21 00:19:46 +01:00
---
kind: signature
2021-02-23 17:33:12 +01:00
hmac: 21737b767443c19d5750c6b95c253624584d09be417f072e4b0717ac1aea1148
2021-02-21 00:19:46 +01:00
...