forked from tarantool/tt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util: check for instances file in app dir
It is possible to have an application without init.lua script. Script names can be specified using instances file. So if the directory contains instances file, it must be treated as a multi-instance application.
- Loading branch information
Showing
9 changed files
with
139 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
test/integration/running/multi_inst_app_no_init/instances.enabled/mi_app/instances.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
router: | ||
|
||
storage: | ||
|
12 changes: 12 additions & 0 deletions
12
test/integration/running/multi_inst_app_no_init/instances.enabled/mi_app/router.init.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
local inst_name = os.getenv('TARANTOOL_INSTANCE_NAME') | ||
local app_name = os.getenv('TARANTOOL_APP_NAME') | ||
|
||
while true do | ||
print("custom init file...") | ||
if app_name ~= nil and inst_name ~= nil then | ||
print(app_name .. ":" .. inst_name) | ||
else | ||
print("unknown instance") | ||
end | ||
require("fiber").sleep(1) | ||
end |
11 changes: 11 additions & 0 deletions
11
test/integration/running/multi_inst_app_no_init/instances.enabled/mi_app/storage.init.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
local inst_name = os.getenv('TARANTOOL_INSTANCE_NAME') | ||
local app_name = os.getenv('TARANTOOL_APP_NAME') | ||
|
||
while true do | ||
if app_name ~= nil and inst_name ~= nil then | ||
print(app_name .. ":" .. inst_name) | ||
else | ||
print("unknown instance") | ||
end | ||
require("fiber").sleep(1) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tt: | ||
app: | ||
instances_enabled: instances.enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters