capistrano-phoenix 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7e42b5f0bc2d2f7e569003426ddd87a4aab91017
4
+ data.tar.gz: 3e71a2270c3c6027e86012e28b46d19eff92b77f
5
+ SHA512:
6
+ metadata.gz: d79c756876b57889cec190a8b96661bc8e15ca2b7856eeb16742269ab239a0dbe9c6a77cbd40e1b7b2f3b6b41de1469e972c53628aaccfd0bfc8c695920e18db
7
+ data.tar.gz: ecffa588ac0c22d03bde1a9f0de17a28ab25da4e347c8392e9a3275e1e486b673bdc904b7742187e41b96840cd79764001f2b14330f5ca8174fae060ed755f45
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .DS_Store
2
+ Gemfile.lock
3
+ pkg
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ Capistrano::Phoenix
2
+ ===================
3
+ Phoenix integration for Capistrano
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/phoenix/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'capistrano-phoenix'
8
+ spec.version = Capistrano::Phoenix::VERSION
9
+ spec.authors = ['maruware']
10
+ spec.email = ['maruware@maruware.com']
11
+ spec.summary = %q{Phoenix integration for Capistrano}
12
+ spec.description = %q{Phoenix integration for Capistrano}
13
+ spec.homepage = 'https://github.com/maruware/capistrano-phoenix'
14
+ spec.license = 'MIT'
15
+
16
+ spec.required_ruby_version = '>= 1.9.3'
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'capistrano'
21
+ end
File without changes
@@ -0,0 +1,7 @@
1
+ require 'capistrano/version'
2
+
3
+ if Gem::Specification.find_by_name('capistrano').version >= Gem::Version.new('3.0.0')
4
+ load File.expand_path('../tasks/capistrano.cap', __FILE__)
5
+ else
6
+ raise NotImplementedError, 'not supported v2 yet.'
7
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Phoenix
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,49 @@
1
+ namespace :load do
2
+ task :defaults do
3
+ set :phoenix_role, -> { :app }
4
+ set :phoenix_mix_env, -> { fetch(:mix_env) }
5
+ end
6
+ end
7
+
8
+ namespace :phoenix do
9
+ def is_application_running?()
10
+ pid = capture(%Q{ps ax -o pid= -o command=|grep "rel/#{fetch(:application)}/.*/[b]eam"|awk '{print $1}'})
11
+ return pid != ""
12
+ end
13
+
14
+ desc 'ping'
15
+ task :ping do
16
+ on roles(fetch(:phoenix_role)), in: :sequence do
17
+ within current_path do
18
+ execute "rel/#{fetch(:application)}/bin/#{fetch(:application)}", "ping"
19
+ end
20
+ end
21
+ end
22
+
23
+ desc 'build'
24
+ task :build do
25
+ on roles(fetch(:phoenix_role)), in: :sequence do
26
+ within release_path do
27
+ execute :mix, "do deps.get, compile && MIX_ENV=#{fetch(:phoenix_mix_env)} mix phoenix.digest && MIX_ENV=#{fetch(:phoenix_mix_env)} mix release"
28
+ end
29
+ end
30
+ end
31
+
32
+ desc 'restart phoenix app'
33
+ task :restart do
34
+ on roles(fetch(:phoenix_role)), in: :sequence do
35
+ within current_path do
36
+
37
+ if is_application_running?
38
+ execute "rel/#{fetch(:application)}/bin/#{fetch(:application)}", "stop"
39
+ end
40
+ execute "rel/#{fetch(:application)}/bin/#{fetch(:application)}", "start -detached"
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ namespace :deploy do
47
+ after :publishing, "phoenix:build"
48
+ after :published, "phoenix:restart"
49
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-phoenix
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - maruware
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Phoenix integration for Capistrano
28
+ email:
29
+ - maruware@maruware.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - README.md
37
+ - Rakefile
38
+ - capistrano-phoenix.gemspec
39
+ - lib/capistrano-phoenix.rb
40
+ - lib/capistrano/phoenix.rb
41
+ - lib/capistrano/phoenix/version.rb
42
+ - lib/capistrano/tasks/capistrano.cap
43
+ homepage: https://github.com/maruware/capistrano-phoenix
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.9.3
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.4.5
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: Phoenix integration for Capistrano
67
+ test_files: []