Try running test.nix
This commit is contained in:
parent
f81b0fac77
commit
48ee53bcb7
1 changed files with 5 additions and 3 deletions
|
@ -19,7 +19,7 @@ import Say
|
||||||
import Shh
|
import Shh
|
||||||
import System.Environment
|
import System.Environment
|
||||||
|
|
||||||
load Absolute ["laminarc", "git"]
|
load Absolute ["laminarc", "git", "nix-instantiate"]
|
||||||
|
|
||||||
repo = "git@hera.m-0.eu:nixos-config"
|
repo = "git@hera.m-0.eu:nixos-config"
|
||||||
|
|
||||||
|
@ -46,16 +46,18 @@ main = do
|
||||||
branch <- process <$> lookupEnv "BRANCH"
|
branch <- process <$> lookupEnv "BRANCH"
|
||||||
jobId <- getEnv "JOB"
|
jobId <- getEnv "JOB"
|
||||||
runId <- getEnv "RUN"
|
runId <- getEnv "RUN"
|
||||||
|
git "clone" repo "."
|
||||||
|
git "checkout" "branch"
|
||||||
|
(Text.dropAround ('"' ==) . decodeUtf8 . trim -> derivationName) <- nix_instantiate "test.nix" |> captureTrim
|
||||||
setEnv "LAMINAR_REASON" [i|Building config branch #{branch} for all systems in #{jobId}:#{runId}|]
|
setEnv "LAMINAR_REASON" [i|Building config branch #{branch} for all systems in #{jobId}:#{runId}|]
|
||||||
say [i|Starting builds of branch #{branch} for all systems.|]
|
say [i|Starting builds of branch #{branch} for all systems.|]
|
||||||
mapConcurrently_ (\x -> laminarc ["run", x, [i|BRANCH=#{branch}|]]) jobs
|
concurrently_ (mapConcurrently_ (\x -> laminarc ["run", x, [i|BRANCH=#{branch}|]]) jobs) $ exe "nix-jobs" ["realise", toString derivationName]
|
||||||
say [i|Builds succeeded.|]
|
say [i|Builds succeeded.|]
|
||||||
when (branch == "master") $ do
|
when (branch == "master") $ do
|
||||||
say [i|Deploying new config to localhost.|]
|
say [i|Deploying new config to localhost.|]
|
||||||
exe "/run/wrappers/bin/sudo" deployCommand
|
exe "/run/wrappers/bin/sudo" deployCommand
|
||||||
when (branch == "niv-bump") $ do
|
when (branch == "niv-bump") $ do
|
||||||
say [i|Merging branch niv-bump into master.|]
|
say [i|Merging branch niv-bump into master.|]
|
||||||
git "clone" repo "."
|
|
||||||
git "checkout" "master"
|
git "checkout" "master"
|
||||||
git "merge" "origin/niv-bump"
|
git "merge" "origin/niv-bump"
|
||||||
git "push"
|
git "push"
|
||||||
|
|
Loading…
Reference in a new issue