os/.drone.yml

127 lines
3.5 KiB
YAML
Raw Normal View History

2021-05-29 20:21:58 +02:00
kind: pipeline
type: docker
2021-06-15 00:20:42 +02:00
name: upstreaming
clone:
disable: true
2021-05-29 20:21:58 +02:00
steps:
- name: "Sync upstream to local"
2021-06-14 22:28:29 +02:00
image: nixery.dev/shell/git/openssh
2021-06-14 23:36:03 +02:00
when:
event:
- cron
2021-06-14 23:38:49 +02:00
- promote
target:
- upstream
2021-05-29 20:21:58 +02:00
environment:
GITEA_SSH_KEY:
from_secret: gitea_ssh_key
2021-06-14 22:41:55 +02:00
HOME: /root
2021-05-29 20:21:58 +02:00
commands:
2021-06-14 22:41:55 +02:00
# This is a hack because nixery containers contain no passwd file, which openssh wants to read
- echo "root:x:0:0:System administrator:/root:/run/current-system/sw/bin/bash" >> /etc/passwd
- mkdir -p ~/.ssh
2021-06-14 22:56:15 +02:00
- echo "$$GITEA_SSH_KEY" > ~/.ssh/id_rsa
2021-06-14 22:43:57 +02:00
- echo "[git.b12f.io]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ4uaREL7acSSCNAX+voDYl1Kj7JipP62fR5x1UyGP9u" >> ~/.ssh/known_hosts
- echo "Host git.b12f.io" >> ~/.ssh/config
- echo " Port 2222" >> ~/.ssh/config
- chmod -R 600 ~/.ssh
2021-06-15 00:20:42 +02:00
- git clone -b devos git@git.b12f.io:pub-solar/os .
2021-06-14 23:00:30 +02:00
- git remote add devos git@git.b12f.io:pub-solar/devos
2021-05-29 20:21:58 +02:00
- git fetch --all
- git merge -X theirs devos/core
- git push origin devos
- name: "Sync core with upstream"
2021-06-14 22:28:29 +02:00
image: nixery.dev/shell/git/openssh
when:
status:
- success
2021-06-14 23:36:03 +02:00
event:
- cron
2021-06-14 23:38:49 +02:00
- promote
target:
- upstream
depends_on:
- "Sync upstream to local"
environment:
GITEA_SSH_KEY:
from_secret: gitea_ssh_key
2021-06-14 22:41:55 +02:00
HOME: /root
commands:
2021-06-14 22:41:55 +02:00
# This is a hack because nixery containers contain no passwd file, which openssh wants to read
- echo "root:x:0:0:System administrator:/root:/run/current-system/sw/bin/bash" >> /etc/passwd
- mkdir -p ~/.ssh
2021-06-14 22:56:15 +02:00
- echo "$$GITEA_SSH_KEY" > ~/.ssh/id_rsa
2021-06-14 22:43:57 +02:00
- echo "[git.b12f.io]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ4uaREL7acSSCNAX+voDYl1Kj7JipP62fR5x1UyGP9u" >> ~/.ssh/known_hosts
- echo "Host git.b12f.io" >> ~/.ssh/config
- echo " Port 2222" >> ~/.ssh/config
- chmod -R 600 ~/.ssh
2021-06-14 23:03:38 +02:00
- git fetch --all
2021-06-14 23:09:21 +02:00
- git checkout --track origin/core
- git merge origin/devos
2021-06-14 21:02:54 +02:00
- git push origin core
- name: "Notify success"
2021-06-14 23:38:49 +02:00
image: plugins/matrix
when:
status:
- success
2021-06-14 23:36:03 +02:00
event:
- cron
2021-06-14 23:38:49 +02:00
- promote
target:
- upstream
depends_on:
- "Sync core with upstream"
settings:
2021-06-14 23:31:08 +02:00
homeserver: https://matrix.pub.solar
2021-06-14 23:34:41 +02:00
roomid: dfQBqwkhIzrFjMSsxy:pub.solar
username:
from_secret: matrix_username
password:
from_secret: matrix_password
template: Upstreaming devos into core succeeded.
- name: "Open pull request for failed merge"
image: nixery.dev/shell/tea
when:
status:
- failure
2021-06-14 23:36:03 +02:00
event:
- cron
2021-06-14 23:38:49 +02:00
- promote
target:
- upstream
depends_on:
- "Sync core with upstream"
environment:
TEA_CONFIG:
from_secret: tea_config
commands:
- mkdir -p ~/.config/tea
2021-06-14 22:56:15 +02:00
- echo "$$TEA_CONFIG" > ~/.config/tea/config.yml
- tea pulls create --base core --head devos
2021-06-14 23:36:03 +02:00
- name: "Notify failure"
image: plugins/matrix
when:
status:
- success
2021-06-14 23:36:03 +02:00
event:
- cron
2021-06-14 23:38:49 +02:00
- promote
target:
- upstream
depends_on:
- "Open pull request for failed merge"
settings:
2021-06-14 23:31:08 +02:00
homeserver: https://matrix.pub.solar
2021-06-14 23:38:49 +02:00
roomid: dfQBqwkhIzrFjMSsxy:pub.solar
username:
from_secret: matrix_username
password:
from_secret: matrix_password
template: Upstreaming devos into core failed. A pull request has been created https://git.b12f.io/pub-solar/os/pulls