on master help sign in
Merge pull request #188 from obsidiansystems/srid/ob-deploy-config

ob deploy push: actually push the deploy config

commit967599e870e4a5231b8d93a1cec30c9b90bc0a3c authorRyan Trinkle <ryan.trinkle@gmail.com> dateTue 31 Jul 2018, 09:15 (8 years ago) parent7a160c9a584e0b
3 files changed+14−9
default.nix+9−9 lib/command/src/Obelisk/Command/Deploy.hs+1 lib/command/src/Obelisk/Command/Nix.hs+4
default.nix+9−9
@@ -185,11 +185,11 @@ rec {
185185 set -eux
186186 ln -s "${justStaticExecutables backend}"/bin/backend $out/backend
187187 ln -s "${mkAssets assets}" $out/static.assets
188− ln -s "${config}" $out/config
188+ cp -r ${config} $out/config
189189 ln -s ${mkAssets (compressedJs frontend)} $out/frontend.jsexe.assets
190190 '';
191191
192− server = { exe, hostName, adminEmail, routeHost, enableHttps }:
192+ server = { exe, hostName, adminEmail, routeHost, enableHttps, ... }:
193193 let system = "x86_64-linux";
194194 nixos = import (pkgs.path + /nixos);
195195 backendPort = 8000;
@@ -302,15 +302,15 @@ rec {
302302 };
303303 };
304304 in mkProject (projectDefinition args));
305− serverOn = sys: serverExe (projectOut sys).ghc.backend (projectOut system).ghcjs.frontend static configPath;
306− linuxExe = serverOn "x86_64-linux";
307− in projectOut system // {
308− inherit linuxExe;
305+ serverOn = sys: config: serverExe (projectOut sys).ghc.backend (projectOut system).ghcjs.frontend static config;
309306 # `exe` is project's backend executable, with frontend assets, config, etc.
310307 # `linuxExe` is the same but built for x86_64-linux.
311− exe = serverOn system;
312− server = args@{ hostName, adminEmail, routeHost, enableHttps }:
313− server (args // { exe = linuxExe;});
308+ exe = serverOn system configPath;
309+ linuxExe = serverOn "x86_64-linux" configPath;
310+ in projectOut system // {
311+ inherit exe linuxExe;
312+ server = args@{ hostName, adminEmail, routeHost, enableHttps, config }:
313+ server (args // { exe = serverOn "x86_64-linux" config;});
314314 obelisk = import (base + "/.obelisk/impl") {};
315315 };
316316 haskellPackageSets = {
lib/command/src/Obelisk/Command/Deploy.hs+1
@@ -101,6 +101,7 @@ deployPush deployPath getNixBuilders = do
101101 , strArg "adminEmail" adminEmail
102102 , strArg "routeHost" routeHost
103103 , boolArg "enableHttps" enableHttps
104+ , rawArg "config" $ deployPath </> "config"
104105 ]
105106 , _nixBuildConfig_builders = builders
106107 }
lib/command/src/Obelisk/Command/Nix.hs+4
@@ -11,6 +11,7 @@ module Obelisk.Command.Nix
1111 , OutLink (..)
1212 , Arg (..)
1313 , boolArg
14+ , rawArg
1415 , strArg
1516 ) where
1617
@@ -57,6 +58,9 @@ data Arg
5758strArg :: String -> String -> Arg
5859strArg k = Arg_Str k
5960
61+rawArg :: String -> String -> Arg
62+rawArg k = Arg_Expr k
63+
6064boolArg :: String -> Bool -> Arg
6165boolArg k = Arg_Expr k . bool "false" "true"
6266