vps 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/lib/vps.rb +1 -0
- data/lib/vps/cli/domain.rb +1 -1
- data/lib/vps/cli/upstream.rb +17 -7
- data/lib/vps/version.rb +1 -1
- data/templates/docker/upstream/Dockerfile.node.erb +12 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 933bc1ae373f67158e536ef0f9fba44ce4dc7173
|
4
|
+
data.tar.gz: 4dc3addd296f9b7d7fd836ff3a82262572b21344
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eb4e3894ac019a90d984987761c5f03e57f1bdf35f9417bb1aa1df4ec817c9d3071d8715217516b4a6e0da237a0ddc9baacd413e807746ed243205f9ee256b7
|
7
|
+
data.tar.gz: c913b9fd13f1180e99dfda46425187f7989064d5ba19c021f24d9913a89123b4a381b3aa4ce45fc708440d83c36d046e79aff86a42df1ac6c1c367d689549c6a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## VPS CHANGELOG
|
2
2
|
|
3
|
+
### Version 0.2.1 (January 2, 2020)
|
4
|
+
|
5
|
+
* Support NodeJS based applications
|
6
|
+
* Clean up default upstream specs
|
7
|
+
* Set container name when adding upstream
|
8
|
+
|
3
9
|
### Version 0.2.0 (December 31, 2019)
|
4
10
|
|
5
11
|
* Provide ability to add both custom HTTP and HTTPS Nginx configs
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1
|
1
|
+
0.2.1
|
data/lib/vps.rb
CHANGED
data/lib/vps/cli/domain.rb
CHANGED
@@ -11,7 +11,7 @@ module VPS
|
|
11
11
|
|
12
12
|
if (upstream = config[:upstreams].detect{|upstream| upstream[:name] == name})
|
13
13
|
upstream[:email] = email if email
|
14
|
-
upstream[:domains].push(domain).uniq!
|
14
|
+
(upstream[:domains] ||= []).push(domain).uniq!
|
15
15
|
VPS.write_config(host, config)
|
16
16
|
end
|
17
17
|
end
|
data/lib/vps/cli/upstream.rb
CHANGED
@@ -10,16 +10,12 @@ module VPS
|
|
10
10
|
|
11
11
|
unless config[:upstreams].any?{|upstream| upstream[:name] == name}
|
12
12
|
spec = derive_upstream(path)
|
13
|
-
spec[:nginx] ||= {
|
14
|
-
:http => nil,
|
15
|
-
:https => nil
|
16
|
-
}
|
17
13
|
config[:upstreams].push(spec.merge({
|
18
14
|
:name => name || File.basename(path),
|
19
15
|
:path => path,
|
20
|
-
:
|
21
|
-
|
22
|
-
|
16
|
+
:compose => {
|
17
|
+
:container_name => name || File.basename(path)
|
18
|
+
}
|
23
19
|
}))
|
24
20
|
VPS.write_config(host, config)
|
25
21
|
end
|
@@ -87,6 +83,20 @@ module VPS
|
|
87
83
|
}
|
88
84
|
end
|
89
85
|
end
|
86
|
+
elsif Dir["#{path}/package.json"].any?
|
87
|
+
tmpfile = "#{Dir.tmpdir}/vps-debug.log"
|
88
|
+
pid = spawn("cd #{path} && npm start", :out => tmpfile, :err => "/dev/null")
|
89
|
+
Process.detach(pid)
|
90
|
+
sleep 5
|
91
|
+
`ps aux | grep -e "no[d]e #{path}"`.strip.split("\n").collect do |line|
|
92
|
+
`kill -9 #{line.split(" ")[1]}`
|
93
|
+
end
|
94
|
+
port = File.read(tmpfile).match(/on port (\d+)/).captures.first.to_i
|
95
|
+
{
|
96
|
+
type: "node",
|
97
|
+
node_version: `$SHELL -l -c 'cd #{path} && node -v'`.match(/[\d\.?]+/).to_s,
|
98
|
+
port: port
|
99
|
+
}
|
90
100
|
end
|
91
101
|
end
|
92
102
|
|
data/lib/vps/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Engel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- script/console
|
175
175
|
- templates/docker/data/nginx/app.conf.erb
|
176
176
|
- templates/docker/docker-compose.yml.erb
|
177
|
+
- templates/docker/upstream/Dockerfile.node.erb
|
177
178
|
- templates/docker/upstream/Dockerfile.phoenix.erb
|
178
179
|
- templates/docker/upstream/Dockerfile.plug.erb
|
179
180
|
- templates/docker/upstream/Dockerfile.rack.erb
|