os/.drone.yml

182 lines
4.4 KiB
YAML
Raw Normal View History

---
2021-05-29 18:21:58 +00:00
kind: pipeline
type: docker
name: Upstreaming
2021-05-29 18:21:58 +00:00
steps:
- name: "Sync 'devos' branch with upstream"
image: alpine/git
when:
event:
- cron
cron:
- sync-main-with-upstream
2021-05-29 18:21:58 +00:00
environment:
GITEA_SSH_KEY:
from_secret: gitea_ssh_key
commands:
- ./.drone/setup_ssh.sh
- git remote add devos git@git.b12f.io:pub-solar/devos
- git remote set-url origin git@git.b12f.io:pub-solar/os
2021-05-29 18:21:58 +00:00
- git fetch --all
- git checkout -b devos --track origin/devos
- git merge -X theirs devos/main
- git push origin devos
- git remote set-url origin https://git.b12f.io/pub-solar/os.git
- 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:
2021-10-25 23:07:10 +00:00
- git fetch origin
- git checkout origin/main
- ./.drone/setup_ssh.sh
- git remote set-url origin git@git.b12f.io:pub-solar/os
- git fetch --all
- ./.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:
- 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)"
2021-10-24 18:13:31 +00:00
trigger:
event:
- cron
2021-10-24 18:13:31 +00:00
---
kind: pipeline
type: docker
name: Check
steps:
- name: "Check"
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
privileged: true
volumes:
- name: nix-store-cache
path: /tmp/build-store
2021-10-24 18:13:31 +00:00
when:
event:
- pull_request
- tag
environment:
NIX_FLAGS: "--store /tmp/build-store --print-build-logs --verbose"
2022-02-08 13:34:58 +00:00
SUBCMD_FLAGS: "--eval-store local"
2021-10-24 18:13:31 +00:00
commands:
2022-02-03 11:22:07 +00:00
- 'echo NIX_FLAGS: $NIX_FLAGS'
- 'echo SUBCMD_FLAGS: $SUBCMD_FLAGS'
# DEBUG: try if nix build works with build store as cache
#- nix $$NIX_FLAGS flake check $$SUBCMD_FLAGS
- nix $$NIX_FLAGS build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel"
- nix $$NIX_FLAGS develop --command echo OK
- nix $$NIX_FLAGS develop --command bud --help
volumes:
- name: nix-store-cache
host:
path: "/var/nix/build-store"
2021-10-24 18:13:31 +00:00
2021-10-24 20:55:28 +00:00
---
kind: pipeline
type: docker
name: Publish ISO
steps:
- name: "Build ISO"
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
privileged: true
2021-10-24 20:55:28 +00:00
volumes:
- name: file-exchange
2021-10-24 21:13:13 +00:00
path: /var/nix/iso-cache
- name: nix-store-cache
path: /tmp/build-store
2021-10-24 20:55:28 +00:00
commands:
- |
nix --store /tmp/build-store --print-build-logs --verbose \
2022-02-08 13:34:58 +00:00
develop --eval-store local --command \
bud build bootstrap bootstrapIso
2021-10-24 21:13:13 +00:00
- cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/
2021-10-24 20:55:28 +00:00
- name: "Publish ISO"
image: appleboy/drone-scp
volumes:
- name: file-exchange
2021-10-24 21:13:13 +00:00
path: /var/nix/iso-cache
2021-10-24 20:55:28 +00:00
settings:
host:
from_secret: ssh_host
user:
from_secret: ssh_user
port:
from_secret: ssh_port
key:
from_secret: ssh_key
target: /var/www/pub.solar
source:
2021-10-25 19:51:13 +00:00
- /var/nix/iso-cache/*.iso
2021-10-26 08:14:42 +00:00
strip_components: 3
2021-10-24 20:55:28 +00:00
depends_on:
- Check
trigger:
event:
2022-02-02 14:18:12 +00:00
- tag
2021-10-24 20:55:28 +00:00
volumes:
- name: file-exchange
temp: {}
- name: nix-store-cache
2021-10-24 20:55:28 +00:00
host:
path: "/var/nix/build-store"
2021-10-24 20:55:28 +00:00
---
kind: signature
hmac: 7ed23abadfcd0a30de070d90bb898a9b61b87a9547d9ccbb36ccca4d390db256
...