2022-04-30 14:38:19 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2022-10-14 23:58:36 +00:00
|
|
|
type: exec
|
2023-03-07 16:23:34 +00:00
|
|
|
name: Check and deploy
|
2022-10-14 23:58:36 +00:00
|
|
|
node:
|
|
|
|
hosttype: baremetal
|
2022-04-30 14:38:19 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Check"
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- pull_request
|
|
|
|
environment:
|
2023-01-29 01:46:53 +00:00
|
|
|
NIX_FLAGS: "--print-build-logs --verbose --accept-flake-config"
|
2022-04-30 14:38:19 +00:00
|
|
|
commands:
|
|
|
|
- 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS'
|
2022-08-14 19:40:29 +00:00
|
|
|
- nix $$NIX_FLAGS develop --command nix flake show
|
2023-03-07 00:13:08 +00:00
|
|
|
- nix $$NIX_FLAGS build ".#nixosConfigurations.host_001_momo_koeln.config.system.build.toplevel"
|
2022-02-03 10:24:02 +00:00
|
|
|
|
2023-03-07 16:23:34 +00:00
|
|
|
- name: "Deploy"
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
branch:
|
|
|
|
- momo/main
|
|
|
|
environment:
|
|
|
|
NIX_FLAGS: "--print-build-logs --verbose --accept-flake-config"
|
|
|
|
PRIVATE_SSH_KEY:
|
|
|
|
from_secret: ci_private_ssh_key
|
2023-03-07 20:51:43 +00:00
|
|
|
SSH_HOST_KEY: "80.244.242.4 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE7XTCHfX6ta8EtkdOcZLnpdhMmXDfTebVMs4NC8JEPj"
|
2023-03-08 12:25:49 +00:00
|
|
|
# SSH uses HOME from /etc/passwd, not from the environment, so override it
|
|
|
|
NIX_SSHOPTS: "-o UserKnownHostsFile=$$HOME/.ssh/known_hosts -i $$HOME/.ssh/id_ed25519"
|
2023-03-07 16:23:34 +00:00
|
|
|
commands:
|
2023-03-08 12:25:49 +00:00
|
|
|
- mkdir $$HOME/.ssh && chmod 700 $$HOME/.ssh
|
|
|
|
- echo "$$PRIVATE_SSH_KEY" > $$HOME/.ssh/id_ed25519 && chmod 600 $$HOME/.ssh/id_ed25519
|
|
|
|
- echo "$$SSH_HOST_KEY" > $$HOME/.ssh/known_hosts
|
|
|
|
- "echo DEBUG: Using NIX_FLAGS: $$NIX_FLAGS"
|
|
|
|
- nix $$NIX_FLAGS develop --command deploy --magic-rollback false --skip-checks --targets '.#host_001_momo_koeln'
|
2023-03-07 16:23:34 +00:00
|
|
|
|
2022-06-04 21:45:06 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: exec
|
|
|
|
name: Tests
|
2022-10-14 23:58:36 +00:00
|
|
|
node:
|
|
|
|
hosttype: baremetal
|
2022-06-04 21:45:06 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Tests"
|
|
|
|
environment:
|
2023-01-29 01:46:53 +00:00
|
|
|
NIX_FLAGS: "--print-build-logs --verbose --accept-flake-config"
|
2022-06-04 21:45:06 +00:00
|
|
|
commands:
|
|
|
|
- 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS'
|
|
|
|
- nix $$NIX_FLAGS build ".#checks.x86_64-linux.customTestFor-PubSolarOS-firstTest"
|
2022-08-14 18:51:56 +00:00
|
|
|
- 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"
|
|
|
|
environment:
|
|
|
|
TRITON_DONT_SOURCE_PROFILE: 1
|
|
|
|
PRIVATE_SSH_KEY:
|
|
|
|
from_secret: private_ssh_key
|
|
|
|
MANTA_USER: pub_solar
|
|
|
|
MANTA_URL: https://eu-central.manta.greenbaum.cloud
|
2022-08-24 20:36:53 +00:00
|
|
|
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:
|
2022-08-25 13:42:33 +00:00
|
|
|
- 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
|
|
|
|
- "mkdir ~/.ssh && chmod 700 ~/.ssh"
|
|
|
|
- echo "$$PRIVATE_SSH_KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
|
|
|
|
- nix flake new --template "git+https://git.greenbaum.cloud/dev/tritonshell?ref=main" ./tritonshell
|
|
|
|
- git add tritonshell
|
|
|
|
- cd tritonshell
|
2022-08-25 13:42:33 +00:00
|
|
|
- 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
|
|
|
|
2022-08-14 18:51:56 +00:00
|
|
|
trigger:
|
|
|
|
ref:
|
|
|
|
- refs/tags/v*
|
|
|
|
- refs/tags/t*
|
2022-06-04 21:45:06 +00:00
|
|
|
|
2022-08-24 20:36:53 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Notification
|
|
|
|
|
|
|
|
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
|
2022-08-25 13:42:33 +00:00
|
|
|
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"
|
2022-08-24 20:36:53 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
ref:
|
|
|
|
- refs/tags/v*
|
|
|
|
- refs/tags/t*
|
|
|
|
|
2021-10-24 20:55:28 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Publish ISO
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Build ISO"
|
2022-02-02 14:08:24 +00:00
|
|
|
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
|
2022-08-14 18:51:56 +00:00
|
|
|
environment:
|
2023-01-29 01:46:53 +00:00
|
|
|
NIX_FLAGS: "--print-build-logs --verbose --accept-flake-config"
|
2021-10-24 20:55:28 +00:00
|
|
|
volumes:
|
2022-02-03 10:24:02 +00:00
|
|
|
- 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:
|
2022-02-03 11:13:56 +00:00
|
|
|
- |
|
2022-08-14 18:51:56 +00:00
|
|
|
nix $$NIX_FLAGS build \
|
2022-08-29 13:19:07 +00:00
|
|
|
'.#nixosConfigurations.bootstrap.config.system.build.isoImage'
|
2022-10-02 21:59:08 +00:00
|
|
|
- cp $(readlink -f result)/iso/PubSolarOS*.iso /var/nix/iso-cache/
|
|
|
|
- nix shell nixpkgs#findutils
|
|
|
|
- cd /var/nix/iso-cache/
|
|
|
|
- export ISO_NAME=$(find . -name '*.iso' -printf "%f\n")
|
|
|
|
- sha256sum $ISO_NAME > $ISO_NAME.sha256
|
|
|
|
- ln -s $ISO_NAME PubSolarOS-latest.iso
|
|
|
|
- cp $ISO_NAME.sha256 PubSolarOS-latest.iso.sha256
|
|
|
|
- nix run nixpkgs#gnused -- --in-place "s/$ISO_NAME/PubSolarOS-latest.iso/" PubSolarOS-latest.iso.sha256
|
2021-10-24 20:55:28 +00:00
|
|
|
|
|
|
|
- name: "Publish ISO"
|
2023-02-02 16:30:01 +00:00
|
|
|
# https://github.com/appleboy/drone-scp/pull/141 got merged, yay
|
|
|
|
image: appleboy/drone-scp:1.6.5-linux-amd64
|
2021-10-24 20:55:28 +00:00
|
|
|
volumes:
|
2022-02-03 10:24:02 +00:00
|
|
|
- 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:
|
2022-08-29 14:47:31 +00:00
|
|
|
from_secret: iso_web_ssh_host
|
2021-10-24 20:55:28 +00:00
|
|
|
user:
|
2022-08-29 14:47:31 +00:00
|
|
|
from_secret: iso_web_ssh_user
|
2021-10-24 20:55:28 +00:00
|
|
|
port:
|
2022-08-29 14:47:31 +00:00
|
|
|
from_secret: iso_web_ssh_port
|
2021-10-24 20:55:28 +00:00
|
|
|
key:
|
2022-08-29 14:47:31 +00:00
|
|
|
from_secret: iso_web_ssh_key
|
2023-01-29 16:38:00 +00:00
|
|
|
target: /srv/www/os/download
|
2021-10-24 20:55:28 +00:00
|
|
|
source:
|
2021-10-25 19:51:13 +00:00
|
|
|
- /var/nix/iso-cache/*.iso
|
2022-10-02 21:59:08 +00:00
|
|
|
- /var/nix/iso-cache/*.iso.sha256
|
2022-10-20 11:56:57 +00:00
|
|
|
unlink_first: true
|
2021-10-26 08:14:42 +00:00
|
|
|
strip_components: 3
|
2021-10-24 20:55:28 +00:00
|
|
|
|
2021-10-26 08:40:03 +00:00
|
|
|
trigger:
|
2022-08-14 18:51:56 +00:00
|
|
|
branch:
|
|
|
|
- main
|
2021-10-26 08:40:03 +00:00
|
|
|
event:
|
2022-08-14 18:51:56 +00:00
|
|
|
- push
|
2021-10-26 08:40:03 +00:00
|
|
|
|
2021-10-24 20:55:28 +00:00
|
|
|
volumes:
|
2022-02-03 10:24:02 +00:00
|
|
|
- name: file-exchange
|
|
|
|
temp: {}
|
2021-10-24 20:55:28 +00:00
|
|
|
|
2021-06-14 23:28:23 +00:00
|
|
|
---
|
|
|
|
kind: signature
|
2023-03-08 12:25:49 +00:00
|
|
|
hmac: c7083fb6372539aee0c22490f08252ec310de8e92f6d5b7d58872ffc649de660
|
2021-06-14 23:28:23 +00:00
|
|
|
|
|
|
|
...
|