This improves the documentation and scripts responsible for
generating files. The main changes from the user's point of view
are:
* The `generate` script now supports four subcommands:
* `generate kubernetes` - Generate all Kubernetes bindings
* `generate examples` - Generate examples for the preferred Kubernetes version
* `generate readme` - Generate the README from the Dhall template
* `generate preferred` - Generate top-level files that re-export the preferred
Kubernetes version
The `generate` script without arguments generates everything
* Generation should be faster and more incremental now
For example, regenerating the `README` by itself should go more quickly since
it no longer requires regenerating any examples or Kubernetes bindings if
they haven't changed
This required overhauling the internal Nix code for generating these files
to support more granular builds.
Another consequence of this change is that the preferred Kubernetes
version no longer packages `Prelude.dhall`, `README.dhall` or the
`examples`. Those are now only stored within the top-level directory.
Currently CI does not enforce that they stay
in sync with the `1.17/` package, so I had to
explicitly run the `generate.sh` script to update
them. I will follow up with another change to
automate this check.
The script uses `/bin/sh` as the shell, but uses syntax that is
only defined for bash etc. These suggestions were made by
[`shellcheck`](https://www.shellcheck.net).
The `dhall-openapi` subproject from the `dhall-haskell` repository
supersedes `dhall-kubernetes-generator`, so this change switches over
to using that project.
Hydra complains about the branch name with:
```
hydra-eval-jobs returned exit code 1:
error: worker error: invalid Git branch/tag name 'refs/heads/nixos-unstable'
```
... and the branch name is not necessary anyway
Fixes https://github.com/dhall-lang/dhall-kubernetes/issues/86
The motivation of this is to more accurately model the Kubernetes
API semantics by not auto-omitting empty fields. This is because
a field set to `Some ([] : List T)` is not necessarily the same
as `None (List T)`.
This makes the typical case a bit more verbose (more `Some`s), but
the difference to the `./examples` shows that it's not too bad.
This improves the granularity of the Nix build graph in order to minimize
unnecessary rebuilds.
This also fixed several bugs in the package generation along the way, so
this change includes those fixes.
Related to https://github.com/dhall-lang/dhall-kubernetes/issues/75
This generalizes the machinery for fetching the Kubernetes OpenAPI spec to
support fetching multiple versions. In particular, the Kubernetes version
is no longer tied to the version of Nixpkgs that we use.