fly.io-rails 0.0.11 → 0.0.12

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
  SHA256:
3
- metadata.gz: 5d9991a9da5d9f5d1f689a03a18696ad5d217e8ba2f5e2c8a01983da4069c376
4
- data.tar.gz: 4973d581b8d41e43220d8e827428fd9c1c9af2bad6253302d41fcff50511f9c8
3
+ metadata.gz: 580f640bd3cf1841fe8d6bd38690f2ba2827510b83ae3265c295b292c16ea007
4
+ data.tar.gz: f00643fe5ea9d16364909b1324259b0132887f2c1c531b8a68ddf81548c99ac3
5
5
  SHA512:
6
- metadata.gz: 8aed2af1af40398622589a220d004a9ec1e1fb3d8f3f89ccb38ee17de9e4db83b7d95cf86ab1b4eceb36aed358dbdd872757daf0a0fe9b88c3f460e2ef6df825
7
- data.tar.gz: eebcc6dcc83483ca09dba2f067511ca9ee12fcf107dbff6c110f42cd4dee2da3b574467e00e23fb0fa477a9fba5b4eaa7c26f10b0c3cd9ccd94ae6b1fb16ac75
6
+ metadata.gz: 4ddc3a7e877f15f595836c008348fdcd13422a892a041a2b19e795d557402986f1d4c19463785f1210e527314071bc5cbb6df3ec71e69b92a6326b0da853350b
7
+ data.tar.gz: bc79ea6cbfce294c741a9580c31dfaa74dd8b0b9079e45e5e6391f7b8f9ee8e1658a6e2c3817bfbe04d2824bf02975fa3acfc157bf50c445d91939665de0a81e
@@ -1,3 +1,3 @@
1
1
  module Fly_io
2
- VERSION = '0.0.11'
2
+ VERSION = '0.0.12'
3
3
  end
@@ -21,6 +21,9 @@ ARG RUBY_VERSION=<%= @ruby_version %>
21
21
  ARG VARIANT=jemalloc-slim
22
22
  FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base
23
23
 
24
+ <% if @node -%>
25
+ ARG NODE_VERSION=<%= @node_version %>
26
+ <% end -%>
24
27
  ARG BUNDLER_VERSION=<%= @bundler_version %>
25
28
 
26
29
  ARG RAILS_ENV=production
@@ -38,6 +41,13 @@ RUN mkdir /app
38
41
  WORKDIR /app
39
42
  RUN mkdir -p tmp/pids
40
43
 
44
+ <% if @node -%>
45
+ RUN curl https://get.volta.sh | bash
46
+ ENV VOLTA_HOME /root/.volta
47
+ ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
48
+ RUN volta install node@${NODE_VERSION}
49
+
50
+ <% end -%>
41
51
  #######################################################################
42
52
 
43
53
  # install packages only needed at build time
@@ -65,6 +75,22 @@ RUN gem update --system --no-document && \
65
75
  COPY Gemfile* ./
66
76
  RUN bundle install && rm -rf vendor/bundle/ruby/*/cache
67
77
 
78
+ <% if @node -%>
79
+ #######################################################################
80
+
81
+ # install node modules
82
+
83
+ FROM build_deps as node_modules
84
+
85
+ COPY package*json ./
86
+ <% if @yarn -%>
87
+ COPY yarn.* ./
88
+ RUN volta install yarn && yarn install;
89
+ <% else -%>
90
+ RUN npm install
91
+ <% end -%>
92
+
93
+ <% end -%>
68
94
  #######################################################################
69
95
 
70
96
  # install deployment packages
@@ -86,6 +112,11 @@ COPY --from=gems /app /app
86
112
  COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
87
113
  COPY --from=gems /usr/local/bundle /usr/local/bundle
88
114
 
115
+ <% if @node -%>
116
+ # copy installed node modules
117
+ COPY --from=node_modules /app/node_modules /app/node_modules
118
+
119
+ <% end -%>
89
120
  #######################################################################
90
121
 
91
122
  # Deploy your application
@@ -31,7 +31,11 @@ class TerraformGenerator < Rails::Generators::Base
31
31
 
32
32
  @ruby_version = RUBY_VERSION
33
33
  @bundler_version = Bundler::VERSION
34
+ @node = File.exist? 'node_modules'
35
+ @yarn = File.exist? 'yarn.lock'
36
+ @node_version = @node ? `node --version`.chomp.sub(/^v/, '') : '16.17.0'
34
37
  @appName = @app.gsub('-', '_').camelcase(:lower)
38
+
35
39
  template 'Dockerfile.erb', 'Dockerfile'
36
40
  template 'dockerignore.erb', '.dockerignore'
37
41
  template 'main.tf.erb', 'main.tf'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fly.io-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby