pvcglue 0.1.9 → 0.1.10

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTMzYjY3NjhjMjgwN2VlNGRhNDUwZGE4MzUzZDA0NjgwYjJlMWQwNg==
4
+ MTM4NDNkOTQ3YmE0YThjZGQ4NjlmODU0MmIzZDU3MzU4NmUzMzQ4ZA==
5
5
  data.tar.gz: !binary |-
6
- YjkwNGQ4ZjE1OGNiNWNmNmUwMmFlMTJhYzgxYTg1YzdmMTEzNzg4Mg==
6
+ YjU4ZDY1YjM4NjAwYjc3YzIxZWYzZDRkZDE3ZDI3Njk3M2Q4NGE1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2JjMmE4MmRjMTMwYzM2OWVkYmZlMjhkZWRmZGUyZTM2ZTFkNjNhMTM1MDA0
10
- ZjY2ZGU5M2NmZTVhMjUyN2U5ZjNmNGVlMGYzNDQ2ZGMzZGYyOTMwZWJkMzJk
11
- NzBkNjBiYjAzOWUyNzkxNzgwN2ZhYjg4MmIxZWNiNzU1M2JhN2E=
9
+ MjJiNWFiZjg0YzE4OGE3Mjg1OTQyYWNkNGJmYTQ4YTcxNmEzYTEzODFmZWFi
10
+ NjRjMjJiZjE5ZDU4OTlkNDM1ZjYzNjgwOTU0MGMwZDlmZjUzNGFjOGRjMThl
11
+ MTJjZTA0ZjVkZWY4OTY2NTEwNzMxMzgwNTdmMDI2Njg4YjQ3MWI=
12
12
  data.tar.gz: !binary |-
13
- MGExYTQ3YjM5ZTFkZDEwZDQwMWEyZTRhYjQzOTY5YjVjOTU1YTRiMDM1MGYy
14
- NGQ5NjU5MjdiNWY1NGI4YThkMDgwOTc3MzhlMzM1MTA2OWU2Y2ZjODVjMmY1
15
- YmU1YmQxMjVmYWE3MWQwYTk2NzlhZTEzYjM0Mjc5YjM2MDAwODI=
13
+ ZTkwMjE0Yzg4YTgxOGZjOWRkZmQ5NDczYzEzMTMxYjljYmNlN2M2OTM0NTYy
14
+ YzBhNGJmYWFiOGFjYjkwYWU0NzM0MjYxZGNjY2ExNDE4YWEyOTA2ZTJmOGM4
15
+ M2NkYmY1ZDBmNGQ2Njk0ZDJlNmRmMTk4ZmMyZjUwZmFiNTUyOWQ=
data/README.md CHANGED
@@ -50,6 +50,8 @@ Note: An existing authorized user must perform steps 1-3.
50
50
 
51
51
  pvc alpha c # start a rails console on the alpha web server
52
52
 
