fix drone ci config (#6)
continuous-integration/drone/push Build is passing Details

Reviewed-on: #6
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
Co-authored-by: Hendrik Sokolowski <hensoko@gssws.de>
Co-committed-by: Hendrik Sokolowski <hensoko@gssws.de>
main
Hendrik Sokolowski 2024-02-25 22:10:00 +00:00 committed by hensoko
parent 6ce3f33c46
commit e001049060
Signed by: pub.solar gitea
GPG Key ID: F0332B04B7054873
4 changed files with 26 additions and 306 deletions

View File

@ -24,7 +24,7 @@ steps:
event:
- push
branch:
- momo/main
- main
environment:
NIX_FLAGS: "--print-build-logs --verbose --accept-flake-config"
PRIVATE_SSH_KEY:
@ -39,130 +39,8 @@ steps:
- "echo DEBUG: Using NIX_FLAGS: $$NIX_FLAGS"
- nix $$NIX_FLAGS develop --command deploy --magic-rollback false --skip-checks --targets '.#pioneer-momo-koeln' --ssh-opts="$$SSHOPTS"
---
kind: pipeline
type: exec
name: Tests
node:
hosttype: baremetal
steps:
- name: "Tests"
environment:
NIX_FLAGS: "--print-build-logs --verbose --accept-flake-config"
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
- 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
MANTA_KEY_ID: "5d:5f:3d:22:8d:37:1f:e6:d6:ab:06:18:d9:a2:04:67"
commands:
- export TARGET_DIR="ci/$${DRONE_REPO}/$${DRONE_BUILD_NUMBER}"
- 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
- 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
trigger:
ref:
- refs/tags/v*
- refs/tags/t*
---
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
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"
trigger:
ref:
- refs/tags/v*
- refs/tags/t*
---
kind: pipeline
type: docker
name: Publish ISO
steps:
- name: "Build ISO"
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
environment:
NIX_FLAGS: "--print-build-logs --verbose --accept-flake-config"
volumes:
- name: file-exchange
path: /var/nix/iso-cache
commands:
- |
nix $$NIX_FLAGS build \
'.#nixosConfigurations.bootstrap.config.system.build.isoImage'
- 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
- name: "Publish ISO"
# https://github.com/appleboy/drone-scp/pull/141 got merged, yay
image: appleboy/drone-scp:1.6.5-linux-amd64
volumes:
- name: file-exchange
path: /var/nix/iso-cache
settings:
host:
from_secret: iso_web_ssh_host
user:
from_secret: iso_web_ssh_user
port:
from_secret: iso_web_ssh_port
key:
from_secret: iso_web_ssh_key
target: /data/srv/www/os/download
source:
- /var/nix/iso-cache/*.iso
- /var/nix/iso-cache/*.iso.sha256
unlink_first: true
strip_components: 3
trigger:
branch:
- main
event:
- push
volumes:
- name: file-exchange
temp: {}
---
kind: signature
hmac: 8648f3838e519e4b493107ed02efafd59670337346db7e198d4058437a9a5622
hmac: 0a9bea82f36e5a63794b831c72182305a72901d0985f0a070f876ae7c48421be
...

View File

@ -1,6 +1,7 @@
# Momo infra repo
### Manage DNS records with terraform
```
cd terraform
terraform init

View File

@ -1,182 +0,0 @@
{
"blesh-nvfetcher": {
"cargoLocks": null,
"date": "2024-02-25",
"extract": null,
"name": "blesh-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": true,
"leaveDotGit": true,
"name": null,
"owner": "akinomyoga",
"repo": "ble.sh",
"rev": "ac84c153a5038814960475b0721f6ac6fad64bf2",
"sha256": "sha256-5swV96oLyimKSqE2s0lWZJpn4+sut3i/hy1xZjhqd4c=",
"type": "github"
},
"version": "ac84c153a5038814960475b0721f6ac6fad64bf2"
},
"instant-nvim-nvfetcher": {
"cargoLocks": null,
"date": "2022-06-25",
"extract": null,
"name": "instant-nvim-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "jbyuki",
"repo": "instant.nvim",
"rev": "294b6d08143b3db8f9db7f606829270149e1a786",
"sha256": "sha256-DXJWji/NR8ZCxe014rD51v3EHJHMhRQeOoI3SsY8mR4=",
"type": "github"
},
"version": "294b6d08143b3db8f9db7f606829270149e1a786"
},
"manix": {
"cargoLocks": null,
"date": "2021-04-20",
"extract": null,
"name": "manix",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "mlvzk",
"repo": "manix",
"rev": "d08e7ca185445b929f097f8bfb1243a8ef3e10e4",
"sha256": "sha256-GqPuYscLhkR5E2HnSFV4R48hCWvtM3C++3zlJhiK/aw=",
"type": "github"
},
"version": "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"
},
"rnix-lsp-nvfetcher": {
"cargoLocks": null,
"date": "2022-11-27",
"extract": null,
"name": "rnix-lsp-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "nix-community",
"repo": "rnix-lsp",
"rev": "95d40673fe43642e2e1144341e86d0036abd95d9",
"sha256": "sha256-F0s0m62S5bHNVWNHLZD6SeHiLrsDx98VQbRjDyIu+qQ=",
"type": "github"
},
"version": "95d40673fe43642e2e1144341e86d0036abd95d9"
},
"vim-apprentice-nvfetcher": {
"cargoLocks": null,
"date": "2023-02-15",
"extract": null,
"name": "vim-apprentice-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "romainl",
"repo": "Apprentice",
"rev": "59ad13661fa15edaf72c62218903c7817b5a3691",
"sha256": "sha256-03B9tmU9+6t2hxhOgZxBqJr9r41CAqhHLUkHYvFdcks=",
"type": "github"
},
"version": "59ad13661fa15edaf72c62218903c7817b5a3691"
},
"vim-beautify-nvfetcher": {
"cargoLocks": null,
"date": "2018-12-27",
"extract": null,
"name": "vim-beautify-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "zeekay",
"repo": "vim-beautify",
"rev": "e0691483927dc5a0c051433602397419f9628623",
"sha256": "sha256-QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ=",
"type": "github"
},
"version": "e0691483927dc5a0c051433602397419f9628623"
},
"vim-caddyfile-nvfetcher": {
"cargoLocks": null,
"date": "2022-05-09",
"extract": null,
"name": "vim-caddyfile-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "isobit",
"repo": "vim-caddyfile",
"rev": "24fe0720551883e407cb70ae1d7c03f162d1d5a0",
"sha256": "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o=",
"type": "github"
},
"version": "24fe0720551883e407cb70ae1d7c03f162d1d5a0"
},
"vim-workspace-nvfetcher": {
"cargoLocks": null,
"date": "2023-05-28",
"extract": null,
"name": "vim-workspace-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "thaerkh",
"repo": "vim-workspace",
"rev": "c0d1e4332a378f58bfdf363b4957168fa78e79b4",
"sha256": "sha256-2Brx098dk5THiieBiW71FG9mUUwS1CSY9mpOPWA/Tq4=",
"type": "github"
},
"version": "c0d1e4332a378f58bfdf363b4957168fa78e79b4"
},
"vimagit-nvfetcher": {
"cargoLocks": null,
"date": "2024-01-04",
"extract": null,
"name": "vimagit-nvfetcher",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "jreybert",
"repo": "vimagit",
"rev": "06afe48439d0118a77d622ef06eff0f7cd7d62ab",
"sha256": "sha256-2kugFr32lZINgpmDyfTyBp5lNa2/dculKmcFGa2q/io=",
"type": "github"
},
"version": "06afe48439d0118a77d622ef06eff0f7cd7d62ab"
}
}

23
treefmt.toml Normal file
View File

@ -0,0 +1,23 @@
[formatter.nix]
command = "alejandra"
includes = ["*.nix"]
excludes = ["pkgs/_sources/generated.nix"]
[formatter.prettier]
command = "prettier"
options = ["--write"]
includes = [
"*.json",
"*.yaml",
"*.md",
]
[formatter.shell]
command = "shfmt"
options = [
"-s",
"-w",
"-i",
"2",
]
includes = ["*.sh"]