capistrano-docker-compose 0.1.5 → 0.1.6

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: 1256939c6a2f2a0d207b0773732327c3b6b5ad68
4
- data.tar.gz: 6effdd8fc0b450427f7dddd6eeba36a58540a96e
3
+ metadata.gz: adc5fbcf7e6564e50a726b1aa54e7b327928ee7a
4
+ data.tar.gz: f9c97f9be3e6ac09179596344e4809c580bae795
5
5
  SHA512:
6
- metadata.gz: 25d305c46e8411b4e1e9b6564f2a6b91f2ab57562ac40661fff6ffd7cdb23dd348249b6276c0c8400239297fae11fd743d707e03087a780433b1257525cf464c
7
- data.tar.gz: 19904c112ef2426a435eda4239ada70e512c25632c7f28f81ffa2eaffa56c35c1730488beab1527d63b30e88e4043e75d4665dc5e639fc73511007497634156d
6
+ metadata.gz: 1eb865c71b25d09b599075290aace4d2118f1588ea40b8b11311353c81dedc516d9debcedf540f8b20145efe7b25720dd9461aab31d55bd9a89bf2069d414706
7
+ data.tar.gz: e1694f7e6d25f9c1165779537204b72fa20f59b4240d3e12467bc1a5bf66c621bf11ba70111b2ad15702aec8b4560ff3355a2d1af1d435cdaa18c48ea15e9b99
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.3.0
4
+ - 2.3.1
5
5
 
6
6
  install:
7
7
  - bundle
@@ -12,3 +12,12 @@ services:
12
12
  environment:
13
13
  - RAILS_ENV=staging
14
14
  - PASSENGER_APP_ENV=staging
15
+ db:
16
+ image: postgres:9.5
17
+ environment:
18
+ - POSTGRES_DB=staging
19
+ - PGDATA=/var/lib/postgresql/data/pgdata
20
+ - POSTGRES_USER=staging_user
21
+ - POSTGRES_PASSWORD=soZee4Ig+u1f
22
+ volumes:
23
+ - ../../shared/postgresql:/var/lib/postgresql/data/pgdata
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Docker
3
3
  module Compose
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
6
6
  end
7
7
  end
@@ -43,11 +43,25 @@ namespace :deploy do
43
43
 
44
44
  task :purge_old_containers do
45
45
  on roles(fetch(:docker_compose_roles)) do
46
- if fetch(:previous_release_path)
46
+ if fetch(:previous_release_path, false)
47
47
  info "Purging previous release containers at #{fetch(:previous_release_path)}"
48
+
49
+ release_name = Pathname.new(release_path).basename.to_s
50
+ web_container_id = capture("docker ps -q --filter 'name=#{release_name}_web'")
51
+ execute :docker, 'pause', web_container_id
52
+
48
53
  within fetch(:previous_release_path) do
49
54
  execute :'docker-compose', 'down'
50
55
  end
56
+
57
+ db_container_id = capture("docker ps -q --filter 'name=#{release_name}_db'")
58
+ execute :docker, 'restart', db_container_id
59
+
60
+ # Give services 3s to come up
61
+ # TODO: implement flexibly into options
62
+ sleep 3
63
+
64
+ execute :docker, 'unpause', web_container_id
51
65
  end
52
66
  end
53
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-docker-compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ain Tohvri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.5.1
112
+ rubygems_version: 2.4.5.1
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Docker Compose specific tasks for Capistrano.