2021-05-29 18:21:58 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: api
|
|
|
|
|
|
|
|
steps:
|
2021-06-14 19:39:29 +00:00
|
|
|
- name: "Sync upstream to local"
|
2021-06-14 20:28:29 +00:00
|
|
|
image: nixery.dev/shell/git/openssh
|
2021-05-29 18:21:58 +00:00
|
|
|
environment:
|
|
|
|
GITEA_SSH_KEY:
|
|
|
|
from_secret: gitea_ssh_key
|
2021-06-14 20:41:55 +00:00
|
|
|
HOME: /root
|
2021-05-29 18:21:58 +00:00
|
|
|
commands:
|
2021-06-14 20:41:55 +00: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
|
2021-06-14 19:44:15 +00:00
|
|
|
- mkdir -p ~/.ssh
|
2021-06-14 20:49:37 +00:00
|
|
|
- echo $$GITEA_SSH_KEY > ~/.ssh/id_rsa
|
2021-06-14 20:50:49 +00:00
|
|
|
- cat ~/.ssh/id_rsa
|
2021-06-14 20:43:57 +00:00
|
|
|
- echo "[git.b12f.io]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ4uaREL7acSSCNAX+voDYl1Kj7JipP62fR5x1UyGP9u" >> ~/.ssh/known_hosts
|
2021-06-14 19:47:38 +00:00
|
|
|
- echo "Host git.b12f.io" >> ~/.ssh/config
|
|
|
|
- echo " Port 2222" >> ~/.ssh/config
|
2021-06-14 19:44:15 +00:00
|
|
|
- chmod -R 600 ~/.ssh
|
2021-06-14 20:32:17 +00:00
|
|
|
- git clone -b devos git@git.b12f.io:pub-solar/os
|
2021-06-14 19:02:54 +00:00
|
|
|
- cd os
|
2021-05-29 18:21:58 +00:00
|
|
|
- git remote add devos https://github.com/divnix/devos.git
|
|
|
|
- git fetch --all
|
2021-06-14 19:39:29 +00:00
|
|
|
- git merge -X theirs devos/core
|
|
|
|
- git push origin devos
|
|
|
|
|
|
|
|
- name: "Sync core with upstream"
|
2021-06-14 20:28:29 +00:00
|
|
|
image: nixery.dev/shell/git/openssh
|
2021-06-14 19:39:29 +00:00
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- success
|
|
|
|
depends_on:
|
|
|
|
- "Sync upstream to local"
|
|
|
|
environment:
|
|
|
|
GITEA_SSH_KEY:
|
|
|
|
from_secret: gitea_ssh_key
|
2021-06-14 20:41:55 +00:00
|
|
|
HOME: /root
|
2021-06-14 19:39:29 +00:00
|
|
|
commands:
|
2021-06-14 20:41:55 +00: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
|
2021-06-14 19:44:15 +00:00
|
|
|
- mkdir -p ~/.ssh
|
2021-06-14 20:49:37 +00:00
|
|
|
- echo $$GITEA_SSH_KEY > ~/.ssh/id_rsa
|
2021-06-14 20:43:57 +00:00
|
|
|
- echo "[git.b12f.io]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ4uaREL7acSSCNAX+voDYl1Kj7JipP62fR5x1UyGP9u" >> ~/.ssh/known_hosts
|
2021-06-14 19:47:38 +00:00
|
|
|
- echo "Host git.b12f.io" >> ~/.ssh/config
|
|
|
|
- echo " Port 2222" >> ~/.ssh/config
|
2021-06-14 19:44:15 +00:00
|
|
|
- chmod -R 600 ~/.ssh
|
2021-06-14 19:39:29 +00:00
|
|
|
- git clone -b core git@git.b12f.io:pub-solar/os
|
|
|
|
- cd os
|
|
|
|
- git fetch
|
|
|
|
- git merge devos
|
2021-06-14 19:02:54 +00:00
|
|
|
- git push origin core
|
2021-06-14 19:39:29 +00:00
|
|
|
|
2021-06-14 19:44:15 +00:00
|
|
|
- name: "Notify success"
|
2021-06-14 19:39:29 +00:00
|
|
|
image: plugins/matrix
|
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- success
|
|
|
|
depends_on:
|
|
|
|
- "Sync core with upstream"
|
|
|
|
settings:
|
|
|
|
homeserver: https://element.pub.solar
|
|
|
|
roomid: operations: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"
|
2021-06-14 19:41:13 +00:00
|
|
|
image: nixery.dev/shell/tea
|
2021-06-14 19:39:29 +00:00
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- failure
|
|
|
|
depends_on:
|
|
|
|
- "Sync core with upstream"
|
|
|
|
environment:
|
|
|
|
TEA_CONFIG:
|
|
|
|
from_secret: tea_config
|
|
|
|
commands:
|
2021-06-14 19:44:15 +00:00
|
|
|
- mkdir -p ~/.config/tea
|
2021-06-14 20:49:37 +00:00
|
|
|
- echo $$TEA_CONFIG > ~/.config/tea/config.yml
|
2021-06-14 19:39:29 +00:00
|
|
|
- tea pulls create --base core --head devos
|
|
|
|
|
2021-06-14 19:44:15 +00:00
|
|
|
- name: Notify failure
|
2021-06-14 19:39:29 +00:00
|
|
|
image: plugins/matrix
|
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- success
|
|
|
|
depends_on:
|
|
|
|
- "Open pull request for failed merge"
|
|
|
|
settings:
|
|
|
|
homeserver: https://element.pub.solar
|
|
|
|
roomid: operations: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
|