diff --git a/.gitignore b/.gitignore index 0a5c6eb..128c89e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,4 @@ luac.out .DS_Store # IDEA dir -.idea/ - -# Local deploy bash script -auto_copy_config_and_lua_macos.sh \ No newline at end of file +.idea/ \ No newline at end of file diff --git a/cp_scripts_alchemy_macos.sh b/cp_scripts_alchemy_macos.sh new file mode 100755 index 0000000..a0a04df --- /dev/null +++ b/cp_scripts_alchemy_macos.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -x + +# Openresty config + +# -- Get openresty config path +openresty_config_file_path=$(openresty -t 2>&1 | tr '\n' '\f' | sed -r 's/.*file[[:space:]](.*)[[:space:]]syntax.*/\1/') +openresty_config_path=${openresty_config_file_path%/*} +openresty_sub_config_dir=$openresty_config_path/conf.d +echo $openresty_sub_config_dir + +# -- Make sub config dir +mkdir -p $openresty_sub_config_dir +# -- Copy sun config file +cp conf/alchemy/*.conf $openresty_sub_config_dir + + +# Lua scripts + +# -- Get openresty install path +openresty_install_path=$(openresty -V 2>&1 | tr '\n' '\f' | sed -r 's/.*--prefix=(.*)[[:space:]]--with-cc.*/\1/') +openresty_lua_scripts_dir=$openresty_install_path/scripts +echo $openresty_lua_scripts_dir + +mkdir -p $openresty_lua_scripts_dir + +cp scripts/*.lua $openresty_lua_scripts_dir + +# Reload openresty +openresty -t +openresty -s reload \ No newline at end of file diff --git a/cp_scripts_local_macos.sh b/cp_scripts_local_macos.sh index fac8755..d289af6 100755 --- a/cp_scripts_local_macos.sh +++ b/cp_scripts_local_macos.sh @@ -1,8 +1,31 @@ #!/bin/sh set -x -openresty_sub_config_dir=/usr/local/etc/openresty/conf.d +# Openresty config +# -- Get openresty config path +openresty_config_file_path=$(openresty -t 2>&1 | tr '\n' '\f' | sed -r 's/.*file[[:space:]](.*)[[:space:]]syntax.*/\1/') +openresty_config_path=${openresty_config_file_path%/*} +openresty_sub_config_dir=$openresty_config_path/conf.d +echo $openresty_sub_config_dir + +# -- Make sub config dir mkdir -p $openresty_sub_config_dir - +# -- Copy sun config file cp conf/local_macos/*.conf $openresty_sub_config_dir + + +# Lua scripts + +# -- Get openresty install path +openresty_install_path=$(openresty -V 2>&1 | tr '\n' '\f' | sed -r 's/.*--prefix=(.*)[[:space:]]--with-cc.*/\1/') +openresty_lua_scripts_dir=$openresty_install_path/scripts +echo $openresty_lua_scripts_dir + +mkdir -p $openresty_lua_scripts_dir + +cp scripts/*.lua $openresty_lua_scripts_dir + +# Reload openresty +openresty -t +openresty -s reload \ No newline at end of file diff --git a/cp_scripts_moicen_macos.sh b/cp_scripts_moicen_macos.sh new file mode 100755 index 0000000..8d42106 --- /dev/null +++ b/cp_scripts_moicen_macos.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -x + +# Openresty config + +# -- Get openresty config path +openresty_config_file_path=$(openresty -t 2>&1 | tr '\n' '\f' | sed -r 's/.*file[[:space:]](.*)[[:space:]]syntax.*/\1/') +openresty_config_path=${openresty_config_file_path%/*} +openresty_sub_config_dir=$openresty_config_path/conf.d +echo $openresty_sub_config_dir + +# -- Make sub config dir +mkdir -p $openresty_sub_config_dir +# -- Copy sun config file +cp conf/moicen/*.conf $openresty_sub_config_dir + + +# Lua scripts + +# -- Get openresty install path +openresty_install_path=$(openresty -V 2>&1 | tr '\n' '\f' | sed -r 's/.*--prefix=(.*)[[:space:]]--with-cc.*/\1/') +openresty_lua_scripts_dir=$openresty_install_path/scripts +echo $openresty_lua_scripts_dir + +mkdir -p $openresty_lua_scripts_dir + +cp scripts/*.lua $openresty_lua_scripts_dir + +# Reload openresty +openresty -t +openresty -s reload \ No newline at end of file