os/.drone.yml
teutat3s 40b807044a CI: Fix drone cron daily target (#7)
Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/7
Reviewed-by: Benjamin Bädorf <b12f@noreply.example.org>
Co-authored-by: teutat3s <teutates@mailbox.org>
Co-committed-by: teutat3s <teutates@mailbox.org>
2021-06-20 18:56:38 +00:00

96 lines
2.2 KiB
YAML

---
kind: pipeline
type: docker
name: Upstreaming
steps:
- name: "Sync upstream to local"
image: alpine/git
when:
event:
- cron
- promote
target:
- upstream
- daily
branch:
- core
environment:
GITEA_SSH_KEY:
from_secret: gitea_ssh_key
commands:
- ./.drone/setup_ssh.sh
- git fetch
- git checkout devos
- 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
- git merge -X theirs devos/core
- git push origin devos
- name: "Sync branch with upstream"
image: alpine/git
when:
status:
- success
event:
- cron
- promote
target:
- upstream
- daily
environment:
GITEA_SSH_KEY:
from_secret: gitea_ssh_key
commands:
- ./.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
- promote
target:
- upstream
- daily
branch:
- core
environment:
TEA_CONFIG:
from_secret: tea_config
commands:
- mkdir -p ~/.config/tea
- echo "$$TEA_CONFIG" > ~/.config/tea/config.yml
- tea pulls create --base core --head devos
- name: "Notify matrix"
image: plugins/matrix
when:
status:
- success
- failure
event:
- cron
- promote
target:
- upstream
- daily
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: 3f9da0999ca494c3ea7100b286cb3de67469a7e54077d3f6a4a0ad6fa2fa690b
...