appengine 0.4.3 → 0.4.4

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: 2f0b0ccf502def04a72e834f3086b4d49067616e
4
- data.tar.gz: 6911772b6e335e325cb7569d4bc83e2662888974
3
+ metadata.gz: d298df52ab28ad90dbfa6b51f3bf960d2ba63793
4
+ data.tar.gz: 1be692b4bd2c5099004e59e2e429d0d8092d35d8
5
5
  SHA512:
6
- metadata.gz: 1e2144f96a6afb55b57933f1c5f8603df938a23bdaa778ba7b2bf5c7e1040dc410abf1941d1ee8b2724dce8e7b188372e50f3fef5d18ef2e4c3f50b9bb6d1b96
7
- data.tar.gz: 747253cd3457c8ec7c9aa909c1927e5e622d49df4baab4649a9a4930b4b8d16666d056cea9056fda78fab43379e093111ea4f180b8b70f4434f44d3c92fcc79e
6
+ metadata.gz: 8e0821d8d628018e27e4bafa2274f919a2bce599cc3feef9dea46192c12ca4efa6f4646e942183c37cd00338b9f6364d0d3d3293332138c258663a482ac27d0a
7
+ data.tar.gz: 281b510a47e74e2faecd180552e7a5d4c22de52942b48dd0aec87f988b0ac1bcf01e83e2f9b364423f031ed1f96ae8cafc3e7d7ddfce59a1bfe8749e8a98e31a
@@ -2,6 +2,10 @@
2
2
 
3
3
  This is the change history for the appengine gem.
4
4
 
5
+ ## v0.4.4 (2017-10-03)
6
+
7
+ * Windows compatibility for appengine:exec task. (gkaykck)
8
+
5
9
  ## v0.4.3 (2017-09-20)
6
10
 
7
11
  * Fixed incorrect namespace in the handler for gcloud errors.
data/README.md CHANGED
@@ -32,6 +32,10 @@ To install, include the "appengine" gem in your Gemfile. e.g.
32
32
 
33
33
  gem "appengine"
34
34
 
