teutat3s
1bd3019ca5
version 2.5+ with accept-flake-config flag, see:30496af598
c52fdf233b/images/nix-flakes/default.nix (L7)
https://github.com/NixOS/nixpkgs/blob/release-21.11/pkgs/top-level/aliases.nix#L603 https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/top-level/aliases.nix#L665 https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/package-management/nix/default.nix#L66
158 lines
3.6 KiB
YAML
158 lines
3.6 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Upstreaming
|
|
|
|
steps:
|
|
- 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 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 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:
|
|
- 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)"
|
|
|
|
trigger:
|
|
event:
|
|
- cron
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Check
|
|
|
|
steps:
|
|
- name: "Check"
|
|
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
|
|
when:
|
|
event:
|
|
- pull_request
|
|
- tag
|
|
commands:
|
|
- nix -Lv flake check
|
|
- nix -Lv build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel"
|
|
- nix -Lv develop -c echo OK
|
|
- nix -Lv develop --command bud --help
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Publish ISO
|
|
|
|
steps:
|
|
- name: "Build ISO"
|
|
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
|
|
volumes:
|
|
- name: nix-store
|
|
path: /var/nix/iso-cache
|
|
commands:
|
|
- nix -Lv develop --command bud build bootstrap bootstrapIso
|
|
- cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/
|
|
|
|
- name: "Publish ISO"
|
|
image: appleboy/drone-scp
|
|
volumes:
|
|
- name: nix-store
|
|
path: /var/nix/iso-cache
|
|
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:
|
|
- /var/nix/iso-cache/*.iso
|
|
strip_components: 3
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
branch:
|
|
- feature/basic-iso
|
|
|
|
volumes:
|
|
- name: nix-store
|
|
host:
|
|
path: "/var/nix/iso-cache"
|
|
|
|
---
|
|
kind: signature
|
|
hmac: c25dac3dfd8dd9b46394fb3cd0313c3bccc81cbee10ab9f281a15eb4ac455cd0
|
|
|
|
...
|