refactor(server): Move package source management logic to server
Introduces three new types representing each of the possible package sources and moves the logic for specifying the package source to the server. Concrete changes: * Determining whether a specified git reference is a commit vs. a branch/tag is now done in the server, and is done more precisely by using a regular expression. * Package sources now have a new `CacheKey` function which can be used to retrieve a key under which a build manifest can be cached *if* the package source is not a moving target (i.e. a full git commit hash of either nixpkgs or a private repository). This function is not yet used. * Users *must* now specify a package source, Nixery no longer defaults to anything and will fail to launch if no source is configured.
This commit is contained in:
parent
496a4ab847
commit
980f5e2187
8 changed files with 192 additions and 105 deletions
|
|
@ -118,15 +118,16 @@ func BuildImage(ctx *context.Context, cfg *config.Config, cache *BuildCache, ima
|
|||
return nil, err
|
||||
}
|
||||
|
||||
srcType, srcArgs := cfg.Pkgs.Render(image.Tag)
|
||||
|
||||
args := []string{
|
||||
"--timeout", cfg.Timeout,
|
||||
"--argstr", "name", image.Name,
|
||||
"--argstr", "packages", string(packages),
|
||||
"--argstr", "srcType", srcType,
|
||||
"--argstr", "srcArgs", srcArgs,
|
||||
}
|
||||
|
||||
if cfg.Pkgs != nil {
|
||||
args = append(args, "--argstr", "pkgSource", cfg.Pkgs.Render(image.Tag))
|
||||
}
|
||||
cmd := exec.Command("nixery-build-image", args...)
|
||||
|
||||
outpipe, err := cmd.StdoutPipe()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue