Commit Graph

42 Commits

Author SHA1 Message Date
Cristhian Motoche
856f1037dd
Define Hapistrano with Deriving Via strategy (#204)
* Use deriving strategies

* Add missing type classes to derive from

* Remove duplicated runHapistrano

* Only derive from ReaderT

* Replace catch/throw
2022-09-08 09:34:24 -05:00
Franz Guzmán
c377835763
Maintenance mode commands (#169)
* Create maintenance command

* Read filepath and filename

zsh:1: command not found: q

* Addd config and test

* Addd config and test

* Add tests and imports

* Add test for writing maintenance file

Co-authored-by: Cristhian Motoche <CristhianMotoche@users.noreply.github.com>

* Expand writeMaintenancFile function

Co-authored-by: Cristhian Motoche <CristhianMotoche@users.noreply.github.com>

* Add functionality for command enable

Co-authored-by: Cristhian Motoche <CristhianMotoche@users.noreply.github.com>

* Add delete function

* Add filename and directory from configPath

zsh:1: command not found: wq

* Remove unused file

* Change variable name

* Remove Utils from cabal file

* Remove environment file

* Change pattern

* Add suggested formatting and comments

* Add more suggestions and option to run stack

* Update README with new variables

* Update README with changes

Co-authored-by: Cristhian Motoche <CristhianMotoche@users.noreply.github.com>
2022-04-19 14:03:17 -05:00
DavidMazarro
48bae772eb
Readded call to dropOldReleases when a deployment is successful 2022-02-07 13:38:50 +01:00
DavidMazarro
e2286dbdca
Removed short version of --keep-one-failed flag 2022-02-07 13:21:59 +01:00
DavidMazarro
b55d5bb9fc
Changed --keep-one-failed CLI short option from -f to -o
This is motivated by the fact that typically, `-f` is associated with some sort of "forcing" action, which is not what this does.
2022-02-04 17:14:33 +01:00
DavidMazarro
4da23e4f24
Deleted commented line 2022-02-04 17:14:33 +01:00
DavidMazarro
c219856969
--keep-one-failed flag now works and failed releases are deleted
Also: fully replaced `ctokens` with the new `.hapistrano_deploy_state`, updated the tests accordingly, and a couple more of necessary refactors.
2022-02-04 17:14:33 +01:00
DavidMazarro
7ea1b1b9ab
Moved exception handler from runHapistrano to main 2022-02-04 17:14:33 +01:00
DavidMazarro
d5a180dca3
When deploying a release, now it gets tagged with fail or success 2022-02-04 17:14:33 +01:00
DavidMazarro
d85a2598ee
Refactor and WIP createHapistranoDeployState
Refactor is mainly moving runHapistrano from System.Hapistrano.Core to System.Hapistrano, and moving Opts and Command datatypes from Main to System.Hapistrano.Types
2022-02-04 17:14:33 +01:00
DavidMazarro
f57cc0c739
Fixed accidental import removal in previous commit 2022-02-04 17:14:33 +01:00
DavidMazarro
7bb0405bfb
Added CLI flag and hap.yaml setting for keeping failed releases 2022-02-04 17:14:33 +01:00
Juan Paucar
4863bc9421 fix older than ghc 9 warnings 2021-10-18 09:25:58 -05:00
Sebastián Estrella
e06c8dc063 Use configWorkingDir 2021-03-29 11:06:58 -05:00
Sebastián Estrella
4c13a5f6a4 Pass workingDirectory as an argument to playScript 2021-03-29 11:06:58 -05:00
Juan Paucar
c9efb6cd05
Loose constraint for formatting (#151)
* Remove unnecessary dependency

* Loose formatting constraint

* Bump version

* Disable OSX temporally
2021-03-21 21:29:18 -05:00
Esteban Ibarra
a6183c01fb
Copy directory instead of cloning an entire repository (#135)
* Copy directory instead of cloning an entire repository

* Improve haddock of types

* Rename new ADT to Source

* Add tests for new configuration

* Update changelog and readme

* Addres PR comments

* Updated changelog and hapistrano's version

Co-authored-by: Juan Paucar <jpaucar@stackbuilders.com>
2020-03-29 19:54:39 -05:00
Cristhian Motoche
3c3f48486c
Add SSH args (#122)
* Allow SSH args

* Update README.md
2019-10-28 16:23:01 -05:00
Cristhian Motoche
2b7b95d4fb
Support for zsh default shell fails (#110)
* Use zsh and bash

* Install zsh in travis

* Update bounds

* Update version

* Install zsh using apt addons
2019-01-09 13:49:43 -05:00
Cristhian Motoche
478bb91d26
Support shared files and directories (#109)
* Support shared files and directories

* Update README, CHANGELOG and PVP in .cabal file

* Add tests for shared files and dirs

* Update tests description

* Do not check the list order in files list

* Use a upper bound of directory

* Follow suggestions and comments in PR
2019-01-09 12:05:37 -05:00
Sebastián Estrella
f5fba2a5b2 Read release-format and keep-releases from the configuration file
Co-authored-by: Esteban Ibarra <eibarra1992@hotmail.com>
2018-10-20 08:23:24 -05:00
Sebastián Estrella
74b6039bc0 Add support to interpolate ENV variables in a configuration file 2018-09-21 14:06:55 -05:00
Götz Christ
9fcb3f24fe When showing version information also show git branch and commit 2017-12-27 17:27:38 -05:00
Götz Christ
a32b944001 Standarize style and small cleanup
Using stylish-haskell
2017-12-27 13:54:32 -05:00
Juan Carlos Paucar
e05ecf6f70 Make distinction between target platforms for deploy 2017-12-04 16:42:19 -05:00
Sibi Prabakaran
72b3784749
Play the scripts in the local machine (localhost) 2017-08-30 03:26:00 +05:30
Vanessa McHale
1b714978fe Generate help for subcommands 2017-05-15 21:38:22 -05:00
Sibi
2636cc5c06 Add ability to make version control related activities optional (#66) 2017-04-05 20:57:50 +03:00
Sibi
b2311466a3 Fix version display (#64)
The old way of seeing the version of the program was by doing
something like this:

hap deploy -v

This patch makes it viewable by doing like this (which I feel is a
proper way to do):

hap -v
2017-03-30 13:56:54 +03:00
mrkkrp
fd40572c90 Print newline after the final “Success.” message 2017-03-01 23:59:17 +03:00
Mark Karpov
e4790b3619 Implement concurrent multihost deployment (#60)
* Implement concurrent multi-host deployment
* Fix a couple of typos/obsolete info in ‘CHANGELOG.md’
2017-03-02 00:40:08 +04:00
mrkkrp
01a30ee43d Ensure that target directories for ‘scp’ actually exist
This is necessary because ‘scp’ has fewer options than normal ‘cp’ and so it
lacks flags that would prevent failing because of missing target location.
We add there these commands to ensure that copying of files always succeeds.
2017-02-21 19:45:56 +03:00
mrkkrp
ca396d19eb Restart command should be run after release activation 2017-02-21 19:44:54 +03:00
Mark Karpov
d791dd164e Add support for copying files and directories (#58) 2017-02-20 19:09:21 +04:00
Mark Karpov
e8b1d7a8d9 Use ‘hap.yaml’ to store configuration (#57) 2017-02-20 18:33:12 +04:00
Mark Karpov
7727061493 Add verification before rollbacks (#53) 2017-02-08 20:16:53 +04:00
Mark Karpov
72a1b75e70 Refactor/rewrite all the code (#52)
* Refactor/rewrite all the code

The change prepares solid ground for further improvements. This also fixes
at least two bugs:

* Proper support for empty lines and comments in build scripts.

* Previously switching to new releases was not atomic despite messing with
  symlinks. This is because it deleted the current link before creating the
  new one, but it should have created a new link and then use ‘mv’ to
  replace the old one atomically. The code has been changed to work properly
  now.

* Refresh the test suite as well

* Fix the build for older GHCs

* Use subshell for ‘cd’ commands
2017-02-06 19:04:00 +04:00
Cristhian Motoche
c6dd1bc640 Parse env variable PORT (#39) 2017-01-28 17:43:45 +04:00
Cristhian Motoche
64dd271aa5 Add optparse-applicative for parsing args (#46) 2017-01-28 17:05:37 +04:00
Juan Pedro Villa Isaza
e5b2a83cb2 Handle missing environment variables 2015-09-24 18:01:25 -05:00
Juan Pedro Villa Isaza
d4c623b45a Handle command line options with GetOpt (Close #33) 2015-09-24 16:18:00 -05:00
Juan Pedro Villa Isaza
c6fb4becfc Clean up (Cabal) package 2015-09-09 14:05:20 -05:00