dpl 1.8.30.travis.1873.3 → 1.8.30.travis.1881.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: f1232586e213d2d1b5c472fcadaa4a5e40afe946
4
- data.tar.gz: b773f1ffc56623135cb4b57dab3f0e03e895b4cd
3
+ metadata.gz: be04e4325446d67cdb747c9e78da99e34998cef0
4
+ data.tar.gz: 699740e122c7d23be483df809455ab18aadc355c
5
5
  SHA512:
6
- metadata.gz: b30ecc0aea695730d6747b6399f304d1e082a046760b42931856d4a08862cbab363655738d443f8287b6ac7c6784bde44f9cfbd6d0965d5c7a9c5f708dcddfa9
7
- data.tar.gz: 284e1c3138e9450318fe497d4253834c8a45db89fcacf39bb2755fba8fe5c5913e9158ffecd3be90ca237aec930ee43e88730d1f5eaddce167be9a7c7dac1518
6
+ metadata.gz: cf578fc6dd9308cb31b19f54a4eaee3cde5962b090396d151c71e0133ef0d2f973b6980554b62db9649bcfe12c8c9c85e8cd6cca245f875c9f17963d678776e0
7
+ data.tar.gz: 8106d188c5a7f0774ee03608bd11e94f055a1b0d393b244f3f4e010c7f08f5e548722a0888f72feaf7a1ccf124ce08b4ebd506383b0020e3694647bd36dceaba
@@ -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 context.shell("#{BOOTSTRAP} --usage-reporting=false --command-completion=false --path-update=false")
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 context.shell("#{GCLOUD} -q --verbosity debug auth activate-service-account --key-file #{keyfile}")
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 context.shell(command)
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 ''
@@ -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
- allow(provider.context).to receive(:shell).with("#{DPL::Provider::GAE::GCLOUD} --quiet --verbosity \"warning\" --project \"test\" app deploy \"app.yaml\" --promote").and_return(true)
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.1873.3
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-09 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec