mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-21 21:50:43 -06:00
abstractions
This commit is contained in:
parent
8114ac1b3b
commit
7baf2fc303
1 changed files with 14 additions and 20 deletions
|
@ -400,35 +400,29 @@ proc getUpdatedLockFile() =
|
||||||
fatalQuit "failed to fetch updated lock file using git"
|
fatalQuit "failed to fetch updated lock file using git"
|
||||||
writeFile("updated.lock", res.stdout)
|
writeFile("updated.lock", res.stdout)
|
||||||
|
|
||||||
proc ciUpdate*(rest: seq[string]) =
|
# probably duplicating logic above ¯\_(ツ)_/¯
|
||||||
# TODO: deduplicated logic in this proc
|
proc buildSystem(host: string, rest: seq[string]) =
|
||||||
for host in getHosts():
|
|
||||||
info "building " & host.bb("bold")
|
|
||||||
var cmd = nixCommand("build")
|
var cmd = nixCommand("build")
|
||||||
cmd.addArg nixosConfigAttr(host)
|
cmd.addArg nixosConfigAttr(host)
|
||||||
# TODO: how to get the out link?
|
|
||||||
cmd.addArgs ["--out-link", host & "-current"]
|
|
||||||
cmd.addArg "--quiet"
|
|
||||||
cmd.addArgs rest
|
cmd.addArgs rest
|
||||||
let code = runCmd cmd
|
let code = runCmd cmd
|
||||||
if code != 0:
|
if code != 0:
|
||||||
# TODO: nix log "attr"?
|
|
||||||
discard runCmd("nix log " & nixosConfigAttr(host))
|
|
||||||
fatalQuit "build failed"
|
fatalQuit "build failed"
|
||||||
|
|
||||||
|
proc ciUpdate*(rest: seq[string]) =
|
||||||
|
for host in getHosts():
|
||||||
|
info "building " & host.bb("bold")
|
||||||
|
buildSystem(
|
||||||
|
host,
|
||||||
|
@["--out-link", host & "-current", "--quiet"] & rest
|
||||||
|
)
|
||||||
|
|
||||||
getUpdatedLockFile()
|
getUpdatedLockFile()
|
||||||
|
|
||||||
for host in getHosts():
|
for host in getHosts():
|
||||||
info "building updated " & host.bb("bold")
|
info "building updated " & host.bb("bold")
|
||||||
var cmd = nixCommand("build")
|
buildSystem(
|
||||||
cmd.addArg nixosConfigAttr(host)
|
host,
|
||||||
cmd.addArgs ["--out-link", host & "-updated"]
|
@["--out-link", host & "-updated", "--quiet", "--reference-lock-file", "updated.lock"] & rest
|
||||||
cmd.addArg "--quiet"
|
)
|
||||||
cmd.addArgs ["--reference-lock-file", "updated.lock"]
|
|
||||||
cmd.addArgs rest
|
|
||||||
let code = runCmd cmd
|
|
||||||
if code != 0:
|
|
||||||
# TODO: nix log "attr"?
|
|
||||||
discard runCmd("nix log " & nixosConfigAttr(host))
|
|
||||||
fatalQuit "build failed"
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue