gv-valley 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +24 -0
- data/README.md +38 -0
- data/Rakefile +9 -0
- data/bin/gv-valley +6 -0
- data/bin/valley +319 -0
- data/gv-valley.gemspec +27 -0
- data/lib/gv/addons/etcd.rb +41 -0
- data/lib/gv/addons/memcached.rb +34 -0
- data/lib/gv/addons/postgresql.rb +42 -0
- data/lib/gv/tasks/install.rake +116 -0
- data/lib/gv/valley/addon.rb +62 -0
- data/lib/gv/valley/app.rb +108 -0
- data/lib/gv/valley/balancer.rb +61 -0
- data/lib/gv/valley/deployer.rb +104 -0
- data/lib/gv/valley/etcd.rb +40 -0
- data/lib/gv/valley/file_server.rb +115 -0
- data/lib/gv/valley/runner.rb +138 -0
- data/lib/gv/valley/version.rb +5 -0
- data/lib/gv/valley.rb +10 -0
- data/scripts/haproxy.cfg +47 -0
- data/scripts/receiver +22 -0
- data/test/gv/test_app.rb +64 -0
- data/test/gv/test_etcd.rb +39 -0
- data/test/minitest_helper.rb +7 -0
- metadata +174 -0
data/scripts/receiver
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -eo pipefail
|
4
|
+
|
5
|
+
function config {
|
6
|
+
retval=`gv-bedrock service gv/bedrock/config get "$1"`
|
7
|
+
echo "$retval"
|
8
|
+
}
|
9
|
+
|
10
|
+
gv_user=$(config user)
|
11
|
+
gv_home=$(config home)
|
12
|
+
|
13
|
+
repo=$1; app="${repo%.*}"; rev=$2
|
14
|
+
|
15
|
+
mkdir -p $gv_home/$app
|
16
|
+
|
17
|
+
#file_server_url=`gv-valley service file_server url`
|
18
|
+
|
19
|
+
cat | docker run -i -v $gv_home/$app/cache:/tmp/cache:rw -a stdin -a stdout -a stderr flynn/slugbuilder - > $gv_home/$app/slug.tgz #$file_server_url/$app/slug.tgz
|
20
|
+
|
21
|
+
valley apps:deploy $app --trace
|
22
|
+
valley balancer:reload $app --trace
|
data/test/gv/test_app.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
require 'gv/valley/etcd'
|
3
|
+
require 'gv/valley/app'
|
4
|
+
|
5
|
+
module GV
|
6
|
+
module Valley
|
7
|
+
class TestApp < Minitest::Test
|
8
|
+
|
9
|
+
def setup
|
10
|
+
start_server
|
11
|
+
end
|
12
|
+
|
13
|
+
def teardown
|
14
|
+
stop_server
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_app_methods
|
18
|
+
pid = provide GV::Bedrock::Config
|
19
|
+
pid2 = provide GV::Valley::Etcd
|
20
|
+
pid3 = provide GV::Valley::FileServer
|
21
|
+
|
22
|
+
DRb.start_service
|
23
|
+
|
24
|
+
name = "testapp"
|
25
|
+
|
26
|
+
App.delete(name)
|
27
|
+
|
28
|
+
app = App.create(name)
|
29
|
+
refute_nil app
|
30
|
+
|
31
|
+
app = App.find(name)
|
32
|
+
refute_nil app
|
33
|
+
|
34
|
+
saved = app.save
|
35
|
+
refute_nil saved
|
36
|
+
|
37
|
+
empty_hash = {}
|
38
|
+
assert_equal name, app['name']
|
39
|
+
assert_equal ["SLUG_URL","PORT"], app['config'].keys
|
40
|
+
assert_equal empty_hash, app['ps']
|
41
|
+
assert_equal ["#{name}.greenvalley.local"], app['domains']
|
42
|
+
|
43
|
+
refute_nil app.delete
|
44
|
+
|
45
|
+
assert_nil App.find(name)
|
46
|
+
|
47
|
+
# clear all services
|
48
|
+
GV::Bedrock::Service.space.read_all([nil,nil,nil,nil]).each do |t|
|
49
|
+
GV::Bedrock::Service.space.take(t)
|
50
|
+
end
|
51
|
+
|
52
|
+
DRb.stop_service
|
53
|
+
|
54
|
+
|
55
|
+
kll pid3
|
56
|
+
kll pid2
|
57
|
+
kll pid
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
require 'gv/bedrock/config'
|
3
|
+
require 'gv/valley/etcd'
|
4
|
+
|
5
|
+
module GV
|
6
|
+
module Valley
|
7
|
+
class TestEtcd < Minitest::Test
|
8
|
+
|
9
|
+
def setup
|
10
|
+
start_server
|
11
|
+
end
|
12
|
+
|
13
|
+
def stop
|
14
|
+
stop_server
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_discovery
|
18
|
+
pid = provide GV::Bedrock::Config
|
19
|
+
pid2 = provide GV::Valley::Etcd
|
20
|
+
|
21
|
+
DRb.start_service
|
22
|
+
|
23
|
+
refute_nil GV::Valley::Etcd.service
|
24
|
+
|
25
|
+
# clear all services
|
26
|
+
GV::Bedrock::Service.space.read_all([nil,nil,nil,nil]).each do |t|
|
27
|
+
GV::Bedrock::Service.space.take(t)
|
28
|
+
end
|
29
|
+
|
30
|
+
DRb.stop_service
|
31
|
+
|
32
|
+
kll pid2
|
33
|
+
kll pid
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gv-valley
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Onur Uyar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: goliath
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: etcd
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: gv-common
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: gv-bedrock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- me@onuruyar.com
|
114
|
+
executables:
|
115
|
+
- gv-valley
|
116
|
+
- valley
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- .gitignore
|
121
|
+
- .travis.yml
|
122
|
+
- Gemfile
|
123
|
+
- LICENSE.txt
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- bin/gv-valley
|
127
|
+
- bin/valley
|
128
|
+
- gv-valley.gemspec
|
129
|
+
- lib/gv/addons/etcd.rb
|
130
|
+
- lib/gv/addons/memcached.rb
|
131
|
+
- lib/gv/addons/postgresql.rb
|
132
|
+
- lib/gv/tasks/install.rake
|
133
|
+
- lib/gv/valley.rb
|
134
|
+
- lib/gv/valley/addon.rb
|
135
|
+
- lib/gv/valley/app.rb
|
136
|
+
- lib/gv/valley/balancer.rb
|
137
|
+
- lib/gv/valley/deployer.rb
|
138
|
+
- lib/gv/valley/etcd.rb
|
139
|
+
- lib/gv/valley/file_server.rb
|
140
|
+
- lib/gv/valley/runner.rb
|
141
|
+
- lib/gv/valley/version.rb
|
142
|
+
- scripts/haproxy.cfg
|
143
|
+
- scripts/receiver
|
144
|
+
- test/gv/test_app.rb
|
145
|
+
- test/gv/test_etcd.rb
|
146
|
+
- test/minitest_helper.rb
|
147
|
+
homepage: https://github.com/green-valley/gv-valley
|
148
|
+
licenses:
|
149
|
+
- Unlicense
|
150
|
+
metadata: {}
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
require_paths:
|
154
|
+
- lib
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
requirements: []
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 2.2.2
|
168
|
+
signing_key:
|
169
|
+
specification_version: 4
|
170
|
+
summary: Micro Private PaaS with Ruby
|
171
|
+
test_files:
|
172
|
+
- test/gv/test_app.rb
|
173
|
+
- test/gv/test_etcd.rb
|
174
|
+
- test/minitest_helper.rb
|