mirror of
https://github.com/darksaid98/yolks.git
synced 2026-12-04 06:29:00 +00:00
fix(games): add more logging to fivem
This commit is contained in:
1 file changed
+13
-8
@@ -5,8 +5,9 @@ cd /home/container
|
|||||||
if [ "${GIT_ENABLED}" == "true" ] || [ "${GIT_ENABLED}" == "1" ]; then
|
if [ "${GIT_ENABLED}" == "true" ] || [ "${GIT_ENABLED}" == "1" ]; then
|
||||||
|
|
||||||
# Pre git stuff
|
# Pre git stuff
|
||||||
echo "Wait, preparing to pull or clone from Git.";
|
echo "Wait, preparing to pull or clone from git.";
|
||||||
|
|
||||||
|
mkdir -p /home/container/resources
|
||||||
cd /home/container/resources
|
cd /home/container/resources
|
||||||
|
|
||||||
# Git stuff
|
# Git stuff
|
||||||
@@ -15,13 +16,15 @@ if [ "${GIT_ENABLED}" == "true" ] || [ "${GIT_ENABLED}" == "1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${GIT_USERNAME}" ] && [ -z "${GIT_TOKEN}" ]; then # Check for git username & token
|
if [ -z "${GIT_USERNAME}" ] && [ -z "${GIT_TOKEN}" ]; then # Check for git username & token
|
||||||
echo -e "Git Username or Git Token was not specified."
|
echo -e "git Username or git Token was not specified."
|
||||||
else
|
else
|
||||||
GIT_REPOURL="https://${GIT_USERNAME}:${GIT_TOKEN}@$(echo -e ${GIT_REPOURL} | cut -d/ -f3-)"
|
GIT_REPOURL="https://${GIT_USERNAME}:${GIT_TOKEN}@$(echo -e ${GIT_REPOURL} | cut -d/ -f3-)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(ls -A /home/container/resources)" ]; then # Files exist in resources folder, pull
|
if [ "$(ls -A /home/container/resources)" ]; then # Files exist in resources folder, pull
|
||||||
# Get git origin from /home/container/resources/.git/config
|
echo "Files exist in /home/container/resources/. Attempting to pull from git repository."
|
||||||
|
|
||||||
|
# Get git origin from /home/container/resources/.git/config
|
||||||
if [ -d .git ]; then
|
if [ -d .git ]; then
|
||||||
if [ -f .git/config ]; then
|
if [ -f .git/config ]; then
|
||||||
GIT_ORIGIN=$(git config --get remote.origin.url)
|
GIT_ORIGIN=$(git config --get remote.origin.url)
|
||||||
@@ -30,16 +33,18 @@ if [ "${GIT_ENABLED}" == "true" ] || [ "${GIT_ENABLED}" == "1" ]; then
|
|||||||
|
|
||||||
# If git origin matches the repo specified by user then pull
|
# If git origin matches the repo specified by user then pull
|
||||||
if [ "${GIT_ORIGIN}" == "${GIT_REPOURL}" ]; then #
|
if [ "${GIT_ORIGIN}" == "${GIT_REPOURL}" ]; then #
|
||||||
git pull && echo "Finished pulling /resources/* from Git." || echo "Failed pulling /resources/* from Git."
|
git pull && echo "Finished pulling /home/container/resources/ from git." || echo "Failed pulling /home/container/resources/ from git."
|
||||||
|
else
|
||||||
|
echo -e "git repository in /home/container/resources/ does not match user provided configuration. Failed pulling /home/container/resources/ from git."
|
||||||
fi
|
fi
|
||||||
else # No files exist in resources folder, clone
|
else # No files exist in resources folder, clone
|
||||||
echo -e "Resources directory is empty."
|
echo -e "Resources directory is empty. Attempting to clone git repository."
|
||||||
if [ -z ${GIT_BRANCH} ]; then
|
if [ -z ${GIT_BRANCH} ]; then
|
||||||
echo -e "Cloning default branch into /resources/*."
|
echo -e "Cloning default branch into /home/container/resources/."
|
||||||
git clone ${GIT_REPOURL} .
|
git clone ${GIT_REPOURL} .
|
||||||
else
|
else
|
||||||
echo -e "Cloning ${GIT_BRANCH} branch into /resources/*."
|
echo -e "Cloning ${GIT_BRANCH} branch into /home/container/resources/."
|
||||||
git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOURL} . && echo "Finished cloning into /resources/* from Git." || echo "Failed cloning into /resources/* from Git."
|
git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOURL} . && echo "Finished cloning into /home/container/resources/ from git." || echo "Failed cloning into /home/container/resources/ from git."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user