forked from pub-solar/os
teutat3s
0f4f8eca37
Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/30 Co-authored-by: teutat3s <teutates@mailbox.org> Co-committed-by: teutat3s <teutates@mailbox.org>
104 lines
2.6 KiB
YAML
104 lines
2.6 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Upstreaming
|
|
|
|
steps:
|
|
- name: "Setup git repos and SSH access"
|
|
image: alpine/git
|
|
when:
|
|
event:
|
|
- cron
|
|
cron:
|
|
- sync-main-with-upstream
|
|
- sync-b12f-with-main
|
|
- sync-teutat3s-with-main
|
|
environment:
|
|
GITEA_SSH_KEY:
|
|
from_secret: gitea_ssh_key
|
|
commands:
|
|
- ./.drone/setup_ssh.sh
|
|
- git fetch
|
|
- git remote add devos git@git.b12f.io:pub-solar/devos
|
|
- git remote set-url origin git@git.b12f.io:pub-solar/os
|
|
- git fetch --all
|
|
|
|
- name: "Sync 'devos' branch with upstream"
|
|
image: alpine/git
|
|
when:
|
|
event:
|
|
- cron
|
|
cron:
|
|
- sync-main-with-upstream
|
|
environment:
|
|
GITEA_SSH_KEY:
|
|
from_secret: gitea_ssh_key
|
|
commands:
|
|
- ./.drone/setup_ssh.sh
|
|
- git checkout origin/devos
|
|
- git merge -X theirs devos/main
|
|
- git push origin devos
|
|
|
|
- name: "Sync $BRANCH with upstream"
|
|
image: alpine/git
|
|
when:
|
|
event:
|
|
- cron
|
|
cron:
|
|
- sync-main-with-upstream
|
|
- sync-b12f-with-main
|
|
- sync-teutat3s-with-main
|
|
environment:
|
|
GITEA_SSH_KEY:
|
|
from_secret: gitea_ssh_key
|
|
commands:
|
|
- git checkout origin/main
|
|
- ./.drone/setup_ssh.sh
|
|
- git remote set-url origin git@git.b12f.io:pub-solar/os
|
|
- ./.drone/upstream-branch.sh
|
|
|
|
- name: "Open pull request for failed merge"
|
|
image: nixery.dev/shell/tea
|
|
when:
|
|
status:
|
|
- failure
|
|
event:
|
|
- cron
|
|
cron:
|
|
- sync-main-with-upstream
|
|
- sync-b12f-with-main
|
|
- sync-teutat3s-with-main
|
|
environment:
|
|
TEA_CONFIG:
|
|
from_secret: tea_config
|
|
commands:
|
|
- mkdir -p ~/.config/tea
|
|
- echo "$$TEA_CONFIG" > ~/.config/tea/config.yml
|
|
- tea pulls create --base main --head devos
|
|
|
|
- name: "Notify matrix"
|
|
image: plugins/matrix
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
event:
|
|
- cron
|
|
cron:
|
|
- sync-main-with-upstream
|
|
- sync-b12f-with-main
|
|
- sync-teutat3s-with-main
|
|
settings:
|
|
homeserver: https://matrix.pub.solar
|
|
roomid: dfQBqwkhIzrFjMSsxy:pub.solar
|
|
username:
|
|
from_secret: matrix_username
|
|
password:
|
|
from_secret: matrix_password
|
|
template: "Upstreaming {{ build.status }} [{{ build.branch }}#{{ truncate build.commit 8 }}]({{ build.link }}) by {{ build.author }}. [Pull requests](https://git.b12f.io/pub-solar/os/pulls)"
|
|
---
|
|
kind: signature
|
|
hmac: f88330a68ced90f4c242aedcbec9359fa63f00c47db6707e2646546daa4a9109
|
|
|
|
...
|