fanforce-app-factory 2.0.0.rc11 → 2.0.0.rc12
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8a880676aa8a792835bac8e5b9c97e435b765ca
|
4
|
+
data.tar.gz: c5ac34edeff20804b81b568e9bca7be08ed5c265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa56a66d1e81d33a0794f58ab92ad75074ebbe4466daaaa55c74ded3b8f6b1d26429b339223c6648585e79b061b3e7ee1b739f4d96618dcbb723b60ecdf54a9
|
7
|
+
data.tar.gz: be47bf5322d31854d63d1c1f0a7995c3bd4524f8c23b0cf705707f1f5bd71b0c3da0b49b6135de27aae85c474cb5377f14e296842a8579772ca59faf207c6133
|
@@ -9,7 +9,7 @@ class Fanforce::AppFactory::CLI::Iron
|
|
9
9
|
@app = app
|
10
10
|
end
|
11
11
|
|
12
|
-
def upload(environment)
|
12
|
+
def upload(environment, worker_filename=nil)
|
13
13
|
if !File.directory?("#{app.dir}/workers")
|
14
14
|
return log "#{'Skipped '.format(:bold)} no workers folder was found"
|
15
15
|
end
|
@@ -30,6 +30,7 @@ class Fanforce::AppFactory::CLI::Iron
|
|
30
30
|
upload_processes = []
|
31
31
|
FileUtils.cp("#{app.dir}/workers/.env/#{environment}.rb", "#{app.dir}/workers/.env/.#{environment}env.rb")
|
32
32
|
workers.each do |filename|
|
33
|
+
next if worker_filename and !filename.include?(worker_filename)
|
33
34
|
code_name = filename.gsub('.worker', '')
|
34
35
|
|
35
36
|
puts "#{'Uploading'.format(:green,:bold)} #{filename.gsub('.worker', '')} to #{environment.to_s.titleize}..."
|
@@ -15,7 +15,7 @@ class Fanforce::AppFactory::CLI::Scripts
|
|
15
15
|
confirm("\nYou are about to push iron works for #{Fanforce::CLI::Apps.total_count} apps in this directory.\n"+
|
16
16
|
'ARE YOU SURE?', true)
|
17
17
|
Fanforce::CLI::Apps.each do |app, processed_count, total_count|
|
18
|
-
log divider '
|
18
|
+
log divider '+-----------------------------------------------------------------------------------------------'
|
19
19
|
log "#{'APP'.format(:bold)} - #{app._id.upcase.gsub('-',' ').format(:bold)} (#{processed_count} of #{total_count})... "
|
20
20
|
push_app_workers(app, environment)
|
21
21
|
end
|
@@ -24,11 +24,21 @@ class Fanforce::AppFactory::CLI::Scripts
|
|
24
24
|
app = Fanforce::CLI::App.load(Fanforce::CLI::DIR)
|
25
25
|
push_app_workers(app, environment)
|
26
26
|
end
|
27
|
+
elsif command.to_s.include?('.worker')
|
28
|
+
log divider '+---------------------------------------------------------------------------------------------------'
|
29
|
+
app = Fanforce::CLI::App.load(Fanforce::CLI::DIR)
|
30
|
+
push_app_worker(app, environment, command.to_s)
|
27
31
|
end
|
28
32
|
|
29
33
|
log divider '----------------------------------------------------------------------------------------------------++'
|
30
34
|
end
|
31
35
|
|
36
|
+
def push_app_worker(app, environment, filename)
|
37
|
+
Dir.chdir(app.dir) do
|
38
|
+
Fanforce::AppFactory::CLI::Iron.new(app).upload(environment, filename)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
32
42
|
def push_app_workers(app, environment)
|
33
43
|
Dir.chdir(app.dir) do
|
34
44
|
Fanforce::AppFactory::CLI::Iron.new(app).upload(environment)
|
@@ -33,10 +33,11 @@ class Fanforce::AppFactory::CLI::Scripts
|
|
33
33
|
########################################################################################################################
|
34
34
|
|
35
35
|
Fanforce::CLI.register(self, :push,
|
36
|
-
['RACK_ENV all/TYPE',
|
37
|
-
# ['RACK_ENV env',
|
38
|
-
# ['RACK_ENV heroku',
|
39
|
-
['RACK_ENV iron',
|
36
|
+
['RACK_ENV all/TYPE', 'Push everything to the selected environment'],
|
37
|
+
# ['RACK_ENV env', 'Setup the correct ENV variables in selected environment'],
|
38
|
+
# ['RACK_ENV heroku', 'Create heroku app (if needed) and push latest commit'],
|
39
|
+
['RACK_ENV iron', 'Upload iron workers to selected environment'],
|
40
|
+
['RACK_ENV FILENAME.worker', 'Upload single iron worker to selected environment']
|
40
41
|
) { require_relative 'cli/scripts/push' }
|
41
42
|
|
42
43
|
########################################################################################################################
|