smartcloud 0.0.57 → 0.0.62

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: 891d83721c59043e1eb4eefc6b96825d5d557f54b63d523ca5e7f42c74c27bc2
4
- data.tar.gz: 9069fe3985cf4c46df661575d26989c92355c307b866261503b3647e588509af
3
+ metadata.gz: 54c39d34ceaa5c208501171a9f415b7d24e75d4db1ce5b6c994c13640069c54e
4
+ data.tar.gz: 3e085817a21ffb50de48463b976a380512efb6a1ce1e87df1ae244fcb4322177
5
5
  SHA512:
6
- metadata.gz: b6fa7ac7a2124f8a85fb78b6bb8183da88cd9be4b45ec346d61ae66b0dfc02f7636d69255e34e30e01628c8c38c04b236238e6ed3d8c4008616fba1d62b607ba
7
- data.tar.gz: a9a909922a57022f08fdf178f8f30055e95b41a4a75fced769301b9f938400ca126e95ebf5c484d9f132e7afaec2c1435bb77afe956cd1c78778c52423afa9d7
6
+ metadata.gz: a462a67925b5bdaab7cf644bd4fe655d0be4b0e485adf462db4500f3f9bc968f54c5b24bfc190df7dc060dc7fe9c147a50cbda5ac8cbec9a72781b29f734999f
7
+ data.tar.gz: 663beca1d5bac206591e051679105b1b097d7efe004535a26a0e14f0d2292a91cc61d1247cda56d09a7ebf1286cccfd9ccfa6637646597f61840fba4177f8d97
@@ -7,24 +7,8 @@ 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;
25
-
26
- # Set entrypoint
27
- ENTRYPOINT ["/entrypoint"]
10
+ RUN gem install bundler && \
11
+ gem install foreman
28
12
 
29
13
  # Command to execute at container start
30
- CMD foreman start -f Procfile
14
+ CMD ["ruby", "buildpacker.rb"]
@@ -0,0 +1,20 @@
1
+ class Buildpacker
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 "-----> Compiling Assets ... "
10
+ if system("bundle exec rails assets:precompile")
11
+ system("foreman start -f Procfile")
12
+ end
13
+ end
14
+
15
+ puts "failed."
16
+ exit 1
17
+ end
18
+ end
19
+
20
+ Buildpacker.new
@@ -24,6 +24,7 @@ module Smartcloud
24
24
  --env LETSENCRYPT_EMAIL=#{Smartcloud.config.sysadmin_email} \
25
25
  --env LETSENCRYPT_TEST=#{Smartcloud.config.letsencrypt_test} \
26
26
  --env GIT_PROJECT_ROOT=#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-runner/apps/repositories \
27
+ --env GIT_HTTP_EXPORT_ALL="" \
27
28
  --expose='9000' \
28
29
  --volume='#{Smartcloud.config.user_home_path}/.smartcloud/config:#{Smartcloud.config.user_home_path}/.smartcloud/config' \
29
30
  --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-runner:#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-runner' \
@@ -293,12 +294,12 @@ module Smartcloud
293
294
  # Starting Rails App
294
295
  self.start_rails_app(appname, container_path, container_path_with_now_date)
295
296
  end
296
- end
297
-
298
- # This line is important to cancel pre-receive push if finally the app could not be started.
299
- # If the app was finally started, then this line should never be executed.
300
- exit 1
297
+ end
301
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
302
303
  end
303
304
 
304
305
  def self.stop_app(appname)
@@ -341,6 +342,10 @@ module Smartcloud
341
342
  EOF")
342
343
  end
343
344
 
345
+ # Setup Buildpacker
346
+ buildpacker_path = "#{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-runner/buildpacks/rails/buildpacker.rb"
347
+ FileUtils.cp(buildpacker_path, container_path_with_now_date)
348
+
344
349
  # Creating & Starting container
345
350
  # IMPORTANT NOTE:
346
351
  # The below commands of docker are executed here. However, they run from the host.
@@ -352,6 +357,7 @@ module Smartcloud
352
357
  --env-file='#{container_path}/env' \
353
358
  --expose='5000' \
354
359
  --volume='#{container_path_with_now_date}:/code' \
360
+ --workdir='/code' \
355
361
  --restart='always' \
356
362
  --network='nginx-network' \
357
363
  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.57
4
+ version: 0.0.62
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/buildpacker.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