Fix #32: include the git revision in the Hydra build (#33)

This commit is contained in:
Fabrizio Ferrai 2018-09-04 11:11:40 +03:00 committed by GitHub
parent 4fec2167a8
commit 11a986ae11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 4 deletions

View File

@ -274,8 +274,15 @@ metadata:
### Tests
All tests are defined in `release.nix`. We run these tests in CI in a [Hydra
project][hydra-project]. You can run the tests locally with `nix build --no-link
release.nix`.
project][hydra-project].
You can run the tests locally with the following somewhat magic command:
```bash
nix-build --no-link -E 'with import <nixpkgs> {}; callPackage ./release.nix { src.rev = ""; }'
```
It is so because `release.nix` expects Hydra to provide the git revision in `src.rev`,
but locally we don't have/want that, so we just call the function with an empty string.
### Changing the README

View File

@ -90,8 +90,15 @@ ${../examples/out/ingress.yaml as Text}
### Tests
All tests are defined in `release.nix`. We run these tests in CI in a [Hydra
project][hydra-project]. You can run the tests locally with `nix build --no-link
release.nix`.
project][hydra-project].
You can run the tests locally with the following somewhat magic command:
```bash
nix-build --no-link -E 'with import <nixpkgs> {}; callPackage ./release.nix { src.rev = ""; }'
```
It is so because `release.nix` expects Hydra to provide the git revision in `src.rev`,
but locally we don't have/want that, so we just call the function with an empty string.
### Changing the README

View File

@ -1,3 +1,4 @@
{ src, ... }:
let
pkgs = import ./nixpkgs.nix;
@ -43,6 +44,14 @@ let
LC_ALL=en_US.UTF-8 ./scripts/build-examples.py $out
'';
# Derivation that trivially depends on the input source code revision.
# As this is included in the "dhall-lang" aggregate, it forces every
# commit to have a corresponding GitHub status check, even if the
# commit doesn't make any changes (which can happen when merging
# master in).
rev = pkgs.runCommand "rev" {} ''echo "${src.rev}" > $out'';
in {
dhall-kubernetes = pkgs.releaseTools.aggregate {
name = "dhall-kubernetes";
@ -50,6 +59,7 @@ in {
generatedFilesCompile
validateExamples
buildReadme
rev
];
};
}