os/.drone.yml

140 lines
3.6 KiB
YAML
Raw Normal View History

2022-04-30 14:38:19 +00:00
---
kind: pipeline
type: docker
name: Check
steps:
- name: "Check"
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
when:
event:
- pull_request
environment:
NIX_FLAGS: "--print-build-logs --verbose"
commands:
- 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS'
2022-08-14 19:40:29 +00:00
- nix $$NIX_FLAGS develop --command nix flake show
2022-04-30 14:38:19 +00:00
- nix $$NIX_FLAGS build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel"
2022-08-13 20:14:36 +00:00
---
kind: pipeline
type: exec
name: Tests
steps:
2022-08-24 20:21:24 +00:00
- name: "Tests"
environment:
NIX_FLAGS: "--print-build-logs --verbose"
commands:
- 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS'
- nix $$NIX_FLAGS build ".#checks.x86_64-linux.customTestFor-PubSolarOS-firstTest"
- nix-store --read-log result
- nix $$NIX_FLAGS flake check
- nix $$NIX_FLAGS develop --command echo OK
2022-08-14 19:40:29 +00:00
- name: "Upload artifacts"
2022-08-14 19:56:16 +00:00
environment:
TRITON_DONT_SOURCE_PROFILE: 1
2022-08-14 19:56:16 +00:00
PRIVATE_SSH_KEY:
from_secret: private_ssh_key
MANTA_USER: pub_solar
MANTA_URL: https://eu-central.manta.greenbaum.cloud
MANTA_KEY_ID: "5d:5f:3d:22:8d:37:1f:e6:d6:ab:06:18:d9:a2:04:67"
2022-08-14 19:40:29 +00:00
commands:
- export TARGET_DIR="ci/$${DRONE_REPO}/$${DRONE_BUILD_NUMBER}"
2022-08-14 19:40:29 +00:00
- echo env var TARGET_DIR is set to $$TARGET_DIR
2022-08-14 20:38:15 +00:00
- "mkdir ~/.ssh && chmod 700 ~/.ssh"
2022-08-24 20:19:29 +00:00
- echo "$$PRIVATE_SSH_KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
2022-08-14 19:40:29 +00:00
- nix flake new --template "git+https://git.greenbaum.cloud/dev/tritonshell?ref=main" ./tritonshell
2022-08-14 19:46:22 +00:00
- git add tritonshell
2022-08-14 19:40:29 +00:00
- cd tritonshell
- nix develop --command mput -p -f ../result/foot_wayland_info.png ~~/public/$${TARGET_DIR}/foot_wayland_info.png
- nix develop --command mput -p -f ../result/test-wayland.out ~~/public/$${TARGET_DIR}/test-wayland.out
2022-08-14 19:40:29 +00:00
trigger:
ref:
- refs/tags/v*
- refs/tags/t*
2022-08-13 20:14:36 +00:00
2021-10-24 20:55:28 +00:00
---
kind: pipeline
type: docker
name: Notification
2021-10-24 20:55:28 +00:00
steps:
- name: "Notify matrix"
image: plugins/matrix
settings:
homeserver: https://matrix.pub.solar
roomid: dfQBqwkhIzrFjMSsxy:pub.solar
username:
from_secret: matrix_username
password:
from_secret: matrix_password
template: "Test run triggered by tag: {{ build.tag }}. Test run exit status: {{ build.status }}. Artifacts uploaded to Manta: https://eu-central.manta.greenbaum.cloud/pub_solar/public/ci/{{ repo.Owner }}/{{ repo.Name }}/{{ build.number }}/foot_wayland_info.png"
depends_on:
- Tests
trigger:
ref:
- refs/tags/v*
- refs/tags/t*
---
kind: pipeline
type: docker
name: Publish ISO
2021-10-24 20:55:28 +00:00
steps:
- name: "Build ISO"
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
environment:
NIX_FLAGS: "--print-build-logs --verbose"
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
2021-10-24 20:55:28 +00:00
commands:
- |
nix $$NIX_FLAGS build \
'.#nixosConfigurations.bootstrap.config.system.build.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
2022-05-01 23:22:49 +00:00
target: /srv/os
2021-10-24 20:55:28 +00:00
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
2022-04-30 15:03:00 +00:00
depends_on:
- Check
trigger:
branch:
- main
event:
- push
2021-10-24 20:55:28 +00:00
volumes:
- name: file-exchange
temp: {}
2021-10-24 20:55:28 +00:00
---
kind: signature
hmac: c6845bbec339e7ccfdb34889bfd56d25dc2c423eac255eb30f19b8d9e7bf9f1f
...