fontana_client_support 0.0.2 → 0.3.0
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.
- checksums.yaml +15 -0
- data/README.md +6 -1
- data/lib/fontana_client_support/tasks/deploy/scm.rake +25 -0
- data/lib/fontana_client_support/tasks/deploy/sync.rake +25 -0
- data/lib/fontana_client_support/tasks/server.rake +12 -15
- data/lib/fontana_client_support/tasks/spec.rake +1 -1
- data/lib/fontana_client_support/tasks/vendor_fontana.rake +5 -8
- data/lib/fontana_client_support/tasks.rb +2 -0
- data/lib/fontana_client_support/version.rb +1 -1
- data/lib/fontana_client_support.rb +31 -3
- metadata +7 -13
- data/lib/fontana_client_support/tasks/deploy.rake +0 -19
- data/lib/fontana_client_support/tasks/sync.rake +0 -16
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MWRmZjcxNmE3MjFmNWNmYzdiNzMzNDdlYmJmNzk3MWU1OGJmNTU1YQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MDQzMDc2ZjE3N2ZiN2QwYTFiNTIxZTA1ODZjOTEyYjkxMGFkMGFmYg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OGZlMGY1Y2RjYWVhN2QxOWZiYTAwNGUzMDAwMWRlMzFjNjgwZTM0Mjg1NTMz
|
10
|
+
OTVlMDRjYmI1YTEzNThiYjY1NDk5M2UzYmNkNzkwMDkyODBjODljMjkyYTQx
|
11
|
+
NjdjOGMyMjIzMWY0OTQ0NTZlZTdkMWIyZjAwNTY2M2UwYTkyNTE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MGI3OTUwZTM1ZDdjZmY1MTQ0ZGI1MDc3ODRmMTQ3ZWMwMjAzNWQ5ZmM3YzM5
|
14
|
+
OGFhYTZhODJlNjVkZTEzNDI4OTk3OTMyNGFiYWQwMmQ1NzA5OTMwMzNlNTRj
|
15
|
+
MWI2MGMzNjk5N2FlMGFjMzY1NWU4NGM4MDNmNzJlZDMzN2EwZDE=
|
data/README.md
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'fontana_client_support'
|
3
|
+
include Fontana::ServerRake
|
4
|
+
|
5
|
+
namespace :deploy do
|
6
|
+
|
7
|
+
# このタスク群は sync:* と対になっています。
|
8
|
+
namespace_with_fontana :scm, :"app:scm" do
|
9
|
+
|
10
|
+
set_url_and_branch = ->{
|
11
|
+
ENV['URL'] ||= FontanaClientSupport.repo_url
|
12
|
+
ENV['BRANCH'] ||= FontanaClientSupport.current_branch_name
|
13
|
+
}
|
14
|
+
|
15
|
+
desc "deploy:scm:setup + clone (+ checkout branch) + deploy:scm:update."
|
16
|
+
fontana_task :reset, before: set_url_and_branch
|
17
|
+
|
18
|
+
desc "drop DB, initialize, clear runtime workspace."
|
19
|
+
fontana_task :setup
|
20
|
+
|
21
|
+
desc "fetch, checkout, build app_seed and migrate."
|
22
|
+
fontana_task :update
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'fontana_client_support'
|
3
|
+
include Fontana::ServerRake
|
4
|
+
|
5
|
+
namespace :deploy do
|
6
|
+
|
7
|
+
# このタスク群は scm:* と対になっています。
|
8
|
+
namespace_with_fontana :sync, :"app:sync" do
|
9
|
+
|
10
|
+
runtime_source = ->{
|
11
|
+
ENV["RUNTIME_SOURCE"] = File.expand_path(".", FontanaClientSupport.root_dir)
|
12
|
+
}
|
13
|
+
|
14
|
+
|
15
|
+
desc "deploy:sync:setup + deploy:sync:update"
|
16
|
+
fontana_task :reset, before: runtime_source
|
17
|
+
|
18
|
+
desc "drop DB + initialize DB + clear runtime workspace. same as app:sync:setup"
|
19
|
+
fontana_task :setup
|
20
|
+
|
21
|
+
desc "update runtime + app_seed:build_from_runtime + migrate."
|
22
|
+
fontana_task :update, before: runtime_source
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -2,27 +2,24 @@ require 'fontana_client_support'
|
|
2
2
|
include Fontana::ServerRake
|
3
3
|
|
4
4
|
namespace_with_fontana :server, :libgss_test do
|
5
|
-
desc "luanch HTTP server"
|
6
|
-
fontana_task :launch_http_server
|
7
5
|
|
8
|
-
|
6
|
+
fontana_task :launch_http_server
|
9
7
|
fontana_task :launch_http_server_daemon
|
10
|
-
|
11
|
-
desc "luanch HTTPS server"
|
12
8
|
fontana_task :launch_https_server
|
13
|
-
|
14
|
-
desc "luanch HTTPS server daemon"
|
15
9
|
fontana_task :launch_https_server_daemon
|
10
|
+
fontana_task :launch_server_daemons
|
11
|
+
fontana_task :shutdown_server_daemons
|
12
|
+
fontana_task :check_daemon_alive
|
13
|
+
end
|
16
14
|
|
17
|
-
desc "luanch server"
|
18
|
-
fontana_task :launch_server
|
19
15
|
|
20
|
-
|
21
|
-
|
16
|
+
namespace :servers do
|
17
|
+
desc "start HTTP+HTTPS server daemons"
|
18
|
+
task :start => :"server:launch_server_daemons"
|
22
19
|
|
23
|
-
desc "
|
24
|
-
|
20
|
+
desc "stop HTTP+HTTPS server daemons"
|
21
|
+
task :stop => :"server:shutdown_server_daemons"
|
25
22
|
|
26
|
-
desc "
|
27
|
-
|
23
|
+
desc "restart HTTP+HTTPS server daemons"
|
24
|
+
task :restart => [:"servers:stop", :"servers:start"]
|
28
25
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'fontana_client_support'
|
3
3
|
include Fontana::ServerRake
|
4
4
|
|
5
|
-
desc "
|
5
|
+
desc "Run RSpec with server_daemons"
|
6
6
|
task :spec_with_server_daemons => [:"vendor:fontana:prepare"] do
|
7
7
|
Rake::Task["server:launch_server_daemons"].execute
|
8
8
|
begin
|
@@ -4,12 +4,10 @@ include Fontana::ServerRake
|
|
4
4
|
namespace :vendor do
|
5
5
|
namespace :fontana do
|
6
6
|
|
7
|
-
desc "clear"
|
8
7
|
task :clear do
|
9
8
|
FileUtils.rm_rf(FontanaClientSupport.vendor_fontana)
|
10
9
|
end
|
11
10
|
|
12
|
-
desc "clone"
|
13
11
|
task :clone => :"vendor:fontana:clear" do
|
14
12
|
raise "$FONTANA_REPO_URL is required" unless Fontana.repo_url
|
15
13
|
FileUtils.mkdir_p(FontanaClientSupport.vendor_dir)
|
@@ -22,10 +20,9 @@ namespace :vendor do
|
|
22
20
|
FileUtils.cp("config/project.yml.erb.example", "config/project.yml.erb")
|
23
21
|
system!("BUNDLE_GEMFILE=#{Fontana.gemfile} bundle install")
|
24
22
|
end
|
25
|
-
Rake::Task["deploy:reset"].execute
|
23
|
+
Rake::Task["deploy:#{FontanaClientSupport.deploy_strategy}:reset"].execute
|
26
24
|
end
|
27
25
|
|
28
|
-
desc "update"
|
29
26
|
task :update do
|
30
27
|
Dir.chdir(FontanaClientSupport.vendor_fontana) do
|
31
28
|
system!("git fetch origin")
|
@@ -33,10 +30,9 @@ namespace :vendor do
|
|
33
30
|
system!("BUNDLE_GEMFILE=#{Fontana.gemfile} bundle install")
|
34
31
|
system!("BUNDLE_GEMFILE=#{Fontana.gemfile} bundle exec rake db:drop")
|
35
32
|
end
|
36
|
-
Rake::Task["deploy:update"].execute
|
33
|
+
Rake::Task["deploy:#{FontanaClientSupport.deploy_strategy}:update"].execute
|
37
34
|
end
|
38
35
|
|
39
|
-
desc "prepare"
|
40
36
|
task :prepare do
|
41
37
|
if Dir.exist?(FontanaClientSupport.vendor_fontana)
|
42
38
|
Rake::Task["vendor:fontana:update"].execute
|
@@ -44,8 +40,9 @@ namespace :vendor do
|
|
44
40
|
Rake::Task["vendor:fontana:clone"].execute
|
45
41
|
end
|
46
42
|
end
|
43
|
+
|
44
|
+
desc "reset vendor/fontana"
|
45
|
+
task :reset => [:"vendor:fontana:clear", :"vendor:fontana:clone"]
|
47
46
|
end
|
48
47
|
|
49
|
-
desc "prepare vendor/fontana "
|
50
|
-
task :fontana => :"vendor:fontana:prepare"
|
51
48
|
end
|
@@ -14,14 +14,42 @@ module FontanaClientSupport
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def current_branch_name
|
17
|
-
@current_branch_name
|
18
|
-
|
19
|
-
|
17
|
+
unless @current_branch_name
|
18
|
+
work = `git log --decorate -1`.scan(/^commit\s[0-9a-f]+\s\((.+)\)/).
|
19
|
+
flatten.first.split(/,/).map(&:strip).reject{|s| s =~ /HEAD\Z/}
|
20
|
+
r = work.select{|s| s =~ /origin\//}.first
|
21
|
+
r ||= work.first
|
22
|
+
@current_branch_name = r.sub(/\Aorigin\//, '')
|
23
|
+
end
|
24
|
+
@current_branch_name
|
25
|
+
rescue => e
|
26
|
+
puts "[#{e.class}] #{e.message}"
|
27
|
+
puts "Dir.pwd: #{Dir.pwd}"
|
28
|
+
puts "git log --decorate -1\n" << `git log --decorate -1`
|
29
|
+
raise e
|
20
30
|
end
|
21
31
|
|
22
32
|
def repo_url
|
23
33
|
@repo_url ||= `git remote -v`.scan(/origin\s+(.+?)\s/).flatten.uniq.first
|
24
34
|
end
|
35
|
+
|
36
|
+
def deploy_strategy
|
37
|
+
@deploy_strategy ||= :deploy
|
38
|
+
end
|
39
|
+
|
40
|
+
DEPLOY_STRATEGY_NAMES = [:scm, :sync].freeze
|
41
|
+
|
42
|
+
def deploy_strategy=(v)
|
43
|
+
unless DEPLOY_STRATEGY_NAMES.include?(v)
|
44
|
+
raise ArgumentError, "invalid deploy_strategy: #{v.inspect} must be one of #{DEPLOY_STRATEGY_NAMES.inspect}"
|
45
|
+
end
|
46
|
+
@deploy_strategy = v
|
47
|
+
end
|
48
|
+
|
49
|
+
def configure
|
50
|
+
yield(self) if block_given?
|
51
|
+
self
|
52
|
+
end
|
25
53
|
end
|
26
54
|
end
|
27
55
|
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fontana_client_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- akima
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-03 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -61,37 +56,36 @@ files:
|
|
61
56
|
- lib/fontana/server_rake.rb
|
62
57
|
- lib/fontana_client_support.rb
|
63
58
|
- lib/fontana_client_support/tasks.rb
|
64
|
-
- lib/fontana_client_support/tasks/deploy.rake
|
59
|
+
- lib/fontana_client_support/tasks/deploy/scm.rake
|
60
|
+
- lib/fontana_client_support/tasks/deploy/sync.rake
|
65
61
|
- lib/fontana_client_support/tasks/fixtures.rake
|
66
62
|
- lib/fontana_client_support/tasks/server.rake
|
67
63
|
- lib/fontana_client_support/tasks/spec.rake
|
68
|
-
- lib/fontana_client_support/tasks/sync.rake
|
69
64
|
- lib/fontana_client_support/tasks/vendor_fontana.rake
|
70
65
|
- lib/fontana_client_support/version.rb
|
71
66
|
homepage: ''
|
72
67
|
licenses:
|
73
68
|
- MIT
|
69
|
+
metadata: {}
|
74
70
|
post_install_message:
|
75
71
|
rdoc_options: []
|
76
72
|
require_paths:
|
77
73
|
- lib
|
78
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
75
|
requirements:
|
81
76
|
- - ! '>='
|
82
77
|
- !ruby/object:Gem::Version
|
83
78
|
version: '0'
|
84
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
80
|
requirements:
|
87
81
|
- - ! '>='
|
88
82
|
- !ruby/object:Gem::Version
|
89
83
|
version: '0'
|
90
84
|
requirements: []
|
91
85
|
rubyforge_project:
|
92
|
-
rubygems_version:
|
86
|
+
rubygems_version: 2.0.3
|
93
87
|
signing_key:
|
94
|
-
specification_version:
|
88
|
+
specification_version: 4
|
95
89
|
summary: gem to support development and testing with GSS/fontana
|
96
90
|
test_files: []
|
97
91
|
has_rdoc:
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'fontana_client_support'
|
2
|
-
include Fontana::ServerRake
|
3
|
-
|
4
|
-
namespace_with_fontana :deploy, :"app:deploy" do
|
5
|
-
|
6
|
-
set_url_and_branch = ->{
|
7
|
-
ENV['URL'] ||= FontanaClientSupport.repo_url
|
8
|
-
ENV['BRANCH'] ||= FontanaClientSupport.current_branch_name
|
9
|
-
}
|
10
|
-
|
11
|
-
desc "deploy:setup deploy:update"
|
12
|
-
fontana_task :reset, before: set_url_and_branch
|
13
|
-
|
14
|
-
desc "drop DB, initialize, clear workspaces, clone, checkout branch. $URL required."
|
15
|
-
fontana_task :setup, before: set_url_and_branch
|
16
|
-
|
17
|
-
desc "fetch, checkout, build app_seed and migrate."
|
18
|
-
fontana_task :update, before: set_url_and_branch
|
19
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'fontana_client_support'
|
2
|
-
include Fontana::ServerRake
|
3
|
-
|
4
|
-
namespace_with_fontana :sync, :"runtime:update" do
|
5
|
-
desc "sync app/scripts directly"
|
6
|
-
fontana_task :app_scripts, before: ->{ ENV["APP_SCRIPTS_PATH"] = File.expand_path("../app/scripts", __FILE__) }
|
7
|
-
|
8
|
-
desc "sync spec/fixtures directly"
|
9
|
-
fontana_task :spec_fixtures, before: ->{ ENV["SPEC_FIXTURES_PATH"] = File.expand_path("../spec/fixtures", __FILE__) }
|
10
|
-
|
11
|
-
desc "sync app/scripts and spec/fixtures directly"
|
12
|
-
fontana_task :client, before: ->{
|
13
|
-
ENV["APP_SCRIPTS_PATH"] = File.expand_path("../app/scripts", __FILE__)
|
14
|
-
ENV["SPEC_FIXTURES_PATH"] = File.expand_path("../spec/fixtures", __FILE__)
|
15
|
-
}
|
16
|
-
end
|