hoppinger 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -2
- data/lib/generators/hoppinger/templates/cap.rb.erb +2 -1
- data/lib/hoppinger/version.rb +1 -1
- data/spec/lib/generators/cap_generator_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd62c05e2f21ef3d27a23808371d2183c4d9b55c
|
4
|
+
data.tar.gz: 5680fdd0470369a0b0b21eaed4546554c89618a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca26da63ac153a79a3535265811df92076806e4ecb2896f3584be5e4bdc6d6f02a33ff10611138e75468a8cb4440ae30db1faf8178f52ff25feb8ab9b0bac07a
|
7
|
+
data.tar.gz: 2630067debf7d17d1d0e3abcc61d552f0b5e0f99feb19d949e75dcbae5401d4641459e96685cc3c6226c564f93bfed54db500276cc3975fcfae6fd65621563b0
|
data/README.md
CHANGED
@@ -18,13 +18,25 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
First you have to set :stage in your cap stages:
|
21
|
+
First you have to set :stage in your cap stages (eg. config/staging.rb):
|
22
22
|
|
23
23
|
set :stage, 'production'
|
24
24
|
|
25
|
+
Then set :user that will be used during the deploy process in your cap stages (eg. config/staging.rb):
|
26
|
+
|
27
|
+
set :user, 'deployer'
|
28
|
+
|
25
29
|
Then you can run the following command in order to generate hoppinger's cap tasks
|
26
30
|
|
27
|
-
hoppinger cap
|
31
|
+
bundle exec hoppinger cap
|
32
|
+
|
33
|
+
Add the following line to ``` deploy.rb ```:
|
34
|
+
|
35
|
+
load 'config/recipes/hoppinger.rb'
|
36
|
+
|
37
|
+
In order to backup your remote database:
|
38
|
+
|
39
|
+
bundle exec cap production db:backup
|
28
40
|
|
29
41
|
## Contributing
|
30
42
|
|
@@ -4,7 +4,8 @@ namespace :db do
|
|
4
4
|
on roles(:app) do
|
5
5
|
deployer_home = "/home/#{fetch(:user)}"
|
6
6
|
db_username, db_password, db_name, host = remote_database_config(fetch(:stage))
|
7
|
-
|
7
|
+
time = Time.now.to_i
|
8
|
+
backup_name = "#{time}-#{db_name}-#{fetch(:stage)}.sql"
|
8
9
|
execute :mysqldump, "-u #{db_username} -p'#{db_password}' #{db_name} > ~/#{backup_name}"
|
9
10
|
download! "/home/deployer/#{backup_name}", "#{backup_name}"
|
10
11
|
execute :rm, "#{deployer_home}/#{backup_name}"
|
data/lib/hoppinger/version.rb
CHANGED
@@ -21,7 +21,8 @@ describe CapGenerator, type: :generator do
|
|
21
21
|
on roles(:app) do
|
22
22
|
deployer_home = "/home/\#{fetch(:user)}"
|
23
23
|
db_username, db_password, db_name, host = remote_database_config(fetch(:stage))
|
24
|
-
|
24
|
+
time = Time.now.to_i
|
25
|
+
backup_name = "\#{time}-\#{db_name}-\#{fetch(:stage)}.sql"
|
25
26
|
execute :mysqldump, "-u \#{db_username} -p'\#{db_password}' \#{db_name} > ~/\#{backup_name}"
|
26
27
|
download! "/home/deployer/\#{backup_name}", "\#{backup_name}"
|
27
28
|
execute :rm, "\#{deployer_home}/\#{backup_name}"
|