vps 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 933bc1ae373f67158e536ef0f9fba44ce4dc7173
4
- data.tar.gz: 4dc3addd296f9b7d7fd836ff3a82262572b21344
3
+ metadata.gz: 495b59ec7e4efd137d87d03d2d5592512849879f
4
+ data.tar.gz: d9bf0c254e4e532e051a892096ba8cbdfbedda3b
5
5
  SHA512:
6
- metadata.gz: 7eb4e3894ac019a90d984987761c5f03e57f1bdf35f9417bb1aa1df4ec817c9d3071d8715217516b4a6e0da237a0ddc9baacd413e807746ed243205f9ee256b7
7
- data.tar.gz: c913b9fd13f1180e99dfda46425187f7989064d5ba19c021f24d9913a89123b4a381b3aa4ce45fc708440d83c36d046e79aff86a42df1ac6c1c367d689549c6a
6
+ metadata.gz: bbc9e798ff049bcef6ca15750ca26a9fb6d015706068628118381d2a8702f1a041f7a6d55d0d2145a1e8de52c640e19f8d48e9eaf522a62d8714e22a518e1ad7
7
+ data.tar.gz: b52f3f9474ef1cc806bcf2fd14be10951641347a439016be2386e5d39c2c18c4575feabea7f4f4ab2042c87cebcf894a77f716daece7ed25fa77093d4edf46d5
@@ -1,5 +1,10 @@
1
1
  ## VPS CHANGELOG
2
2
 
3
+ ### Version 0.2.2 (January 2, 2020)
4
+
5
+ * Automatically add container names for upstreams and services
6
+ * Add opportunity to add lines to the generated Dockerfile
7
+
3
8
  ### Version 0.2.1 (January 2, 2020)
4
9
 
5
10
  * Support NodeJS based applications
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -12,10 +12,7 @@ module VPS
12
12
  spec = derive_upstream(path)
13
13
  config[:upstreams].push(spec.merge({
14
14
  :name => name || File.basename(path),
15
- :path => path,
16
- :compose => {
17
- :container_name => name || File.basename(path)
18
- }
15
+ :path => path
19
16
  }))
20
17
  VPS.write_config(host, config)
21
18
  end
@@ -1,7 +1,7 @@
1
1
  module VPS
2
2
  MAJOR = 0
3
3
  MINOR = 2
4
- TINY = 1
4
+ TINY = 2
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  end
@@ -34,12 +34,13 @@ services:
34
34
  <%- services.to_h.each do |name, spec| %>
35
35
 
36
36
  <%= name %>:
37
- <%= OpenStruct.to_hash(spec).to_yaml.sub(/^.*?\n/, "").indent(4) %>
37
+ <%= OpenStruct.to_hash(spec).to_yaml.sub(/^.*?\n/, "").sub("\n", "\ncontainer_name: #{name}\n").indent(4) %>
38
38
  <%- end %>
39
39
  <%- upstreams.each do |upstream| %>
40
40
 
41
41
  <%= upstream.name %>:
42
42
  image: <%= upstream.name %>
43
+ container_name: <%= upstream.name %>
43
44
  restart: always
44
45
  <%- unless upstream[:compose].inspect.match(/\bports\b/) %>
45
46
  ports:
@@ -8,5 +8,8 @@ WORKDIR /opt/app
8
8
  COPY . .
9
9
 
10
10
  ENV NODE_ENV=production
11
+ <%- if upstream.dockerfile %>
12
+ <%= upstream.dockerfile.strip %>
13
+ <%- end %>
11
14
  RUN npm install
12
15
  CMD ["npm", "start"]
@@ -9,5 +9,8 @@ WORKDIR /opt/app
9
9
  COPY . .
10
10
 
11
11
  ENV MIX_ENV=prod
12
+ <%- if upstream.dockerfile %>
13
+ <%= upstream.dockerfile.strip %>
14
+ <%- end %>
12
15
  RUN mix do deps.get --only prod, deps.compile
13
16
  CMD ["sh", "-c", "mix phx.server"]
@@ -9,5 +9,8 @@ WORKDIR /opt/app
9
9
  COPY . .
10
10
 
11
11
  ENV MIX_ENV=prod
12
+ <%- if upstream.dockerfile %>
13
+ <%= upstream.dockerfile.strip %>
14
+ <%- end %>
12
15
  RUN mix do deps.get --only prod, deps.compile
13
16
  CMD ["sh", "-c", "mix run --no-halt"]
@@ -11,6 +11,9 @@ WORKDIR /opt/app
11
11
  COPY . .
12
12
 
13
13
  ENV RACK_ENV=production
14
+ <%- if upstream.dockerfile %>
15
+ <%= upstream.dockerfile.strip %>
16
+ <%- end %>
14
17
  RUN gem install bundler -v <%= upstream.bundler_version %>
15
18
  RUN bundle install --without development test
16
19
  CMD ["bundle", "exec", "rackup", "config.ru", "-o", "0.0.0.0"]
@@ -10,8 +10,12 @@ RUN apk update \
10
10
  WORKDIR /opt/app
11
11
  COPY . .
12
12
 
13
- ENV RAILS_ENV=production
14
13
  EXPOSE <%= upstream.port %>
14
+
15
+ ENV RAILS_ENV=production
16
+ <%- if upstream.dockerfile %>
17
+ <%= upstream.dockerfile.strip %>
18
+ <%- end %>
15
19
  RUN gem install bundler -v <%= upstream.bundler_version %>
16
20
  RUN bundle install --without development test
17
21
  CMD ["rm", "-f", "tmp/pids/server.pid"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Engel