git-server features
This commit is contained in:
parent
ac51ef5f30
commit
c796abb799
1 changed files with 5 additions and 5 deletions
|
@ -13,7 +13,6 @@ let
|
||||||
bins = [ pkgs.git pkgs.nix ];
|
bins = [ pkgs.git pkgs.nix ];
|
||||||
imports = [
|
imports = [
|
||||||
"System.Environment (lookupEnv)"
|
"System.Environment (lookupEnv)"
|
||||||
"Control.Monad (ap)"
|
|
||||||
"System.Directory (withCurrentDirectory)"
|
"System.Directory (withCurrentDirectory)"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -26,17 +25,18 @@ let
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
mirror <- lookupEnv "GL_OPTION_MIRROR"
|
mirror <- lookupEnv "GL_OPTION_MIRROR"
|
||||||
for_ mirror $ \mirror -> do
|
whenJust mirror $ \mirror -> do
|
||||||
echo ([i|Forwarding push to #{mirror}|] :: String)
|
echo ([i|Forwarding push to #{mirror}|] :: String)
|
||||||
git "push" "--all" "-f" mirror
|
git "push" "--all" "-f" mirror
|
||||||
deploy <- lookupEnv "GL_OPTION_WEB_DEPLOY"
|
deploy <- lookupEnv "GL_OPTION_WEB_DEPLOY"
|
||||||
for_ deploy $ \deploy -> do
|
whenJust deploy $ \deploy -> do
|
||||||
|
(maybe [] ("-A":) -> target) <- lookupEnv "GL_OPTION_WEB_DEPLOY_NIX_TARGET"
|
||||||
(decodeUtf8 -> path) <- pwd |> captureTrim
|
(decodeUtf8 -> path) <- pwd |> captureTrim
|
||||||
echo ([i|Deploying build to /var/www/#{deploy}|] :: String)
|
echo ([i|Deploying build to /var/www/#{deploy}|] :: String)
|
||||||
bracket (checkout path) (rm "-rf") $ \dir -> withCurrentDirectory dir $ nix "build" "-o" ([i|/var/www/#{deploy}|] :: String)
|
bracket (checkout path) (rm "-rf") $ \dir -> withCurrentDirectory dir $ nix "build" "-o" ([i|/var/www/#{deploy}|] :: String) target
|
||||||
echo "Done"
|
echo "Done"
|
||||||
test <- lookupEnv "GL_OPTION_TEST"
|
test <- lookupEnv "GL_OPTION_TEST"
|
||||||
for_ test $ \_ -> do
|
whenJust test $ \_ -> do
|
||||||
echo "Triggering (an async) system update."
|
echo "Triggering (an async) system update."
|
||||||
exe "sudo" ${haskellList update-command};
|
exe "sudo" ${haskellList update-command};
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue