pikaur_builder/.drone.yml

389 lines
8.0 KiB
YAML
Raw Normal View History

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:29:55 +01:00
- chmod a+rw /output
2021-02-21 11:25:52 +01:00
volumes:
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:29:55 +01:00
- chown build:33 -R /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-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
/usr/bin/pikaur -Sy --noconfirm electron-ozone|tee /output/electron-ozone.log
- 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:
path: /var/builds/archlinux/electron-ozone
2021-02-21 15:35:10 +01:00
- name: etc_electron-ozone
host:
path: /var/builds/archlinux/etc/electron-ozone
- name: opt_electron-ozone
host:
path: /var/builds/archlinux/opt/electron-ozone
- name: var_electron-ozone
2021-02-21 00:58:30 +01:00
host:
2021-02-21 15:35:10 +01:00
path: /var/builds/archlinux/var/electron-ozone
- name: usr_electron-ozone
2021-02-21 00:58:30 +01:00
host:
2021-02-21 15:35:10 +01:00
path: /var/builds/archlinux/usr/electron-ozone
2021-02-22 11:21:08 +01:00
- name: output
host:
path: /var/builds/archlinux/output
2021-02-20 20:41:42 +01:00
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
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: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:
path: /var/builds/archlinux/output
2021-02-20 20:41:42 +01:00
trigger:
status:
- failure
depends_on:
- electron-ozone
---
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:29:55 +01:00
- chmod a+rw /output
2021-02-21 11:25:52 +01:00
volumes:
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:29:55 +01:00
- chown -R build:33 /output
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
/usr/bin/pikaur -Sy --noconfirm discord_arch_electron|tee /output/discord_arch_electron.log
- 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:
path: /var/builds/archlinux/discord_arch_electron
2021-02-21 15:35:10 +01:00
- name: etc_discord_arch_electron
host:
path: /var/builds/archlinux/etc/discord_arch_electron
- name: opt_discord_arch_electron
host:
path: /var/builds/archlinux/opt/discord_arch_electron
- name: var_discord_arch_electron
2021-02-21 00:58:30 +01:00
host:
2021-02-21 15:35:10 +01:00
path: /var/builds/archlinux/var/discord_arch_electron
- name: usr_discord_arch_electron
2021-02-21 00:58:30 +01:00
host:
2021-02-21 15:35:10 +01:00
path: /var/builds/archlinux/usr/discord_arch_electron
2021-02-22 11:21:08 +01:00
- name: output
host:
path: /var/builds/archlinux/output
2021-02-20 20:41:42 +01:00
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
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: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:
path: /var/builds/archlinux/output
2021-02-20 20:41:42 +01:00
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
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-22 19:22:43 +01:00
hmac: 6a46d65e99fe32d2c18292beb7ddc3f278cc3cf68013d3ce5821fc248a9befdb
2021-02-21 00:19:46 +01:00
...