update env source
This commit is contained in:
parent
971929ac29
commit
82d6753b3c
|
|
@ -12,17 +12,7 @@ REPOSITORY_AUTH="https://$USERNAME:$PASSWORD@$(echo $GIT_REPOSITORY | sed 's#htt
|
||||||
cd "$PROJECT_PATH" &&
|
cd "$PROJECT_PATH" &&
|
||||||
git config --global --add safe.directory $PROJECT_PATH &&
|
git config --global --add safe.directory $PROJECT_PATH &&
|
||||||
SET_ORIGIN=$(git remote set-url origin $REPOSITORY_AUTH) &&
|
SET_ORIGIN=$(git remote set-url origin $REPOSITORY_AUTH) &&
|
||||||
|
|
||||||
if git ls-remote -q --exit-code "$REPOSITORY_AUTH" > /dev/null; then
|
|
||||||
echo -e "\e[32mOK: Repository $GIT_REPOSITORY exists\e[0m"
|
|
||||||
sleep 1
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
echo -e "\e[41mError: Repository $GIT_REPOSITORY not exists.\e[0m"
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Kiểm tra xem Node.js đã cài đặt chưa
|
# Kiểm tra xem Node.js đã cài đặt chưa
|
||||||
if ! command -v node &> /dev/null; then
|
if ! command -v node &> /dev/null; then
|
||||||
echo -e "\e[31mNode.js is not installed.\e[0m"
|
echo -e "\e[31mNode.js is not installed.\e[0m"
|
||||||
|
|
@ -44,6 +34,16 @@ else
|
||||||
npm -v
|
npm -v
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if git ls-remote -q --exit-code "$REPOSITORY_AUTH" > /dev/null; then
|
||||||
|
echo -e "\e[32mOK: Repository $GIT_REPOSITORY exists\e[0m"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[41mError: Repository $GIT_REPOSITORY not exists.\e[0m"
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Kiểm tra xem tệp index.js có tồn tại không
|
# Kiểm tra xem tệp index.js có tồn tại không
|
||||||
if [ -f "$indexjs_path" ]; then
|
if [ -f "$indexjs_path" ]; then
|
||||||
echo "Run file $indexjs_path..."
|
echo "Run file $indexjs_path..."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue