hapistrano 0.4.7.0 → 0.4.8.0
raw patch · 3 files changed
+18/−13 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- hapistrano.cabal +4/−4
- src/System/Hapistrano.hs +10/−9
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.4.8.0+### Modified+* Fix issue before activating release+ ## 0.4.7.0 ### Modified * Fix issue #210 which cuased concurrent deploys to pick only the first target.
hapistrano.cabal view
@@ -1,14 +1,14 @@ cabal-version: 1.18 name: hapistrano-version: 0.4.7.0+version: 0.4.8.0 synopsis: A deployment library for Haskell applications description: . Hapistrano makes it easy to reliably deploy Haskell applications to a server. .- Following popular libraries like Ruby's <http://capistranorb.com/- Capistrano>, Hapistrano does the work of building the application+ Following popular libraries like Ruby's <https://capistranorb.com Capistrano>,+ Hapistrano does the work of building the application with dependencies into a distinct folder, and then atomically moves a symlink to the latest complete build. .@@ -16,7 +16,7 @@ build is complete. Rollback is even simpler, since Hapistrano can just point the `current` symlink to the previous release. .- See <https://github.com/stackbuilders/hapistrano the project readme on GitHub>+ See <https://github.com/stackbuilders/hapistrano#readme the project readme on GitHub> for more information. . license: MIT
src/System/Hapistrano.hs view
@@ -120,14 +120,10 @@ -> Hapistrano () activateRelease ts deployPath release = do rpath <- releasePath deployPath release Nothing- isRpathExist <- doesDirExist rpath- if isRpathExist then do- let tpath = tempSymlinkPath deployPath- cpath = currentSymlinkPath deployPath- exec (Ln ts rpath tpath) (Just release) -- create a symlink for the new candidate- exec (Mv ts tpath cpath) (Just release) -- atomically replace the symlink- else- failWith 1 (Just $ "The release path '" <> show rpath <> "' cannot be activated.") (Just release)+ let tpath = tempSymlinkPath deployPath+ cpath = currentSymlinkPath deployPath+ exec (Ln ts rpath tpath) (Just release) -- create a symlink for the new candidate+ exec (Mv ts tpath cpath) (Just release) -- atomically replace the symlink -- | Creates the file @.hapistrano__state@ containing -- @fail@ or @success@ depending on how the deployment ended.@@ -209,7 +205,12 @@ releases <- releasesWithState Success deployPath case genericDrop n releases of [] -> failWith 1 (Just "Could not find the requested release to rollback to.") Nothing- (x:_) -> activateRelease ts deployPath x+ (x:_) -> do+ rpath <- releasePath deployPath x Nothing+ isRpathExist <- doesDirExist rpath+ if isRpathExist+ then activateRelease ts deployPath x+ else failWith 1 (Just $ "Cannot rollback to the release path '" <> show rpath <> "'.") (Just x) forM_ mbRestartCommand (`exec` Nothing) -- | Remove older releases to avoid filling up the target host filesystem.