53
+ 6. If you have any problems, see the [Troubleshooting](#troubleshooting) section.
54
+
53
55
  ## Common Usage
54
56
 
55
57
  Always do a `pvc manager pull` once before making any changes to ensure you have the latest data. (Caching will be improved as time permitts.)
@@ -83,6 +85,11 @@ Always do a `pvc manager pull` once before making any changes to ensure you have
83
85
  pvc <stage> capify # must be done on all stages!
84
86
 
85
87
 
88
+ * restart delayed job workers (this may change once a bug is resolved)
89
+
90
+ cap production deploy:delayed_job_restart
91
+
92
+
86
93
  # Help
87
94
 
88
95
  Commands:
@@ -136,19 +143,50 @@ https://github.com/radar/guides/blob/master/gem-development.md
136
143
 
137
144
  ## Installation
138
145
 
139
- Add this line to your application's Gemfile:
146
+ Add these lines to your application's Gemfile. `dotenv-rails` must be listed first!
140
147
 
141
- gem 'pvcglue', "~> 0.1.7", :group => :development
142
- gem 'pvcglue_dbutils', "~> 0.5.3"
148
+ ################# Must be the first Gem ###################
149
+ gem 'dotenv-rails', "0.11.1"
150
+ ################# Must be the first Gem ###################
143
151
 
152
+ Then add these lines to your application's Gemfile, whereever you like (usually at the end):
153
+
154
+ gem 'pvcglue', "~> 0.1.10", :group => :development
155
+ gem 'pvcglue_dbutils', "~> 0.5.3"
144
156
 
145
157
  And then execute:
146
158
 
147
159
  $ bundle
148
160
 
149
- Or install it yourself as:
161
+ ## Troubleshooting
162
+
163
+ ### If you see this while trying to deploy
164
+
165
+ DEBUG[426eda1d] Permission denied (publickey).
166
+ DEBUG[426eda1d] fatal: The remote end hung up unexpectedly
167
+
168
+ it probably means that your SSH key is not being forwarded.
169
+
170
+ You will need to edit (or create) `~/.ssh/config` and add the host(s) you want to connect to. Replace `example.com` with the name or IP you want to connect to. (Note: You will need an entry for each 'web' server in the cluster in order to deploy.)
171
+
172
+ Host example.com
173
+ ForwardAgent yes
174
+
175
+ You can use `Host *` if you understand the security risks, and are not connecting to any untrusted servers over SSH.
176
+
177
+ And then add your key to the agent
178
+
179
+ ssh-add -K
180
+
181
+ More information can be found at https://developer.github.com/guides/using-ssh-agent-forwarding/
182
+
183
+ ### If you get an error like
184
+
185
+ DEBUG[d416069c] fatal: Not a valid object name
186
+ DEBUG[d416069c] tar: This does not look like a tar archive
187
+ DEBUG[d416069c] tar: Exiting with failure status due to previous errors
150
188
 
151
- $ gem install pvcglue
189
+ it probably means that you have not pushed up the branch, yet. :)
152
190
 
153
191
  ## Developing
154
192
 
data/lib/pvcglue/cli.rb CHANGED
@@ -164,4 +164,4 @@ module Pvcglue
164
164
  end
165
165
  end
166
166
 
167
- end
167
+ end
data/lib/pvcglue/cloud.rb CHANGED
@@ -166,6 +166,10 @@ module Pvcglue
166
166
  data[app_name][:time_zone] || 'America/Los_Angeles'
167
167
  end
168
168
 
169
+ def exclude_tables
170
+ data[app_name][:excluded_db_tables] || ['versions']
171
+ end
172
+
169
173
  def firewall_allow_incoming_on_port
170
174
  # These ports allow incoming connections from any ip address
171
175
  ports = []
data/lib/pvcglue/db.rb CHANGED
@@ -14,11 +14,11 @@ module Pvcglue
14
14
  pg_restore(self.class.remote, file_name)
15
15
  end
16
16
 
17
- desc "pull", "pull"
18
-
17
+ desc "pull", "Pull copy of database from remote stage. Pass -f to exclude tables defined in the configutation file. If no tables are specified in the `excluded_db_tables` option, 'versions' will be used by default."
18
+ method_option :fast, :type => :boolean, :aliases => "-f"
19
19
  def pull(file_name = nil)
20
20
  raise(Thor::Error, "Stage required.") if Pvcglue.cloud.stage_name.nil?
21
- pg_dump(self.class.remote, file_name)
21
+ pg_dump(self.class.remote, file_name, options[:fast])
22
22
  end
23
23
 
24
24
  desc "dump", "dump"
@@ -116,9 +116,14 @@ module Pvcglue
116
116
  end
117
117
 
118
118
 
119
- def pg_dump(source, file_name)
119
+ def pg_dump(source, file_name, fast)
120
120
  cmd = "pg_dump -Fc --no-acl --no-owner -h #{source.host} -p #{source.port}"
121
121
  cmd += " -U #{source.username}" if source.username
122
+ if fast
123
+ Pvcglue.cloud.exclude_tables.each do |table|
124
+ cmd += " --exclude-table=#{table}"
125
+ end
126
+ end
122
127
  cmd += " #{source.database} -v -f #{self.class.file_helper(file_name)}"
123
128
  puts cmd
124
129
  unless system({"PGPASSWORD" => source.password}, cmd)
@@ -1,3 +1,3 @@
1
1
  module Pvcglue
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pvcglue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Lyric
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-23 00:00:00.000000000 Z
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler