capdocker 1.0.17 → 1.0.18

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: afbee19ae4066431b0e6e1ddb7f068129a249296
4
- data.tar.gz: 20eb4ccd3d7f01dd303081809c7cc75198a7aab8
3
+ metadata.gz: 98e4e8b91344e39dc91442baec8a15006ebc1a32
4
+ data.tar.gz: d391b696507471821b76237bc1284de4100772c1
5
5
  SHA512:
6
- metadata.gz: d672b8bd816e73d5d770e876df8e6c3ddfab611b00d77ecb8292f1f42c7a5a0b69a23af7beb1d51e22dd57cb467e9dfd4121122531ab32ea1122412e38c2a2f3
7
- data.tar.gz: d9ac59a4c8fca665a2a651d39fae47019bc558ed938f9c834c39b368ce50a71af375bb943791c1b7e428356407adccdcb6e73f99cc62c635483a9bc2ba7153f2
6
+ metadata.gz: 99ec332e8048f845e5132b7a2e5b204fe4d160f005a6087657fdaaf9df8143c93eb11bfbf2cdbbb990a5c4e9e268ebc6f9ed1154b4678c749eae297f1e0de81f
7
+ data.tar.gz: 70e4a941820317bc8887756f91c1c1c15f4d511375689c43a112213efbc55124652cc4e56e49712288f8b8b4ad8f6922cf89ba3e721bfd223576747f2a944fee
data/capdocker.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{capdocker}
5
- s.version = "1.0.17"
5
+ s.version = "1.0.18"
6
6
  s.authors = ["Ross Riley", "One Black Bear"]
7
7
  s.email = %q{ross@oneblackbear.com}
8
8
  s.date = Time.now
data/lib/docker.rb CHANGED
@@ -4,7 +4,7 @@ Capistrano::Configuration.instance(:must_exist).load do
4
4
 
5
5
  desc "build an updated box, restart container"
6
6
  task :build do
7
- run "docker build -t oneblackbear/#{application} #{release_path}/"
7
+ run "docker build -t oneblackbear/#{application} containers/#{application}/"
8
8
  run "docker ps | grep #{app_port} | awk '{print $1}' | xargs -n 1 docker kill"
9
9
  run "docker run -p #{app_port}:80 -v /home/docker/data/#{application}/mysql:/data/mysql:rw -d -t oneblackbear/#{application}:latest"
10
10
  puts "*** Application now deloyed to port #{app_port} ***"
data/lib/docker_deploy.rb CHANGED
@@ -19,49 +19,41 @@ Capistrano::Configuration.instance(:must_exist).load do
19
19
  after "deploy:update_code", "deploy:mount_shares"
20
20
  after "deploy:update_code", "docker:build"
21
21
 
22
- #### Performs the initial setup for tasks ####
23
- task :config_setup do
24
- rpath = release_path rescue "./#{application}"
25
- set :release_path, rpath
26
- end
27
-
28
22
 
29
23
  namespace :deploy do
30
24
 
31
25
  desc "Deploys the project to docker server."
32
26
  task :default do
33
- config_setup
34
27
  update_code
35
28
  create_symlink
36
29
  restart
37
30
  end
38
31
 
39
32
  task :prepare do
40
- run "cd #{release_path} && rm -Rf ./*" rescue
41
- run "mkdir -p #{release_path}/platform"
42
- run "mkdir -m0777 -p data/#{application}/mysql"
33
+ run "cd ./containers/#{application} && rm -Rf ./*" rescue
34
+ run "mkdir -p containers/#{application}/platform"
35
+ run "mkdir -m0777 -p mounts/#{application}/mysql"
43
36
  end
44
37
 
45
38
  task :configure_platform do
46
39
  host_content = from_template("templates/nginx_host.erb")
47
- put host_content, "#{release_path}/platform/nginx_host.conf"
40
+ put host_content, "containers/#{application}/platform/nginx_host.conf"
48
41
 
49
42
  container_content = from_template("templates/nginx_container.erb")
50
- put container_content, "#{release_path}/platform/nginx_container.conf"
43
+ put container_content, "containers/#{application}/platform/nginx_container.conf"
51
44
 
52
45
  docker_content = from_template("templates/Dockerfile.erb")
53
- put docker_content, "#{release_path}/Dockerfile"
46
+ put docker_content, "containers/#{application}/Dockerfile"
54
47
  end
55
48
 
56
49
  task :update_code do
57
50
  puts "Pushing code for current git commit ..."
58
- set :basedir, capture("pwd").gsub(/\n|\r/, "")
59
51
  set :tag, %x[git rev-parse --short HEAD].strip() + ".tar.gz"
60
52
  run_locally "git archive HEAD | gzip > #{tag}"
61
- top.upload "#{tag}", "#{release_path}", :via => :scp, :mkdir => true
53
+ top.upload "#{tag}", "containers/#{application}", :via => :scp, :mkdir => true
62
54
  run_locally "rm #{tag}"
63
- run "cd #{release_path} && tar -xzvf #{tag}"
64
- run "rm #{release_path}/#{tag}"
55
+ run "cd containers/#{application} && tar -xzvf #{tag}"
56
+ run "rm containers/#{application}/#{tag}"
65
57
  end
66
58
 
67
59
  task :update_builds do
@@ -72,8 +64,9 @@ Capistrano::Configuration.instance(:must_exist).load do
72
64
 
73
65
  end
74
66
 
75
- task :create_symlink do
76
- run "ln -f -s #{basedir}/#{release_path}/platform/nginx_host.conf ./conf/nginx/#{application}.conf"
67
+ task :create_symlink do
68
+ set :basedir, capture("pwd").gsub(/\n|\r/, "")
69
+ run "ln -f -s #{basedir}/containers/#{application}/platform/nginx_host.conf ./conf/nginx/#{application}.conf"
77
70
  end
78
71
 
79
72
  task :restart do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capdocker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Riley