capistrano-buildpack 0.0.1 → 0.0.2
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.
- data/lib/capistrano-buildpack/tasks.rb +37 -35
- data/lib/capistrano-buildpack/version.rb +1 -1
- metadata +20 -39
@@ -1,47 +1,49 @@
|
|
1
1
|
require 'digest/sha1'
|
2
2
|
|
3
|
-
Capistrano::Configuration.instance
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
if Capistrano::Configuration.instance
|
4
|
+
Capistrano::Configuration.instance.load do
|
5
|
+
after "deploy:setup" do
|
6
|
+
sudo "chown -R #{user} #{deploy_to}"
|
7
|
+
sudo "gem install --upgrade foreman-export-nginx"
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
before "deploy" do
|
11
|
+
default_run_options[:pty] = true
|
12
|
+
default_run_options[:shell] = '/bin/bash'
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
set :deploy_to, "/apps/#{application}"
|
15
|
+
set :foreman_export_path, "/etc/init"
|
16
|
+
set :foreman_export_type, "upstart"
|
17
|
+
set :nginx_export_path, "/etc/nginx/conf.d"
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
set :buildpack_hash, Digest::SHA1.hexdigest(buildpack_url)
|
20
|
+
set :buildpack_path, "#{shared_path}/buildpack-#{buildpack_hash}"
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
before "deploy:finalize_update" do
|
27
|
-
run("cd #{buildpack_path} && RACK_ENV=production bin/compile #{release_path} #{shared_path}/build_cache")
|
28
|
-
|
29
|
-
env_lines = []
|
30
|
-
deploy_env.each do |k,v|
|
31
|
-
env_lines << "#{k}=#{v}"
|
22
|
+
run("[[ ! -e #{buildpack_path} ]] && git clone #{buildpack_url} #{buildpack_path}; exit 0")
|
23
|
+
run("cd #{buildpack_path} && git fetch origin && git reset --hard origin/master")
|
24
|
+
run("mkdir -p #{shared_path}/build_cache")
|
32
25
|
end
|
33
|
-
env_contents = env_lines.join("\n") + "\n"
|
34
26
|
|
35
|
-
|
36
|
-
|
27
|
+
before "deploy:finalize_update" do
|
28
|
+
run("cd #{buildpack_path} && RACK_ENV=production bin/compile #{release_path} #{shared_path}/build_cache")
|
37
29
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
30
|
+
env_lines = []
|
31
|
+
deploy_env.each do |k,v|
|
32
|
+
env_lines << "#{k}=#{v}"
|
33
|
+
end
|
34
|
+
env_contents = env_lines.join("\n") + "\n"
|
35
|
+
|
36
|
+
put(env_contents, "#{release_path}/.env")
|
37
|
+
end
|
38
|
+
|
39
|
+
namespace :deploy do
|
40
|
+
task :restart do
|
41
|
+
sudo "foreman export #{foreman_export_type} #{foreman_export_path} -d #{release_path} -l /var/log/#{application} -a #{application} -u #{user} -p #{base_port} -c #{concurrency}"
|
42
|
+
sudo "env ADDITIONAL_DOMAINS=#{additional_domains.join(',')} BASE_DOMAIN=$CAPISTRANO:HOST$ nginx-foreman export nginx #{nginx_export_path} -d #{release_path} -l /var/log/apps -a #{application} -u #{user} -p #{base_port} -c #{concurrency}"
|
43
|
+
sudo "service #{application} restart || service #{application} start"
|
44
|
+
sudo "service nginx reload || service nginx start"
|
45
|
+
end
|
44
46
|
end
|
47
|
+
|
45
48
|
end
|
46
|
-
|
47
49
|
end
|
metadata
CHANGED
@@ -1,33 +1,23 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-buildpack
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Pete Keen
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2012-12-30 00:00:00 Z
|
12
|
+
date: 2012-12-31 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
14
|
description: Deploy 12-factor applications using Capistrano
|
22
|
-
email:
|
15
|
+
email:
|
23
16
|
- pete@bugsplat.info
|
24
17
|
executables: []
|
25
|
-
|
26
18
|
extensions: []
|
27
|
-
|
28
19
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
files:
|
20
|
+
files:
|
31
21
|
- .gitignore
|
32
22
|
- Gemfile
|
33
23
|
- LICENSE.txt
|
@@ -39,36 +29,27 @@ files:
|
|
39
29
|
- lib/capistrano-buildpack/version.rb
|
40
30
|
homepage: https://github.com/peterkeen/capistrano-buildpack
|
41
31
|
licenses: []
|
42
|
-
|
43
32
|
post_install_message:
|
44
33
|
rdoc_options: []
|
45
|
-
|
46
|
-
require_paths:
|
34
|
+
require_paths:
|
47
35
|
- lib
|
48
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
37
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
55
|
-
- 0
|
56
|
-
version: "0"
|
57
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
43
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
segments:
|
64
|
-
- 0
|
65
|
-
version: "0"
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
66
48
|
requirements: []
|
67
|
-
|
68
49
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.8.
|
50
|
+
rubygems_version: 1.8.23
|
70
51
|
signing_key:
|
71
52
|
specification_version: 3
|
72
53
|
summary: Deploy 12-factor applications using Capistrano
|
73
54
|
test_files: []
|
74
|
-
|
55
|
+
has_rdoc:
|