dpl 1.8.30.travis.1873.3 → 1.8.30.travis.1881.3
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/lib/dpl/provider/gae.rb +14 -3
- data/spec/provider/gae_spec.rb +12 -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: be04e4325446d67cdb747c9e78da99e34998cef0
|
|
4
|
+
data.tar.gz: 699740e122c7d23be483df809455ab18aadc355c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf578fc6dd9308cb31b19f54a4eaee3cde5962b090396d151c71e0133ef0d2f973b6980554b62db9649bcfe12c8c9c85e8cd6cca245f875c9f17963d678776e0
|
|
7
|
+
data.tar.gz: 8106d188c5a7f0774ee03608bd11e94f055a1b0d393b244f3f4e010c7f08f5e548722a0888f72feaf7a1ccf124ce08b4ebd506383b0020e3694647bd36dceaba
|
data/lib/dpl/provider/gae.rb
CHANGED
|
@@ -10,11 +10,22 @@ module DPL
|
|
|
10
10
|
BOOTSTRAP="#{INSTALL}/#{NAME}/bin/bootstrapping/install.py"
|
|
11
11
|
GCLOUD="#{INSTALL}/#{NAME}/bin/gcloud"
|
|
12
12
|
|
|
13
|
+
def with_python_2_7(cmd)
|
|
14
|
+
cmd.gsub!(/'/, "'\\\\''")
|
|
15
|
+
context.shell("bash -c 'source #{context.env['HOME']}/virtualenv/python2.7/bin/activate; #{cmd}'")
|
|
16
|
+
end
|
|
17
|
+
|
|
13
18
|
def install_deploy_dependencies
|
|
14
19
|
if File.exists? GCLOUD
|
|
15
20
|
return
|
|
16
21
|
end
|
|
17
22
|
|
|
23
|
+
$stderr.puts 'Python 2.7 Version'
|
|
24
|
+
|
|
25
|
+
unless with_python_2_7("python -c 'import sys; print(sys.version)'")
|
|
26
|
+
error 'Could not use python2.7'
|
|
27
|
+
end
|
|
28
|
+
|
|
18
29
|
$stderr.puts 'Downloading Google Cloud SDK ...'
|
|
19
30
|
|
|
20
31
|
unless context.shell("curl -L #{BASE + NAME + EXT} | gzip -d | tar -x -C #{INSTALL}")
|
|
@@ -23,7 +34,7 @@ module DPL
|
|
|
23
34
|
|
|
24
35
|
$stderr.puts 'Bootstrapping Google Cloud SDK ...'
|
|
25
36
|
|
|
26
|
-
unless
|
|
37
|
+
unless with_python_2_7("#{BOOTSTRAP} --usage-reporting=false --command-completion=false --path-update=false")
|
|
27
38
|
error 'Could not bootstrap Google Cloud SDK.'
|
|
28
39
|
end
|
|
29
40
|
end
|
|
@@ -33,7 +44,7 @@ module DPL
|
|
|
33
44
|
end
|
|
34
45
|
|
|
35
46
|
def check_auth
|
|
36
|
-
unless
|
|
47
|
+
unless with_python_2_7("#{GCLOUD} -q --verbosity debug auth activate-service-account --key-file #{keyfile}")
|
|
37
48
|
error 'Authentication failed.'
|
|
38
49
|
end
|
|
39
50
|
end
|
|
@@ -75,7 +86,7 @@ module DPL
|
|
|
75
86
|
command << " --version \"#{version}\"" unless version.to_s.empty?
|
|
76
87
|
command << " --#{no_promote ? 'no-' : ''}promote"
|
|
77
88
|
command << ' --no-stop-previous-version' unless no_stop_previous_version.to_s.empty?
|
|
78
|
-
unless
|
|
89
|
+
unless with_python_2_7(command)
|
|
79
90
|
log 'Deployment failed.'
|
|
80
91
|
context.shell('find $HOME/.config/gcloud/logs -type f -print -exec cat {} \;')
|
|
81
92
|
error ''
|
data/spec/provider/gae_spec.rb
CHANGED
|
@@ -6,10 +6,21 @@ describe DPL::Provider::GAE do
|
|
|
6
6
|
described_class.new(DummyContext.new, project: 'test')
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
describe '#push_app' do
|
|
10
11
|
example 'with defaults' do
|
|
11
|
-
|
|
12
|
+
expect(provider.context.env).to receive(:[]).with('HOME').and_return('/home/travis')
|
|
13
|
+
allow(provider.context).to receive(:shell).with("bash -c 'source /home/travis/virtualenv/python2.7/bin/activate; #{DPL::Provider::GAE::GCLOUD} --quiet --verbosity \"warning\" --project \"test\" app deploy \"app.yaml\" --promote'").and_return(true)
|
|
12
14
|
provider.push_app
|
|
13
15
|
end
|
|
14
16
|
end
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
describe '#with_python_2_7' do
|
|
20
|
+
example 'with apostrophe' do
|
|
21
|
+
expect(provider.context.env).to receive(:[]).with('HOME').and_return('/home/travis')
|
|
22
|
+
allow(provider.context).to receive(:shell).with("bash -c 'source /home/travis/virtualenv/python2.7/bin/activate; python -c '\\''import sys; print(sys.version)'\\'''").and_return(true)
|
|
23
|
+
provider.with_python_2_7("python -c 'import sys; print(sys.version)'")
|
|
24
|
+
end
|
|
25
|
+
end
|
|
15
26
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dpl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.30.travis.
|
|
4
|
+
version: 1.8.30.travis.1881.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Konstantin Haase
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-01-
|
|
11
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|