on master help sign in
command: Fix deployment module import
commit3d1d3ff2ce8e56ec5f11fc944c5d1d134eaba46b authorElliot Cameron <eacameron@gmail.com> dateThu 12 Mar 2020, 14:11 (7 years ago) parent4c5fd2d
1 file changed+14−10
lib/command/src/Obelisk/Command/Deploy.hs+14−10
lib/command/src/Obelisk/Command/Deploy.hs+14−10
@@ -76,7 +76,7 @@ deployInit thunkPtr deployDir sshKeyPath hostnames route adminEmail enableHttps
7676 ]
7777
7878 let srcDir = deployDir </> "src"
79− withSpinner ("Creating source thunk (" <> T.pack srcDir <> ")") $ liftIO $ do
79+ withSpinner ("Creating source thunk (" <> T.pack (makeRelative deployDir srcDir) <> ")") $ liftIO $ do
8080 createThunk srcDir thunkPtr
8181 setupObeliskImpl deployDir
8282
@@ -86,16 +86,18 @@ deployInit thunkPtr deployDir sshKeyPath hostnames route adminEmail enableHttps
8686 writeDeployConfig deployDir "admin_email" adminEmail
8787 writeDeployConfig deployDir ("config" </> "common" </> "route") route
8888 writeDeployConfig deployDir "module.nix" $
89− "(import " <> toNixPath srcDir <> " {}).obelisk.serverModules.mkBaseEc2"
89+ "(import " <> toNixPath (makeRelative deployDir srcDir) <> " {}).obelisk.serverModules.mkBaseEc2"
9090
9191 withSpinner ("Initializing git repository (" <> T.pack deployDir <> ")") $
9292 initGit deployDir
9393
9494setupObeliskImpl :: FilePath -> IO ()
9595setupObeliskImpl deployDir = do
96− let implDir = toImplDir deployDir
96+ let
97+ implDir = toImplDir deployDir
98+ goBackUp = foldr (</>) "" $ (".." <$) $ splitPath $ makeRelative deployDir implDir
9799 createDirectoryIfMissing True implDir
98− writeFile (implDir </> "default.nix") "(import ../../src {}).obelisk"
100+ writeFile (implDir </> "default.nix") $ "(import " <> toNixPath (goBackUp </> "src") <> " {}).obelisk"
99101
100102deployPush :: MonadObelisk m => FilePath -> m [String] -> m ()
101103deployPush deployPath getNixBuilders = do
@@ -215,12 +217,14 @@ deployMobile platform mobileArgs = withProjectRoot "." $ \root -> do
215217 keytoolConfContents <- liftIO $ BSL.readFile keytoolConfPath
216218 keyArgs <- case eitherDecode keytoolConfContents :: Either String KeytoolConfig of
217219 Left err -> failWith $ T.pack err
218− Right conf -> pure [ "--sign"
219− , "--store-file", _keytoolConfig_keystore conf
220− , "--store-password", _keytoolConfig_storepass conf
221− , "--key-alias", _keytoolConfig_alias conf
222− , "--key-password", _keytoolConfig_keypass conf]
223− let expr = unwords
220+ Right conf -> pure
221+ [ "--sign"
222+ , "--store-file", _keytoolConfig_keystore conf
223+ , "--store-password", _keytoolConfig_storepass conf
224+ , "--key-alias", _keytoolConfig_alias conf
225+ , "--key-password", _keytoolConfig_keypass conf
226+ ]
227+ let expr = mconcat
224228 [ "with (import ", toNixPath srcDir, " {});"
225229 , "android.frontend.override (drv: {"
226230 , "isRelease = true;"