on master help sign in
command: Fix ob deploy test android by pulling in keytool with staticWhich
commit4c5fd2d06abda1527b97ad7c34d0c0f93e817f3e authorElliot Cameron <eacameron@gmail.com> dateWed 11 Mar 2020, 17:30 (7 years ago) parent02b7345
3 files changed+14−13
default.nix+1 lib/command/src/Obelisk/Command/Deploy.hs+10−13 lib/command/src/Obelisk/Command/Utils.hs+3
default.nix+1
@@ -68,6 +68,7 @@ let
6868 obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
6969 obelisk-command = haskellLib.overrideCabal (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}) {
7070 librarySystemDepends = [
71+ pkgs.jre
7172 pkgs.nix
7273 (haskellLib.justStaticExecutables self.ghcid)
7374 ];
lib/command/src/Obelisk/Command/Deploy.hs+10−13
@@ -272,19 +272,16 @@ instance FromJSON KeytoolConfig
272272instance ToJSON KeytoolConfig
273273
274274createKeystore :: MonadObelisk m => FilePath -> KeytoolConfig -> m ()
275−createKeystore root config = do
276− let expr = "with (import " <> toImplDir root <> ").reflex-platform.nixpkgs; pkgs.mkShell { buildInputs = [ pkgs.jdk ]; }"
277− callProcessAndLogOutput (Notice,Notice) $ setCwd (Just root) $ proc "nix-shell" ["-E" , expr, "--run" , keytoolCmd]
278− where
279− keytoolCmd = processToShellString "keytool"
280− [ "-genkeypair", "-noprompt"
281− , "-keystore", _keytoolConfig_keystore config
282− , "-keyalg", "RSA", "-keysize", "2048"
283− , "-validity", "1000000"
284− , "-storepass", _keytoolConfig_storepass config
285− , "-alias", _keytoolConfig_alias config
286− , "-keypass", _keytoolConfig_keypass config
287− ]
275+createKeystore root config =
276+ callProcessAndLogOutput (Notice, Notice) $ setCwd (Just root) $ proc jreKeyToolPath
277+ [ "-genkeypair", "-noprompt"
278+ , "-keystore", _keytoolConfig_keystore config
279+ , "-keyalg", "RSA", "-keysize", "2048"
280+ , "-validity", "1000000"
281+ , "-storepass", _keytoolConfig_storepass config
282+ , "-alias", _keytoolConfig_alias config
283+ , "-keypass", _keytoolConfig_keypass config
284+ ]
288285
289286-- | Simplified deployment configuration mechanism. At one point we may revisit this.
290287writeDeployConfig :: MonadObelisk m => FilePath -> FilePath -> String -> m ()
lib/command/src/Obelisk/Command/Utils.hs+3
@@ -44,6 +44,9 @@ nixExePath = $(staticWhich "nix")
4444nixBuildExePath :: FilePath
4545nixBuildExePath = $(staticWhich "nix-build")
4646
47+jreKeyToolPath :: FilePath
48+jreKeyToolPath = $(staticWhich "keytool")
49+
4750-- Check whether the working directory is clean
4851checkGitCleanStatus :: MonadObelisk m => FilePath -> Bool -> m Bool
4952checkGitCleanStatus repo withIgnored = do