update source variables
This commit is contained in:
parent
7d3f9b28d9
commit
8d732a72e9
|
|
@ -38,11 +38,11 @@ if [ -d "/etc/systemd/system" ]; then
|
|||
sudo sed -i "s#NPM_BIN=.*#NPM_BIN=$NPM_BIN#" $pwd_install/service_run/giteaService.conf &&
|
||||
echo -e "* \e[32mNPM_BIN\e[0m *" &&
|
||||
|
||||
sudo sed -i "s#source .*#source $escaped_pwd_install/service_run/giteaService.conf#" $pwd_install/service_run/giteaHook.sh &&
|
||||
sudo sed -i "s#source=.*#source=$escaped_pwd_install/service_run/giteaService.conf#" $pwd_install/service_run/giteaHook.sh &&
|
||||
echo -e "* \e[32mEXEC_FILE\e[0m *" &&
|
||||
echo ""
|
||||
|
||||
sudo sed -i "s#source .*#source $escaped_pwd_install/service_run/giteaService.conf#" $pwd_install/service_run/giteaService.sh &&
|
||||
sudo sed -i "s#source=.*#source=$escaped_pwd_install/service_run/giteaService.conf#" $pwd_install/service_run/giteaService.sh &&
|
||||
|
||||
systemctl stop giteaHook.service
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
#File chua bien moi truong
|
||||
source /home/joseph/tr2/gitea_CICD/service_run/giteaService.conf
|
||||
source=/home/joseph/tr2/gitea_CICD/service_run/giteaService.conf
|
||||
|
||||
while read -r line; do
|
||||
[[ -z "$line" || "$line" =~ ^# ]] && continue
|
||||
if [[ "$line" =~ ^[A-Za-z_][A-Za-z0-9_]*= ]]; then
|
||||
varname="${line%%=*}"
|
||||
varvalue="${line#*=}"
|
||||
export "$varname=$varvalue"
|
||||
fi
|
||||
done < $source
|
||||
|
||||
check="false"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,17 @@
|
|||
#!/bin/bash
|
||||
set -e # Dừng script nếu có lỗi
|
||||
|
||||
source /home/phuc/gitea_CICD/service_run/giteaService.conf
|
||||
source=/home/joseph/tr2/gitea_CICD/service_run/giteaService.conf
|
||||
|
||||
while read -r line; do
|
||||
[[ -z "$line" || "$line" =~ ^# ]] && continue
|
||||
if [[ "$line" =~ ^[A-Za-z_][A-Za-z0-9_]*= ]]; then
|
||||
varname="${line%%=*}"
|
||||
varvalue="${line#*=}"
|
||||
export "$varname=$varvalue"
|
||||
fi
|
||||
done < $source
|
||||
|
||||
export HOME=$PROJECT_PATH
|
||||
|
||||
indexjs_path="$HOOK_PATH/index.js"
|
||||
|
|
|
|||
Loading…
Reference in New Issue