mina 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.md +27 -0
- data/Makefile +2 -0
- data/Readme.md +107 -34
- data/data/deploy.rb +3 -0
- data/lib/mina.rb +1 -0
- data/lib/mina/default.rb +1 -1
- data/lib/mina/helpers.rb +22 -2
- data/lib/mina/local_helpers.rb +98 -0
- data/lib/mina/rake.rb +1 -0
- data/lib/mina/version.rb +1 -1
- data/lib/mina/whenever.rb +11 -0
- data/spec/spec_helper.rb +1 -0
- data/support/Readme-footer.md +3 -4
- data/support/third_party_modules.md +23 -0
- data/test_env/config/deploy.rb +22 -5
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c6b0b3ddff51096031d949735044ec53b0c2484
|
4
|
+
data.tar.gz: 9645495211ff5442aad8b0986735da7d93157d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b70f4bcecbf9673c99898e5ee87d06b2db3adfd50545db587964f3e9a713112142d16fbd4eadba6a7c9a9711350a1bf0577d70b7a3b32b00d9be815901e2a7dd
|
7
|
+
data.tar.gz: a4d75cb1b9d44f45e8c7535b8b345cc061ad717f993d346779152af44265cc141e8e086f70abcd1d99b9b90a585e5a8a4edcdd22146af9a27a740d5fa50f6d2f
|
data/HISTORY.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
Latest version - Mar 27, 2015
|
2
|
+
-----------------------------
|
3
|
+
|
4
|
+
### Fixed:
|
5
|
+
* invoke does not work after a to block (#285)
|
6
|
+
|
7
|
+
### Added:
|
8
|
+
* before and after hooks
|
9
|
+
|
10
|
+
|
11
|
+
Latest version - Mar 10, 2015
|
12
|
+
-----------------------------
|
13
|
+
|
14
|
+
### Fixed:
|
15
|
+
* link typo in readme (#273) [Henare Degan]
|
16
|
+
* up formatting of code block in readme (#274) [Henare Degan]
|
17
|
+
* Rolling back to previous release (#9) [Tyler Mandry]
|
18
|
+
* ruby 1.8.7 and rake 0.9 issue with invoke
|
19
|
+
|
20
|
+
### Changed:
|
21
|
+
* update 3rd party list
|
22
|
+
* update docs, added db_rollback rails command
|
23
|
+
|
24
|
+
[Tyler Mandry]: https://github.com/tmandry
|
25
|
+
[Henare Degan]: https://github.com/henare
|
26
|
+
|
27
|
+
|
1
28
|
v0.3.2 - January 24, 2015
|
2
29
|
-----------------------------
|
3
30
|
|
data/Makefile
CHANGED
@@ -3,6 +3,7 @@ Readme.md: \
|
|
3
3
|
support/guide.md \
|
4
4
|
support/helpers.md \
|
5
5
|
support/modules.md \
|
6
|
+
support/third_party_modules.md \
|
6
7
|
support/Readme-footer.md
|
7
8
|
cat $^ > $@
|
8
9
|
|
@@ -15,6 +16,7 @@ support/modules.md: \
|
|
15
16
|
lib/mina/rails.rb \
|
16
17
|
lib/mina/rbenv.rb \
|
17
18
|
lib/mina/rvm.rb \
|
19
|
+
lib/mina/npm.rb \
|
18
20
|
lib/mina/whenever.rb
|
19
21
|
cat $^ | ruby support/to_md.rb > $@
|
20
22
|
|
data/Readme.md
CHANGED
@@ -56,13 +56,13 @@ change it's ownership to the correct user.
|
|
56
56
|
### Step 3: Run 'mina setup'
|
57
57
|
|
58
58
|
Back at your computer, do `mina setup` to set up the [folder
|
59
|
-
structure](#
|
59
|
+
structure](#directory_structure) in this path. This will connect to your server
|
60
60
|
via SSH and create the right directories.
|
61
61
|
|
62
62
|
$ mina setup
|
63
63
|
-----> Creating folders... done.
|
64
64
|
|
65
|
-
See [directory structure](#
|
65
|
+
See [directory structure](#directory_structure) for more info.
|
66
66
|
|
67
67
|
### Step 4: Deploy!
|
68
68
|
|
@@ -199,8 +199,7 @@ task :deploy do
|
|
199
199
|
|
200
200
|
# These are instructions to start the app after it's been prepared.
|
201
201
|
to :launch do
|
202
|
-
queue
|
203
|
-
queue "touch #{deploy_to}/#{current_path}/tmp/restart.txt"
|
202
|
+
queue 'touch tmp/restart.txt'
|
204
203
|
end
|
205
204
|
|
206
205
|
# This optional block defines how a broken release should be cleaned up.
|
@@ -300,7 +299,7 @@ Basic usage:
|
|
300
299
|
|
301
300
|
### Tasks
|
302
301
|
|
303
|
-
There are many tasks available. See the [tasks reference](http://mina-deploy.github.io/mina/tasks/
|
302
|
+
There are many tasks available. See the [tasks reference](http://mina-deploy.github.io/mina/tasks/), or
|
304
303
|
type `mina tasks`.
|
305
304
|
|
306
305
|
### Variables
|
@@ -316,7 +315,8 @@ You can add as many variables as needed.
|
|
316
315
|
# Helpers
|
317
316
|
|
318
317
|
### invoke
|
319
|
-
Invokes another Rake task.
|
318
|
+
Invokes another Rake task.
|
319
|
+
By default if the task has already been invoked it will not been executed again (see the `:reenable` option).
|
320
320
|
|
321
321
|
Invokes the task given in `task`. Returns nothing.
|
322
322
|
|
@@ -325,8 +325,10 @@ invoke :'git:clone'
|
|
325
325
|
invoke :restart
|
326
326
|
~~~
|
327
327
|
|
328
|
-
|
329
|
-
|
328
|
+
Options:
|
329
|
+
reenable (bool) - Execute the task even next time.
|
330
|
+
|
331
|
+
task.to_s is a ruby 1.8.7 fix
|
330
332
|
|
331
333
|
### erb
|
332
334
|
Evaluates an ERB block in the current scope and returns a string.
|
@@ -354,6 +356,22 @@ run!
|
|
354
356
|
|
355
357
|
Returns nothing.
|
356
358
|
|
359
|
+
### run_local!
|
360
|
+
runs the code locally that has been queued.
|
361
|
+
Has to be in :before_hook or :after_hook queue
|
362
|
+
|
363
|
+
This is already automatically invoked before Rake exits to run all
|
364
|
+
commands that have been queued up.
|
365
|
+
|
366
|
+
~~~ ruby
|
367
|
+
to :before_hook do
|
368
|
+
queue "cp file1 file2"
|
369
|
+
end
|
370
|
+
run_local!(:before_hook)
|
371
|
+
~~~
|
372
|
+
|
373
|
+
Returns nothing.
|
374
|
+
|
357
375
|
### report_time
|
358
376
|
Report time elapsed in the block.
|
359
377
|
Returns the output of the block.
|
@@ -613,6 +631,9 @@ Sets the path to where the gems are expected to be.
|
|
613
631
|
This path will be symlinked to `./shared/bundle` so that the gems cache will
|
614
632
|
be shared between all releases.
|
615
633
|
|
634
|
+
### bundle_withouts
|
635
|
+
Sets the colon-separated list of groups to be skipped from installation.
|
636
|
+
|
616
637
|
### bundle_options
|
617
638
|
Sets the options for installing gems via Bundler.
|
618
639
|
|
@@ -649,7 +670,7 @@ The local path to the SSH private key file.
|
|
649
670
|
Switches to be passed to the `ssh` command.
|
650
671
|
|
651
672
|
### env_vars
|
652
|
-
Environment variables passed to
|
673
|
+
Environment variables to be passed to `ssh` command. (e.g. "foo=bar baz=1")
|
653
674
|
|
654
675
|
## Tasks
|
655
676
|
Any and all of these settings can be overriden in your `deploy.rb`.
|
@@ -730,6 +751,20 @@ By default, the last 5 releases are kept on each server (though you can
|
|
730
751
|
change this with the keep_releases setting). All other deployed revisions
|
731
752
|
are removed from the servers."
|
732
753
|
|
754
|
+
### deploy:rollback
|
755
|
+
Rollbacks the latest release.
|
756
|
+
|
757
|
+
Changes the current link to previous release, and deletes the newest deploy release
|
758
|
+
Does NOT rollback the database, use
|
759
|
+
|
760
|
+
~~~ ruby
|
761
|
+
mina "rake[db:rollback]"
|
762
|
+
~~~
|
763
|
+
|
764
|
+
Delete existing sym link and create a new symlink pointing to the previous release
|
765
|
+
|
766
|
+
Remove latest release folder (current release)
|
767
|
+
|
733
768
|
### setup
|
734
769
|
Sets up a site's directory structure.
|
735
770
|
|
@@ -737,7 +772,7 @@ Sets up a site's directory structure.
|
|
737
772
|
Runs a command on a server.
|
738
773
|
|
739
774
|
~~~ ruby
|
740
|
-
$ mina run[tail -f logs.txt]
|
775
|
+
$ mina "run[tail -f logs.txt]"
|
741
776
|
~~~
|
742
777
|
|
743
778
|
# Modules: Foreman
|
@@ -751,21 +786,22 @@ NOTE: Requires sudo privileges
|
|
751
786
|
|
752
787
|
## Common usage
|
753
788
|
|
754
|
-
|
755
|
-
set :application, "app-name"
|
789
|
+
set :application, "app-name"
|
756
790
|
|
757
|
-
task :deploy => :environment do
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
end
|
791
|
+
task :deploy => :environment do
|
792
|
+
~~~ ruby
|
793
|
+
deploy do
|
794
|
+
# ...
|
795
|
+
invoke 'foreman:export'
|
796
|
+
# ...
|
797
|
+
end
|
798
|
+
to :launch do
|
799
|
+
invoke 'foreman:restart'
|
800
|
+
end
|
767
801
|
~~~
|
768
802
|
|
803
|
+
end
|
804
|
+
|
769
805
|
## Settings
|
770
806
|
Any and all of these settings can be overriden in your `deploy.rb`.
|
771
807
|
|
@@ -866,14 +902,14 @@ These tasks can be invoked in the command line.
|
|
866
902
|
Invokes a rails command.
|
867
903
|
|
868
904
|
~~~ ruby
|
869
|
-
$ mina rails[console]
|
905
|
+
$ mina "rails[console]"
|
870
906
|
~~~
|
871
907
|
|
872
908
|
### rake[]
|
873
909
|
Invokes a rake command.
|
874
910
|
|
875
911
|
~~~ ruby
|
876
|
-
$ mina rake
|
912
|
+
$ mina "rake[db:migrate]"
|
877
913
|
~~~
|
878
914
|
|
879
915
|
### console
|
@@ -891,6 +927,8 @@ their own.
|
|
891
927
|
|
892
928
|
### rails:db_migrate:force
|
893
929
|
|
930
|
+
### rails:db_rollback
|
931
|
+
|
894
932
|
### rails:assets_precompile:force
|
895
933
|
|
896
934
|
### rails:assets_precompile
|
@@ -982,12 +1020,7 @@ task ::setup => :environment do
|
|
982
1020
|
end
|
983
1021
|
~~~
|
984
1022
|
|
985
|
-
Adds settings and tasks for managing
|
986
|
-
[whenever]: http://rubygems.org/gems/whenever
|
987
|
-
|
988
|
-
|
989
|
-
# Modules: NPM
|
990
|
-
Adds settings and tasks for managing NodeJS projects.
|
1023
|
+
Adds settings and tasks for managing Node packages.
|
991
1024
|
|
992
1025
|
~~~ ruby
|
993
1026
|
require 'mina/npm'
|
@@ -996,16 +1029,54 @@ require 'mina/npm'
|
|
996
1029
|
## Settings
|
997
1030
|
Any and all of these settings can be overriden in your `deploy.rb`.
|
998
1031
|
|
1032
|
+
### npm_bin
|
1033
|
+
Sets the npm binary.
|
1034
|
+
|
1035
|
+
### bower_bin
|
1036
|
+
Sets the bower binary.
|
1037
|
+
|
1038
|
+
### grunt_bin
|
1039
|
+
Sets the grunt binary.
|
1040
|
+
|
999
1041
|
### npm_options
|
1000
|
-
|
1042
|
+
Sets the options for installing modules via npm.
|
1001
1043
|
|
1002
|
-
|
1044
|
+
### bower_options
|
1045
|
+
Sets the options for installing modules via bower.
|
1046
|
+
|
1047
|
+
### grunt_options
|
1048
|
+
Sets the options for grunt.
|
1049
|
+
|
1050
|
+
### grunt_task
|
1051
|
+
Sets the task parameters for grunt.
|
1003
1052
|
|
1004
1053
|
## Deploy tasks
|
1005
1054
|
These tasks are meant to be invoked inside deploy scripts, not invoked on
|
1006
1055
|
their own.
|
1007
1056
|
|
1008
1057
|
### npm:install
|
1058
|
+
Installs node modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder.
|
1059
|
+
|
1060
|
+
### bower:install
|
1061
|
+
Installs bower modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder.
|
1062
|
+
|
1063
|
+
### bower:install
|
1064
|
+
Installs bower modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder.
|
1065
|
+
|
1066
|
+
# Modules: Whenever
|
1067
|
+
Adds settings and tasks for managing projects with [whenever].
|
1068
|
+
|
1069
|
+
[whenever]: http://rubygems.org/gems/whenever
|
1070
|
+
|
1071
|
+
## Common usage
|
1072
|
+
~~~ ruby
|
1073
|
+
require 'mina/whenever'
|
1074
|
+
task :deploy => :environment do
|
1075
|
+
deploy do
|
1076
|
+
...
|
1077
|
+
invoke :'whenever:update'
|
1078
|
+
end
|
1079
|
+
~~~
|
1009
1080
|
|
1010
1081
|
3rd party modules
|
1011
1082
|
------
|
@@ -1014,6 +1085,7 @@ their own.
|
|
1014
1085
|
* [mina-stack](https://github.com/div/mina-stack)
|
1015
1086
|
* [mina-rsync](https://github.com/moll/mina-rsync)
|
1016
1087
|
* [mina-sidekiq](https://github.com/Mic92/mina-sidekiq)
|
1088
|
+
* [mina-delayed_job](https://github.com/d4be4st/mina-delayed_job)
|
1017
1089
|
* [mina-nginx](https://github.com/hbin/mina-nginx)
|
1018
1090
|
* [mina-newrelic](https://github.com/navinpeiris/mina-newrelic)
|
1019
1091
|
* [mina-rbenv-addons](https://github.com/stas/mina-rbenv-addons)
|
@@ -1033,7 +1105,7 @@ their own.
|
|
1033
1105
|
Acknowledgements
|
1034
1106
|
----------------
|
1035
1107
|
|
1036
|
-
© 2012-
|
1108
|
+
© 2012-2015, Nadarei. Released under the [MIT
|
1037
1109
|
License](http://www.opensource.org/licenses/mit-license.php).
|
1038
1110
|
|
1039
1111
|
Mina is authored and maintained by [Rico Sta. Cruz][rsc] and [Michael
|
@@ -1056,7 +1128,8 @@ Michael:
|
|
1056
1128
|
|
1057
1129
|
[rsc]: http://ricostacruz.com
|
1058
1130
|
[mg]: http://devblog.michaelgalero.com/
|
1059
|
-
[c]:
|
1131
|
+
[c]: http://github.com/mina-deploy/mina/graphs/contributors
|
1060
1132
|
[nd]: http://nadarei.co
|
1061
1133
|
[issues]: https://github.com/mina-deploy/mina/issues
|
1062
1134
|
[trello]: https://trello.com/board/mina/4fc8b3023d9c9a4d72e573e6
|
1135
|
+
|
data/data/deploy.rb
CHANGED
@@ -54,6 +54,9 @@ end
|
|
54
54
|
|
55
55
|
desc "Deploys the current version to the server."
|
56
56
|
task :deploy => :environment do
|
57
|
+
to :before_hook do
|
58
|
+
# Put things to run locally before ssh
|
59
|
+
end
|
57
60
|
deploy do
|
58
61
|
# Put things that will set up an empty directory into a fully set-up
|
59
62
|
# instance of your project.
|
data/lib/mina.rb
CHANGED
@@ -7,6 +7,7 @@ module Mina
|
|
7
7
|
autoload :DeployHelpers, 'mina/deploy_helpers'
|
8
8
|
autoload :OutputHelpers, 'mina/output_helpers'
|
9
9
|
autoload :SshHelpers, 'mina/ssh_helpers'
|
10
|
+
autoload :LocalHelpers, 'mina/local_helpers'
|
10
11
|
autoload :ExecHelpers, 'mina/exec_helpers'
|
11
12
|
autoload :Helpers, 'mina/helpers'
|
12
13
|
autoload :Settings, 'mina/settings'
|
data/lib/mina/default.rb
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
# Switches to be passed to the `ssh` command.
|
25
25
|
|
26
26
|
# ### env_vars
|
27
|
-
# Environment variables to be passed to `ssh` command.
|
27
|
+
# Environment variables to be passed to `ssh` command. (e.g. "foo=bar baz=1")
|
28
28
|
|
29
29
|
# ## Tasks
|
30
30
|
# Any and all of these settings can be overriden in your `deploy.rb`.
|
data/lib/mina/helpers.rb
CHANGED
@@ -5,6 +5,7 @@ module Mina
|
|
5
5
|
|
6
6
|
# ### invoke
|
7
7
|
# Invokes another Rake task.
|
8
|
+
# By default if the task has already been invoked it will not been executed again (see the `:reenable` option).
|
8
9
|
#
|
9
10
|
# Invokes the task given in `task`. Returns nothing.
|
10
11
|
#
|
@@ -59,6 +60,23 @@ module Mina
|
|
59
60
|
report_time { ssh commands(:default) }
|
60
61
|
end
|
61
62
|
|
63
|
+
# ### run_local!
|
64
|
+
# runs the code locally that has been queued.
|
65
|
+
# Has to be in :before_hook or :after_hook queue
|
66
|
+
#
|
67
|
+
# This is already automatically invoked before Rake exits to run all
|
68
|
+
# commands that have been queued up.
|
69
|
+
#
|
70
|
+
# to :before_hook do
|
71
|
+
# queue "cp file1 file2"
|
72
|
+
# end
|
73
|
+
# run_local!(:before_hook)
|
74
|
+
#
|
75
|
+
# Returns nothing.
|
76
|
+
def run_local!(aspect)
|
77
|
+
report_time { local commands(aspect) }
|
78
|
+
end
|
79
|
+
|
62
80
|
# ### report_time
|
63
81
|
# Report time elapsed in the block.
|
64
82
|
# Returns the output of the block.
|
@@ -93,7 +111,9 @@ module Mina
|
|
93
111
|
# Returns nothing.
|
94
112
|
|
95
113
|
def mina_cleanup!
|
114
|
+
run_local!(:before_hook) if commands(:before_hook).any?
|
96
115
|
run! if commands.any?
|
116
|
+
run_local!(:after_hook) if commands(:after_hook).any?
|
97
117
|
end
|
98
118
|
|
99
119
|
# ## Errors
|
@@ -138,6 +158,7 @@ module Mina
|
|
138
158
|
|
139
159
|
def queue(code)
|
140
160
|
commands
|
161
|
+
@to ||= :default
|
141
162
|
commands(@to) << unindent(code)
|
142
163
|
end
|
143
164
|
|
@@ -187,9 +208,8 @@ module Mina
|
|
187
208
|
# commands == ["sudo restart", "true"]
|
188
209
|
# commands(:clean) == ["rm"]
|
189
210
|
|
190
|
-
def commands(aspect
|
211
|
+
def commands(aspect = :default)
|
191
212
|
(@commands ||= begin
|
192
|
-
@to = :default
|
193
213
|
Hash.new { |h, k| h[k] = Array.new }
|
194
214
|
end)[aspect]
|
195
215
|
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# # Helpers: Local helpers
|
2
|
+
# You don't need to invoke these helpers, they're already invoked automatically.
|
3
|
+
|
4
|
+
module Mina
|
5
|
+
module LocalHelpers
|
6
|
+
# ### local
|
7
|
+
# Executes a command.
|
8
|
+
#
|
9
|
+
# Returns nothing usually, but if `{ return: true }` is given, returns the
|
10
|
+
# STDOUT output.
|
11
|
+
#
|
12
|
+
# `options` is a hash of options:
|
13
|
+
#
|
14
|
+
# - `:pretty` - Prettify the output if true.
|
15
|
+
# - `:return` - If set to true, returns the output.
|
16
|
+
#
|
17
|
+
# Example
|
18
|
+
#
|
19
|
+
# local("ls", return: true)
|
20
|
+
|
21
|
+
def local(cmd, options = {})
|
22
|
+
require 'shellwords'
|
23
|
+
|
24
|
+
cmd = cmd.join("\n") if cmd.is_a?(Array)
|
25
|
+
script = Shellwords.escape(cmd)
|
26
|
+
|
27
|
+
if options[:return] == true
|
28
|
+
`#{script}`
|
29
|
+
elsif simulate_mode?
|
30
|
+
Local.simulate(cmd)
|
31
|
+
else
|
32
|
+
result = Local.invoke(script, self)
|
33
|
+
Local.ensure_successful result, self
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# ## Private methods
|
38
|
+
# `local` delegates to these.
|
39
|
+
|
40
|
+
module Local
|
41
|
+
extend self
|
42
|
+
|
43
|
+
# ### Local.simulate
|
44
|
+
# __Internal:__ Prints command.
|
45
|
+
|
46
|
+
def simulate(cmd)
|
47
|
+
str = "Executing the following:"
|
48
|
+
puts "#!/usr/bin/env bash"
|
49
|
+
puts "# #{str}"
|
50
|
+
puts "#"
|
51
|
+
|
52
|
+
puts cmd
|
53
|
+
|
54
|
+
0
|
55
|
+
end
|
56
|
+
|
57
|
+
# ### Local.invoke
|
58
|
+
# __Internal:__ Initiates an SSH session with script `script` with given
|
59
|
+
# `term_mode`. Called by `local`.
|
60
|
+
|
61
|
+
def invoke(script, this)
|
62
|
+
# Ruby 1.8.7 doesn't let you have empty symbols
|
63
|
+
term_mode = :"#{this.settings.term_mode}" if this.settings.term_mode
|
64
|
+
code = "#{script}"
|
65
|
+
|
66
|
+
# Certain environments can't do :pretty mode.
|
67
|
+
term_mode = :exec if term_mode == :pretty && !pretty_supported?
|
68
|
+
|
69
|
+
case term_mode
|
70
|
+
when :pretty
|
71
|
+
this.pretty_system(code)
|
72
|
+
when :exec
|
73
|
+
exec code
|
74
|
+
else
|
75
|
+
system code
|
76
|
+
$?.to_i
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# TODO: Move to concern
|
81
|
+
def pretty_supported?
|
82
|
+
# open4 is not supported under Windows.
|
83
|
+
# https://github.com/nadarei/mina/issues/58
|
84
|
+
require 'rbconfig'
|
85
|
+
! (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/)
|
86
|
+
end
|
87
|
+
|
88
|
+
# ### Local.ensure_successful
|
89
|
+
# __Internal:__ Halts the execution if the given result code is not
|
90
|
+
# successful (non-zero).
|
91
|
+
|
92
|
+
def ensure_successful(result, this)
|
93
|
+
this.die result if result.is_a?(Fixnum) && result > 0
|
94
|
+
result
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
data/lib/mina/rake.rb
CHANGED
data/lib/mina/version.rb
CHANGED
data/lib/mina/whenever.rb
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# # Modules: Whenever
|
2
2
|
# Adds settings and tasks for managing projects with [whenever].
|
3
|
+
#
|
3
4
|
# [whenever]: http://rubygems.org/gems/whenever
|
5
|
+
#
|
6
|
+
#
|
7
|
+
# ## Common usage
|
8
|
+
# require 'mina/whenever'
|
9
|
+
#
|
10
|
+
# task :deploy => :environment do
|
11
|
+
# deploy do
|
12
|
+
# ...
|
13
|
+
# invoke :'whenever:update'
|
14
|
+
# end
|
4
15
|
|
5
16
|
namespace :whenever do
|
6
17
|
desc "Clear crontab"
|
data/spec/spec_helper.rb
CHANGED
data/support/Readme-footer.md
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
Acknowledgements
|
3
3
|
----------------
|
4
4
|
|
5
|
-
© 2012-
|
6
|
-
License](http://www.opensource.org/licenses/mit-license.php).
|
5
|
+
© 2012-2015, Nadarei. Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
|
7
6
|
|
8
7
|
Mina is authored and maintained by [Rico Sta. Cruz][rsc] and [Michael
|
9
8
|
Galero][mg] with help from its [contributors][c]. It is sponsored by our
|
@@ -25,8 +24,8 @@ Michael:
|
|
25
24
|
|
26
25
|
[rsc]: http://ricostacruz.com
|
27
26
|
[mg]: http://devblog.michaelgalero.com/
|
28
|
-
[c]: http://github.com/
|
27
|
+
[c]: http://github.com/mina-deploy/mina/graphs/contributors
|
29
28
|
[nd]: http://nadarei.co
|
30
|
-
[issues]: https://github.com/
|
29
|
+
[issues]: https://github.com/mina-deploy/mina/issues
|
31
30
|
[trello]: https://trello.com/board/mina/4fc8b3023d9c9a4d72e573e6
|
32
31
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
3rd party modules
|
2
|
+
------
|
3
|
+
|
4
|
+
* [mina-rollbar](https://github.com/code-lever/mina-rollbar)
|
5
|
+
* [mina-stack](https://github.com/div/mina-stack)
|
6
|
+
* [mina-rsync](https://github.com/moll/mina-rsync)
|
7
|
+
* [mina-sidekiq](https://github.com/Mic92/mina-sidekiq)
|
8
|
+
* [mina-delayed_job](https://github.com/d4be4st/mina-delayed_job)
|
9
|
+
* [mina-nginx](https://github.com/hbin/mina-nginx)
|
10
|
+
* [mina-newrelic](https://github.com/navinpeiris/mina-newrelic)
|
11
|
+
* [mina-rbenv-addons](https://github.com/stas/mina-rbenv-addons)
|
12
|
+
* [mina-multistage](https://github.com/endoze/mina-multistage)
|
13
|
+
* [mina-s3](https://github.com/stas/mina-s3)
|
14
|
+
* [mina-scp](https://github.com/adie/mina-scp)
|
15
|
+
* [mina-hooks](https://github.com/elskwid/mina-hooks)
|
16
|
+
* [mina-slack](https://github.com/TAKAyukiatkwsk/mina-slack)
|
17
|
+
* [mina-cakephp](https://github.com/mobvox/mina-cakephp)
|
18
|
+
* [mina-unicorn](https://github.com/openteam/mina-unicorn)
|
19
|
+
* [mina-puma](https://github.com/sandelius/mina-puma)
|
20
|
+
* [mina-mercurial](https://github.com/rainlabs/mina-mercurial)
|
21
|
+
* [mina-faye](https://github.com/NingenUA/mina-faye)
|
22
|
+
* [mina-clockwork](https://github.com/907th/mina-clockwork)
|
23
|
+
* [mina-ftp](https://github.com/stas/mina-ftp)
|
data/test_env/config/deploy.rb
CHANGED
@@ -19,6 +19,7 @@ File.open("#{Dir.pwd}/deploy/config/database.yml", 'w') { |f| f.write "Hello" }
|
|
19
19
|
require 'mina/rails'
|
20
20
|
require 'mina/bundler'
|
21
21
|
require 'mina/git'
|
22
|
+
require 'pry'
|
22
23
|
|
23
24
|
set :domain, 'localhost'
|
24
25
|
set :deploy_to, "#{Dir.pwd}/deploy"
|
@@ -35,12 +36,18 @@ desc "Deploys."
|
|
35
36
|
task :deploy => :environment do
|
36
37
|
queue "bundle() { true; }" # Stub the bundle command.
|
37
38
|
|
39
|
+
to :before_hook do
|
40
|
+
queue %[ echo "-----> This is before hook"]
|
41
|
+
end
|
42
|
+
|
38
43
|
deploy do
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
+
to :default do
|
45
|
+
queue %[ruby -e "\\$stderr.write \\\"This is stdout output\n\\\""]
|
46
|
+
invoke :'git:clone'
|
47
|
+
invoke :'deploy:link_shared_paths'
|
48
|
+
invoke :'bundle:install'
|
49
|
+
invoke :'rails:db_migrate'
|
50
|
+
end
|
44
51
|
|
45
52
|
to :launch do
|
46
53
|
invoke :'passenger:restart'
|
@@ -50,7 +57,17 @@ end
|
|
50
57
|
|
51
58
|
desc "Restarts the passenger server."
|
52
59
|
task :restart do
|
60
|
+
set :term_mode, :pretty
|
61
|
+
to :before do
|
62
|
+
queue %(
|
63
|
+
echo "-----> Copying files"
|
64
|
+
#{echo_cmd %[cp deploy/last_version deploy/last_version_2]}
|
65
|
+
)
|
66
|
+
end
|
53
67
|
invoke :'passenger:restart'
|
68
|
+
to :after do
|
69
|
+
queue "echo '-----> After'"
|
70
|
+
end
|
54
71
|
end
|
55
72
|
|
56
73
|
namespace :passenger do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rico Sta. Cruz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-03-
|
12
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/mina/foreman.rb
|
101
101
|
- lib/mina/git.rb
|
102
102
|
- lib/mina/helpers.rb
|
103
|
+
- lib/mina/local_helpers.rb
|
103
104
|
- lib/mina/npm.rb
|
104
105
|
- lib/mina/output_helpers.rb
|
105
106
|
- lib/mina/rails.rb
|
@@ -137,6 +138,7 @@ files:
|
|
137
138
|
- support/Readme-header.md
|
138
139
|
- support/guide.md
|
139
140
|
- support/index.html
|
141
|
+
- support/third_party_modules.md
|
140
142
|
- support/to_md.rb
|
141
143
|
- test_env/config/deploy.rb
|
142
144
|
homepage: http://github.com/nadarei/mina
|