src: change deploy target

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-04-16 00:52:15 +05:30
parent 9851b69c6a
commit 3aade95b85
2 changed files with 10 additions and 4 deletions

View File

@@ -58,6 +58,8 @@
haskell-language-server
ghcid
];
SSHTARGET = "bat@weirdnatto.in:/var/lib/site/";
SSHTARGETPORT = 22001;
};
packages = {
inherit nattopages site;

View File

@@ -19,6 +19,8 @@ import Text.Pandoc
)
import qualified Text.Pandoc as Pandoc
import Text.Pandoc.Templates (Template, compileTemplate)
import System.Environment (getEnv)
import System.IO.Unsafe (unsafePerformIO)
--------------------------------------------------------------------------------
@@ -213,12 +215,14 @@ rssFeedConfiguration =
config :: Configuration
config =
defaultConfiguration
{ deployCommand =
"rsync --checksum -ave 'ssh -p 22001' \
\_site/* \
\root@weirdnatto.in:/var/lib/site/",
{ deployCommand = "rsync --checksum -ave 'ssh -p" ++ sshTargetPort ++"' _site/* " ++ sshTarget,
previewPort = 3333
}
where
{-# NOINLINE sshTarget#-}
sshTarget = unsafePerformIO $ getEnv "SSHTARGET"
{-# NOINLINE sshTargetPort#-}
sshTargetPort = unsafePerformIO $ getEnv "SSHTARGETPORT"
postCtx :: Tags -> Context String
postCtx tags =