-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Also: - punctuation - fix links - remove unfixable links plus their description - remove mentions of `system-filepath` and `system-fileio` - update introductory example to latest GHC
- Loading branch information
1 parent
eee4eca
commit 4fe64d6
Showing
3 changed files
with
65 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE ExtendedDefaultRules #-} | ||
{-# OPTIONS_GHC -fno-warn-type-defaults #-} | ||
|
||
import Shelly | ||
import System.IO | ||
import Data.Text as T | ||
default (T.Text) | ||
|
||
main :: IO () | ||
main = do | ||
hSetBuffering stdout LineBuffering | ||
shelly $ verbosely $ do | ||
host <- run "uname" ["-n"] | ||
if T.stripEnd host == "local-machine" | ||
then do d <- cmd "date" | ||
c <- escaping False $ cmd "git" "log -1 | head -1 | awk '{print $2}'" | ||
appendfile "log/deploy.log" $ T.intercalate " - " [T.stripEnd d, c] | ||
uploads "my-server:/remote/path/" ["deploy"] | ||
sshPairs_ "my-server" [("cd", ["/remote/path"]), ("./deploy", [])] | ||
else do | ||
cmd "./script/angel" | ||
|
||
-- same path on remote host | ||
-- will create directories | ||
uploads :: Text -> [Text] -> Sh () | ||
uploads remote locals = rsync $ ["--relative"] ++ locals ++ [remote] | ||
|
||
rsync :: [Text] -> Sh () | ||
rsync args = run_ "rsync" $ ["--delete", "-avz", "--no-g"] ++ args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters