engineyard-serverside 2.1.1 → 2.1.2

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: 5333baa3bba55bce4078339f6240c0832b76f12d
4
- data.tar.gz: eacf3427fae13fbd56c85054c1502da40d962d67
3
+ metadata.gz: 6486230a970d69456691197b715e213cde4bd543
4
+ data.tar.gz: e5908d2a85c14dd9de76ae090d9bebcd940637b5
5
5
  SHA512:
6
- metadata.gz: 5bbd1b7d1dadb1ced6c38acd6e4a7a8977e3887abcd598ca7d67253b2efaad8d5fd5d8c9ac0d28a323e75e5933ef0398497d765489d217051abf595e5bcee59e
7
- data.tar.gz: 890b5c71290167f2acdda70a3375773a02547b9d093c84f238be10605fab534d5eddafe3240514359214f30b501e12fe26a407580ae67da78e9bf59f8051e560
6
+ metadata.gz: 054c93f12c3b85e974a62eb547f6dddb8a81ac6a1be69594836c5f7094c4dfd628de53fb1b9bd64a8279e0390823c988c0a4d557ccaed9bdc033b72ee1ac778c
7
+ data.tar.gz: 5f46a8426973e59ad8e9ec1873af3edfc5f615b801a030963a41b8ebc8761c3ba53df0113e98e7ea9911593bf8c1ed6e370e39f2b435b97f2dc5dbea13322db5
@@ -8,8 +8,10 @@ module EY
8
8
 
9
9
  def install
10
10
  if composer_available?
11
+ shell.status "Checking for composer updates..."
12
+ composer_selfupdate
11
13
  shell.status "Installing composer packages (composer.#{lock_or_json} detected)"
12
- run "composer install --no-interaction --working-dir #{paths.active_release}"
14
+ composer_install
13
15
  else
14
16
  shell.warning "composer.#{lock_or_json} detected but composer not available."
15
17
  end
@@ -27,6 +29,14 @@ module EY
27
29
  paths.composer_json.exist?
28
30
  end
29
31
 
32
+ def composer_install
33
+ run "composer install --no-interaction --working-dir #{paths.active_release}"
34
+ end
35
+
36
+ def composer_selfupdate
37
+ run "composer self-update"
38
+ end
39
+
30
40
  def composer_available?
31
41
  begin
32
42
  run "command -v composer > /dev/null"
@@ -280,10 +280,10 @@ Deploy again if your services configuration appears incomplete or out of date.
280
280
  run <<-WRAP
281
281
  cat > #{paths.shared_config}/database.sqlite3.yml<<'YML'
282
282
  #{config.framework_env}:
283
- adapter: sqlite3
284
- database: #{paths.shared}/databases/#{config.framework_env}.sqlite3
285
- pool: 5
286
- timeout: 5000
283
+ adapter: sqlite3
284
+ database: #{paths.shared}/databases/#{config.framework_env}.sqlite3
285
+ pool: 5
286
+ timeout: 5000
287
287
  YML
288
288
  WRAP
289
289
 
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '2.1.1'
3
+ VERSION = '2.1.2'
4
4
  end
5
5
  end
@@ -13,6 +13,16 @@ describe "Deploying an application that uses PHP and Composer" do
13
13
  install_cmd = @deployer.commands.grep(/composer install/).first
14
14
  install_cmd.should_not be_nil
15
15
  end
16
+
17
+ it "runs 'composer self-update' before 'composer install'" do
18
+ update_cmd = nil
19
+ @deployer.commands.each do |cmd|
20
+ update_cmd ||= /composer self-update/.match(cmd)
21
+ if /composer install/.match(cmd)
22
+ update_cmd.should_not be nil
23
+ end
24
+ end
25
+ end
16
26
  end
17
27
 
18
28
  context "WITHOUT a composer.lock but with composer.json" do
@@ -25,6 +35,16 @@ describe "Deploying an application that uses PHP and Composer" do
25
35
  install_cmd.should_not be_nil
26
36
  end
27
37
 
38
+ it "runs 'composer self-update' before 'composer install'" do
39
+ update_cmd = nil
40
+ @deployer.commands.each do |cmd|
41
+ update_cmd ||= /composer self-update/.match(cmd)
42
+ if /composer install/.match(cmd)
43
+ update_cmd.should_not be nil
44
+ end
45
+ end
46
+ end
47
+
28
48
  end
29
49
 
30
50
  end if $COMPOSER_INSTALLED
@@ -29,4 +29,10 @@ describe "Deploying an application with sqlite3 as the only DB adapter in the Ge
29
29
  @shared_path.join('databases', "#{@framework_env}.sqlite3").should exist
30
30
  end
31
31
 
32
+ it 'should contain valid yaml config' do
33
+ config = YAML.load_file(@release_path.join('config', 'database.yml'))
34
+ config[@framework_env]['adapter'].should == 'sqlite3'
35
+ config[@framework_env]['database'].should == @shared_path.join('databases', "#{@framework_env}.sqlite3").expand_path.to_s
36
+ end
37
+
32
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - EY Cloud Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-30 00:00:00.000000000 Z
11
+ date: 2013-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec