You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/07 09:20:52 UTC

[GitHub] [apisix] Yiyiyimu commented on a change in pull request #2101: feature: customed config.yaml when apisix start

Yiyiyimu commented on a change in pull request #2101:
URL: https://github.com/apache/apisix/pull/2101#discussion_r484305423



##########
File path: bin/apisix
##########
@@ -940,6 +940,22 @@ function _M.start(...)
         end
     end
 
+    local argparse = require "argparse"
+    local parser = argparse()
+    parser:argument("_", "Placeholder")
+    parser:option("-c --config", "location of customed config.yaml")
+    local args = parser:parse()
+    local customed_yaml = args["config"]
+
+    local profile = require("apisix.core.profile")
+    profile.apisix_home = apisix_home .. "/"
+    local local_conf_path = profile:yaml_path("config")
+
+    if customed_yaml then
+        local cmd = "cp " .. customed_yaml .. " " .. local_conf_path

Review comment:
       If users start two APISIX instances, should it create two nginx.conf? If it creates one nginx.conf, we need to read nginx.conf to get the first location of config.yaml, but it seems not so common to read from nginx.conf.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org