Add Drone CI

This commit is contained in:
Alex 2022-12-01 17:05:32 +01:00
parent 0ae7f5fbd9
commit ee18ddcebc
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE
3 changed files with 55 additions and 10 deletions

38
.drone.yml Normal file
View file

@ -0,0 +1,38 @@
---
kind: pipeline
name: default
node:
nix-daemon: 1
steps:
- name: check formatting
image: nixpkgs/nix:nixos-22.05
commands:
- nix-shell -p cargo --run "cargo fmt -- --check"
- name: build
image: nixpkgs/nix:nixos-22.05
commands:
- nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#debug.x86_64-linux.tricot
- name: test
image: nixpkgs/nix:nixos-22.05
commands:
- nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#test.x86_64-linux.tricot
- ./result-bin/bin/tricot-*
trigger:
event:
- custom
- push
- pull_request
- tag
- cron
---
kind: signature
hmac: c99528a32d4c9f5016e6143e08291c99a8b248880f7dc3ee3550803e16cd28ad
...

View file

@ -1,5 +1,7 @@
# Tricot
[![Build Status](https://drone.deuxfleurs.fr/api/badges/Deuxfleurs/tricot/status.svg)](https://drone.deuxfleurs.fr/Deuxfleurs/tricot)
Tricot is a reverse-proxy for exposing your services via TLS that integrates well with Consul and Nomad.
Tricot does the following things:

View file

@ -15,17 +15,22 @@
overlays = [ cargo2nix.overlays.default ];
};
packageFun = import ./Cargo.nix;
packageSet = pkgs.rustBuilder.makePackageSet {
inherit packageFun;
release = true;
rustVersion = "1.63.0";
};
tricot = packageSet.workspace.tricot {
compileMode = "build";
};
rustVersion = "1.63.0";
compile = args: compileMode:
let
packageSet = pkgs.rustBuilder.makePackageSet ({
inherit packageFun rustVersion;
} // args);
in
packageSet.workspace.tricot {
inherit compileMode;
};
in
{
packages.x86_64-linux.tricot = tricot;
packages.x86_64-linux.default = tricot;
test.x86_64-linux.tricot = compile { release = false; } "test";
debug.x86_64-linux.tricot = compile { release = false; } "build";
packages.x86_64-linux.tricot = compile { release = true; } "build";
packages.x86_64-linux.default = self.packages.x86_64-linux.tricot;
};
}