smartcloud 0.0.60 → 0.0.61

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: c232578df6b9c605cd12ffea381afdc7b96be07fac4965d67428a4672450fb45
4
- data.tar.gz: 380004759b4c0ada658329ccf2b3a35bab6d7ba9318fecbb46789a0496e46149
3
+ metadata.gz: 6c4a12cc5b76d2ef4beade090ae25d0ace5b859dfc4cc16d907bf5be47a82284
4
+ data.tar.gz: 8d618cccb5ef06a31657d2f19dc996ef9bb137a5c0d4c5a2f9c845082766ac4e
5
5
  SHA512:
6
- metadata.gz: cf1f39b846803fcd00457b5f4a747006cb95149e5e21847ec71e91e310b5b7fc4e97559505825ad01fa974ce15cd7fc487c2dabf7c8d6fe17dbc28ea8143848f
7
- data.tar.gz: b13454b0a7a6b00cbafe34d391e8efbc23e10fe66333cbe89b72ebdffeb655b2185c9dd8c1235d0c32323972fb6a5ed1ef048fd9d0d636d21d262b96dc260555
6
+ metadata.gz: 825c357f42ddb91660b77508a5bf5fbdc9905603ae8c29029cb0c324c93b43cad442c747483db9a04ab7a99e37f6ffdd27bab99d354cd8441b08c5f482d86432
7
+ data.tar.gz: c6d82cd5f710c9d45569999cf5ff729cf91de4b7d58e6730c3b1f688984bcd99d8b935424a6ef85f0b4268152187fd926f7fc8e75b47cbfb4aa359006bb93a6e
@@ -7,24 +7,11 @@ RUN apk add --update tzdata && \
7
7
  rm -rf /var/cache/apk/*
8
8
 
9
9
  # Install bundler and foreman gems
10
- RUN gem install bundler; gem install foreman;
11
-
12
- # Generating entrypoint file
13
- RUN echo -e '#!/bin/sh\n\
14
- \n\
15
- cd /code\n\
16
- test -f ./tmp/pids/server.pid && rf ./tmp/pids/server.pid; true\n\
17
- \n\
18
- echo "---------------------------------------------------------------"\n\
19
- echo "-----> Performing bundle install"\n\
20
- bundle install\n\
21
- echo "-----> Compiling Assets"\n\
22
- bundle exec rails assets:precompile\n\
23
- \n\
24
- exec "$@"' >> /entrypoint; chmod +x /entrypoint;
10
+ RUN gem install bundler && \
11
+ gem install foreman
25
12
 
26
13
  # Set entrypoint
27
- ENTRYPOINT ["/entrypoint"]
14
+ ENTRYPOINT ["ruby", "builder.rb"]
28
15
 
29
16
  # Command to execute at container start
30
17
  CMD foreman start -f Procfile
@@ -0,0 +1,22 @@
1
+ class Builder
2
+ def initialize
3
+ puts "---------------------------------------------------------------"
4
+
5
+ FileUtils.rm("./tmp/pids/server.pid") if File.exist? "./tmp/pids/server.pid"
6
+
7
+ puts "Performing bundle install ... "
8
+ if system("bundle install")
9
+ puts "done"
10
+ puts "Compiling Assets ... "
11
+ if system("bundle exec rails assets:precompile")
12
+ puts "done"
13
+ # exec "$@"
14
+ exit 0
15
+ end
16
+ end
17
+
18
+ exit 1
19
+ end
20
+ end
21
+
22
+ Builder.new
@@ -294,12 +294,12 @@ module Smartcloud
294
294
  # Starting Rails App
295
295
  self.start_rails_app(appname, container_path, container_path_with_now_date)
296
296
  end
297
- end
298
-
299
- # This line is important to cancel pre-receive push if finally the app could not be started.
300
- # If the app was finally started, then this line should never be executed.
301
- exit 1
297
+ end
302
298
  end
299
+
300
+ # This line is important to cancel pre-receive push if finally the app could not be started.
301
+ # If the app was finally started, then this line should never be executed.
302
+ exit 1
303
303
  end
304
304
 
305
305
  def self.stop_app(appname)
@@ -342,6 +342,11 @@ module Smartcloud
342
342
  EOF")
343
343
  end
344
344
 
345
+ # Setup Builder
346
+ builder_path = "#{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-runner/buildpacks/rails/builder.rb"
347
+ %x[chmod +x #{builder_path}]
348
+ FileUtils.cp(builder_path, container_path_with_now_date)
349
+
345
350
  # Creating & Starting container
346
351
  # IMPORTANT NOTE:
347
352
  # The below commands of docker are executed here. However, they run from the host.
@@ -353,6 +358,7 @@ module Smartcloud
353
358
  --env-file='#{container_path}/env' \
354
359
  --expose='5000' \
355
360
  --volume='#{container_path_with_now_date}:/code' \
361
+ --workdir='/code' \
356
362
  --restart='always' \
357
363
  --network='nginx-network' \
358
364
  smartcloud/buildpacks/rails", out: File::NULL)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.60
4
+ version: 0.0.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timeboard
@@ -32,6 +32,7 @@ files:
32
32
  - lib/smartcloud/grids/grid-nginx/nginx.tmpl
33
33
  - lib/smartcloud/grids/grid-runner/Dockerfile
34
34
  - lib/smartcloud/grids/grid-runner/buildpacks/rails/Dockerfile
35
+ - lib/smartcloud/grids/grid-runner/buildpacks/rails/builder.rb
35
36
  - lib/smartcloud/grids/grid-solr/docker-entrypoint-initdb.d/.keep
36
37
  - lib/smartcloud/grids/grid-solr/sunspot/conf/schema.xml
37
38
  - lib/smartcloud/grids/grid-solr/sunspot/conf/solrconfig.xml