smartcloud 0.0.58 → 0.0.63
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60ffcf8723cff346b850754c1699dabddfb77cb2c5da32ade9546d81089d66d1
|
4
|
+
data.tar.gz: defff013409825d5e260e206c619be0d91bc545ecc9c092d1545ace95ddbf0a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a7db48110a4de14f855e7968f56b3bd090902ebbbe2f944e987e61a7fc4c8eb46f0843a03b448e6a4fc6518e01ef3779c3655065699ad43d659e5f0f845b037
|
7
|
+
data.tar.gz: 668058410b8617e36f62b8a9c121f4912161d16be01cdb4d0e93cd78172545da2bf256805de54aed5ac0e819af1881656efdb11a6210bcb01972e428f2460a0b
|
@@ -1,4 +1,4 @@
|
|
1
|
-
FROM
|
1
|
+
FROM docker:latest
|
2
2
|
MAINTAINER Timeboard <hello@timeboard.me>
|
3
3
|
|
4
4
|
# Setting up group and user
|
@@ -19,6 +19,7 @@ RUN sed -i "s/999/99/" /etc/group && \
|
|
19
19
|
# - spawn-fcgi, to launch fcgiwrap and to create the unix socket
|
20
20
|
RUN apk add --update git && \
|
21
21
|
apk add --update git-daemon && \
|
22
|
+
apk add --update ruby && \
|
22
23
|
apk add --update fcgiwrap && \
|
23
24
|
apk add --update spawn-fcgi && \
|
24
25
|
rm -rf /var/cache/apk/*
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Buildpacker
|
2
|
+
def initialize
|
3
|
+
puts "---------------------------------------------------------------"
|
4
|
+
|
5
|
+
if File.exist? "bin/rails"
|
6
|
+
# Remove server.pid if it exists
|
7
|
+
FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
|
8
|
+
|
9
|
+
puts "-----> Performing bundle install ... "
|
10
|
+
if system("bundle install")
|
11
|
+
puts "-----> Compiling Assets ... "
|
12
|
+
if system("bundle exec rails assets:precompile")
|
13
|
+
system("foreman start -f Procfile")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
puts "failed."
|
19
|
+
exit 1
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Buildpacker.new
|
@@ -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
|
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
|
14
|
+
CMD ["ruby", "buildpacker.rb"]
|
@@ -285,6 +285,10 @@ module Smartcloud
|
|
285
285
|
|
286
286
|
container_path_with_now_date = "#{container_path}/#{app_version}"
|
287
287
|
|
288
|
+
# Setup Buildpacker
|
289
|
+
buildpacker_path = "#{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb"
|
290
|
+
FileUtils.cp(buildpacker_path, container_path_with_now_date)
|
291
|
+
|
288
292
|
puts "-----> Launching Application ... "
|
289
293
|
|
290
294
|
if File.exist? "#{container_path_with_now_date}/bin/rails"
|
@@ -294,12 +298,12 @@ module Smartcloud
|
|
294
298
|
# Starting Rails App
|
295
299
|
self.start_rails_app(appname, container_path, container_path_with_now_date)
|
296
300
|
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
|
301
|
+
end
|
302
302
|
end
|
303
|
+
|
304
|
+
# This line is important to cancel pre-receive push if finally the app could not be started.
|
305
|
+
# If the app was finally started, then this line should never be executed.
|
306
|
+
exit 1
|
303
307
|
end
|
304
308
|
|
305
309
|
def self.stop_app(appname)
|
@@ -353,6 +357,7 @@ module Smartcloud
|
|
353
357
|
--env-file='#{container_path}/env' \
|
354
358
|
--expose='5000' \
|
355
359
|
--volume='#{container_path_with_now_date}:/code' \
|
360
|
+
--workdir='/code' \
|
356
361
|
--restart='always' \
|
357
362
|
--network='nginx-network' \
|
358
363
|
smartcloud/buildpacks/rails", out: File::NULL)
|
@@ -364,7 +369,6 @@ module Smartcloud
|
|
364
369
|
print "-----> Starting container #{appname} ... "
|
365
370
|
if system("docker start #{appname}", out: File::NULL)
|
366
371
|
puts "done"
|
367
|
-
system("docker logs #{appname} --follow")
|
368
372
|
exit 0
|
369
373
|
end
|
370
374
|
end
|
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.
|
4
|
+
version: 0.0.63
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timeboard
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/smartcloud/grids/grid-nginx/fastcgi.conf
|
32
32
|
- lib/smartcloud/grids/grid-nginx/nginx.tmpl
|
33
33
|
- lib/smartcloud/grids/grid-runner/Dockerfile
|
34
|
+
- lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb
|
34
35
|
- lib/smartcloud/grids/grid-runner/buildpacks/rails/Dockerfile
|
35
36
|
- lib/smartcloud/grids/grid-solr/docker-entrypoint-initdb.d/.keep
|
36
37
|
- lib/smartcloud/grids/grid-solr/sunspot/conf/schema.xml
|