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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51ce24a22c46ac87ab35795fb8de6d235be33c51
4
- data.tar.gz: e05a463f34a09163b8fad8484798b3ad91a1bf88
3
+ metadata.gz: dd62c05e2f21ef3d27a23808371d2183c4d9b55c
4
+ data.tar.gz: 5680fdd0470369a0b0b21eaed4546554c89618a2
5
5
  SHA512:
6
- metadata.gz: c33dace559192c0d5af0d28a5dcb474f2a7792609c2bda3a9936a287c9a453b6f751dbb9ff7815ce977c4fd6e0178914452c9edcb1fb01cf19c9217da2832df0
7
- data.tar.gz: 9ae07631fb356155f14b22231ff6057751208e3de1179fd2b326170cc6b40af335b8dfd520c702d44ca7980de78e10df5f49758bf18847590119aff9f883757c
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
- backup_name = "#{Time.now.localtime.strftime("%d-%m-%Y")}-#{db_name}-#{fetch(:stage)}.sql"
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}"
@@ -1,4 +1,4 @@
1
1
  module Hoppinger
2
- VERSION = "1.0.1"
2
+ VERSION = '1.0.3'
3
3
  end
4
4
 
@@ -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
- backup_name = "\#{Time.now.localtime.strftime("%d-%m-%Y")}-\#{db_name}-\#{fetch(:stage)}.sql"
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}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoppinger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dunya Kirkali