update environment

This commit is contained in:
Joseph Le 2023-09-25 23:01:52 +10:00
parent c466b7fdb2
commit 7b929f90e5
4 changed files with 14 additions and 4 deletions

View File

@ -8,4 +8,8 @@ Restart=always
WorkingDirectory=/home/gitea_CICD/service
User=root
Group=root
Restart=on-failure
EnvironmentFile=/home/gitea_CICD/service/giteaService
[Install]
WantedBy=multi-user.target

View File

@ -22,12 +22,12 @@ result=$(expect -c '
spawn git pull
expect {
"Username for *" {
send "joseph.le@apactech.io\n"
send "$GIT_USERNAME\n"
exp_continue
}
"Password for *" {
sleep 2
send "Maypjtkh0ng\r\r"
send "$GIT_PASSWORD\r\r"
exp_continue
}
eof
@ -55,7 +55,7 @@ if [[ $result == *$fe_path* ]]; then
echo "|-------------|"
npm run build &&
cp -rf $project/$fe_path/build/* /var/www/html
cp -rf $project/$fe_path/build/* $FE_ROOT_FOLDER
fi
echo "|----------------------|"

View File

@ -6,7 +6,13 @@ HOOK_PATH=/home/gitea_CICD
#Duong dan cac thu muc trong project chinh
#Co the khai bao nhieu bien hon de cau hinh giteaHook.sh
GIT_USERNAME=joseph.le@apactech.io
GIT_PASSWORD=Maypjtkh0ng
#
PROJECT_PATH=/home/Log_service
FE_PROJECT_PATH=manage-view/
BE_PROJECT_PATH=/home/Log_service
#
FE_ROOT_FOLDER=/var/www/html

View File

@ -29,5 +29,5 @@ if [ -f "$indexjs_path" ]; then
cd "$project_path" &&
node "$indexjs_path"
else
echo "Tệp $indexjs_path không tn tại."
echo "Tệp $indexjs_path không ton tại."
fi