appengine 0.4.3 → 0.4.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/CHANGELOG.md +4 -0
- data/README.md +48 -6
- data/lib/appengine/exec.rb +2 -1
- data/lib/appengine/util/gcloud.rb +8 -3
- data/lib/appengine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d298df52ab28ad90dbfa6b51f3bf960d2ba63793
|
4
|
+
data.tar.gz: 1be692b4bd2c5099004e59e2e429d0d8092d35d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e0821d8d628018e27e4bafa2274f919a2bce599cc3feef9dea46192c12ca4efa6f4646e942183c37cd00338b9f6364d0d3d3293332138c258663a482ac27d0a
|
7
|
+
data.tar.gz: 281b510a47e74e2faecd180552e7a5d4c22de52942b48dd0aec87f988b0ac1bcf01e83e2f9b364423f031ed1f96ae8cafc3e7d7ddfce59a1bfe8749e8a98e31a
|
data/CHANGELOG.md
CHANGED
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
|
-
|
45
|
-
|
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
|
-
|
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.
|
64
|
-
|
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
|
-
|
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
|
data/lib/appengine/exec.rb
CHANGED
@@ -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
|
-
|
82
|
-
|
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 =
|
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)
|
data/lib/appengine/version.rb
CHANGED
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.
|
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-
|
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
|