soaring 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soaring/initializer.rb +8 -5
- data/lib/soaring/packager.rb +11 -9
- data/lib/soaring/runner.rb +8 -6
- data/lib/soaring/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f08168c3868aa4efb089ce195a7fc9c409e1728
|
4
|
+
data.tar.gz: 7ce5dc40d3f040f0a030bf7e48f77ae9df957152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e13384d5238fa3422689086eca042562b8642bbb31c3d4bb3fce38c2ca167921b4a9c26affdb4a3a16bd525c690173c7ee9637e3a3778488d271ce5f899fff4
|
7
|
+
data.tar.gz: 7d8f3af9d9dafe286b9081aeb7fab4fb7dcacc93f2d1c1f8afafc19177c9c534f0fc14458dfa3449b830d92a47e0b08c63fb3d273aa4849da8a7a1c8cf98633b
|
data/lib/soaring/initializer.rb
CHANGED
@@ -5,6 +5,13 @@ module Soaring
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def initialize_project
|
8
|
+
Dir.chdir(@options[:project_root]) do
|
9
|
+
get_soar_sc_template
|
10
|
+
create_symlink_to_public_folder
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_soar_sc_template
|
8
15
|
Dir.mktmpdir { |dir|
|
9
16
|
temporary_folder = dir
|
10
17
|
temporary_soar_sc_folder = "#{temporary_folder}/soar_sc"
|
@@ -22,14 +29,10 @@ module Soaring
|
|
22
29
|
`yes | cp -rf #{temporary_soar_sc_folder}/.ebextensions #{@options[:project_root]}`
|
23
30
|
`yes | cp -rf #{temporary_soar_sc_folder}/jewels #{@options[:project_root]}`
|
24
31
|
}
|
25
|
-
|
26
|
-
create_symlink_to_public_folder
|
27
32
|
end
|
28
33
|
|
29
34
|
def create_symlink_to_public_folder
|
30
|
-
|
31
|
-
`ln -s lib/web/public public`
|
32
|
-
end
|
35
|
+
File.symlink("lib/web/public", "public") if not File.symlink?("public")
|
33
36
|
end
|
34
37
|
end
|
35
38
|
end
|
data/lib/soaring/packager.rb
CHANGED
@@ -5,12 +5,14 @@ module Soaring
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def package
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
Dir.chdir(@options[:project_root]) do
|
9
|
+
validate_project if not @options[:ignore_git_checks]
|
10
|
+
build_output_location = generate_build_output_location(@options[:project_root])
|
11
|
+
update_project_commit_hash
|
12
|
+
`mkdir -p #{@options[:project_root]}/build`
|
13
|
+
`zip -r #{build_output_location} * .ebextensions --exclude=build/* --exclude=config/environment.yml`
|
14
|
+
puts "Build packaged at #{build_output_location}"
|
15
|
+
end
|
14
16
|
end
|
15
17
|
|
16
18
|
private
|
@@ -30,7 +32,7 @@ module Soaring
|
|
30
32
|
end
|
31
33
|
|
32
34
|
def update_project_commit_hash
|
33
|
-
response, exit_status = Executor::execute("
|
35
|
+
response, exit_status = Executor::execute("git rev-parse HEAD > commit-hash")
|
34
36
|
if not exit_status.success?
|
35
37
|
puts 'Failed to package, unable to get commit hash from local git repository'
|
36
38
|
exit 1
|
@@ -38,13 +40,13 @@ module Soaring
|
|
38
40
|
end
|
39
41
|
|
40
42
|
def is_git_repo_up_to_date?
|
41
|
-
response, exit_status = Executor::execute("
|
43
|
+
response, exit_status = Executor::execute("git status --porcelain")
|
42
44
|
return true if ('' == response) and (exit_status.success?)
|
43
45
|
false
|
44
46
|
end
|
45
47
|
|
46
48
|
def get_short_commit_hash
|
47
|
-
response, exit_status = Executor::execute("
|
49
|
+
response, exit_status = Executor::execute("git rev-parse --short HEAD")
|
48
50
|
if not exit_status.success?
|
49
51
|
puts 'Failed to package, unable to get short commit hash from local git repository'
|
50
52
|
exit 1
|
data/lib/soaring/runner.rb
CHANGED
@@ -5,10 +5,12 @@ module Soaring
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def run
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
Dir.chdir(@options[:project_root]) do
|
9
|
+
if @options[:autorestart]
|
10
|
+
run_repeatedly
|
11
|
+
else
|
12
|
+
run_once
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
@@ -17,14 +19,14 @@ module Soaring
|
|
17
19
|
def run_repeatedly
|
18
20
|
while true do
|
19
21
|
$stderr.puts "starting rackup repeatedly with parameters #{compile_rackup_parameters}" if @options[:verbose]
|
20
|
-
response, exit_status = Executor::execute("
|
22
|
+
response, exit_status = Executor::execute("bundle exec rackup #{compile_rackup_parameters}")
|
21
23
|
sleep(0.5)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
27
|
def run_once
|
26
28
|
$stderr.puts "starting rackup once with parameters #{compile_rackup_parameters}" if @options[:verbose]
|
27
|
-
exec("
|
29
|
+
exec("bundle exec rackup #{compile_rackup_parameters}")
|
28
30
|
end
|
29
31
|
|
30
32
|
def compile_rackup_parameters
|
data/lib/soaring/version.rb
CHANGED