35
+ ## Quick Start
36
+
37
+ ### Rails Quick Start
38
+
35
39
  If you are running [Ruby On Rails](http://rubyonrails.org/) 4.0 or later, this
36
40
  gem will automatically install a Railtie that provides its capabilities. You
37
41
  may need to include the line:
@@ -41,10 +45,40 @@ may need to include the line:
41
45
  in your `config/application.rb` file if you aren't already requiring all
42
46
  bundled gems.
43
47
 
44
- If you are running a different web framework, you may need to add some
45
- initialization code to activate the features listed below.
48
+ ### Rack Quick Start
49
+
50
+ If you are running a different Rack-based web framework, include the following
51
+ line in your main Ruby file or `config.ru`:
52
+
53
+ require "appengine"
54
+
55
+ Then, to activate Stackdriver instrumentation, add the following middleware:
56
+
57
+ use Google::Cloud::Logging::Middleware
58
+ use Google::Cloud::ErrorReporting::Middleware
59
+ use Google::Cloud::Trace::Middleware
60
+ use Google::Cloud::Debugger::Middleware
46
61
 
47
- ## Logging and monitoring
62
+ You can add the Rake tasks to your application by adding the following to your
63
+ Rakefile:
64
+
65
+ require "appengine/tasks"
66
+
67
+ ### Necessary permissions for remote execution rake tasks
68
+
69
+ If you are using the `appengine:exec` rake task, you may need to grant
70
+ additional permissions to the Cloud Container Builder service account that
71
+ runs the task, especially if you are using Cloud SQL (which is not covered by
72
+ the default permissions granted to the account). If your task is failing with
73
+ authorization errors, pen the
74
+ [IAM tab](https://pantheon.corp.google.com/iam-admin/iam/project) of the
75
+ cloud console, select your project, and find the service account with the name
76
+ `[your-project-number]@cloudbuild.gserviceaccount.com`. Add the Project Editor
77
+ role to this service account.
78
+
79
+ ## Using this library
80
+
81
+ ### Logging and monitoring
48
82
 
49
83
  This library automatically installs the "stackdriver" gem, which instruments
50
84
  your application to report logs, unhandled exceptions, and latency traces to
@@ -54,16 +88,19 @@ monitoring features of Google App Engine, see:
54
88
  * [google-cloud-logging instrumentation](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/guides/instrumentation)
55
89
  * [google-cloud-error_reporting instrumentation](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/guides/instrumentation)
56
90
  * [google-cloud-trace instrumentation](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-trace/latest/guides/instrumentation)
91
+ * [google-cloud-debugger instrumentation](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-debugger/latest/guides/instrumentation)
57
92
 
58
93
  Rails applications automatically activate this instrumentation when the gem
59
94
  is present. You may opt out of individual services by providing appropriate
60
95
  Rails configuration. See {AppEngine::Railtie} for more information.
61
96
 
62
97
  Non-Rails applications must provide initialization code to activate this
63
- instrumentation, typically by installing a Rack middleware. See the individual
64
- service documentation links above for more information.
98
+ instrumentation, typically by installing a Rack middleware. You can find the
99
+ basic code for installing these middlewares in the Rack Quick Start section
100
+ above. See the individual service documentation links above for more
101
+ information and configuration options.
65
102
 
66
- ## App Engine remote execution
103
+ ### App Engine remote execution
67
104
 
68
105
  This library provides rake tasks for App Engine remote execution, allowing
69
106
  App Engine applications to perform on-demand tasks in the App Engine
@@ -86,6 +123,11 @@ tasks are available automatically in Rails applications when the gem is
86
123
  present. Non-Rails applications may install the tasks by adding the line
87
124
  `require "appengine/tasks"` to the `Rakefile`.
88
125
 
126
+ Note that you may need to grant additional roles to the Container Builder
127
+ service account that runs your tasks. If your task is failing with API
128
+ authorization errors, try granting the Project Editor role to the CloudBuild
129
+ service account.
130
+
89
131
  ## Development and support
90
132
 
91
133
  The source code for this gem is available on Github at
@@ -15,6 +15,7 @@
15
15
 
16
16
  require "yaml"
17
17
  require "json"
18
+ require "shellwords"
18
19
 
19
20
  require "appengine/util/gcloud"
20
21
 
@@ -113,7 +114,7 @@ module AppEngine
113
114
  @default_timeout = "10m".freeze
114
115
  @default_service = "default".freeze
115
116
  @default_config_path = "./app.yaml".freeze
116
- @default_wrapper_image = "gcr.io/google-appengine/exec-wrapper".freeze
117
+ @default_wrapper_image = "gcr.io/google-appengine/exec-wrapper:latest".freeze
117
118
 
118
119
 
119
120
  ##
@@ -78,8 +78,12 @@ module AppEngine
78
78
  #
79
79
  def binary_path
80
80
  unless defined? @binary_path
81
- @binary_path = `which gcloud`.strip
82
- @binary_path = nil if @binary_path.empty?
81
+ if Gem.win_platform?
82
+ @binary_path = `where gcloud` == '' ? nil : 'gcloud'
83
+ else
84
+ @binary_path = `which gcloud`.strip
85
+ @binary_path = nil if @binary_path.empty?
86
+ end
83
87
  end
84
88
  @binary_path
85
89
  end
@@ -162,7 +166,8 @@ module AppEngine
162
166
  # depending on the value of the `capture` parameter.
163
167
  #
164
168
  def execute args, echo: false, capture: false, assert: true
165
- joined_args = ::Shellwords.join args
169
+ joined_args = Gem.win_platform? ? args.join(" ") : Shellwords.join(args)
170
+
166
171
  cmd = "#{binary_path!} #{joined_args}"
167
172
  puts cmd if echo
168
173
  result = capture ? `#{cmd}` : system(cmd)
@@ -16,6 +16,6 @@
16
16
  module AppEngine
17
17
 
18
18
  # The current version of this gem, as a string.
19
- VERSION = '0.4.3'.freeze
19
+ VERSION = '0.4.4'.freeze
20
20
 
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-20 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-env