Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
img-manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Lan
img-manager
Commits
e1b89d94
Commit
e1b89d94
authored
Mar 11, 2025
by
Ivan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update entrypoint
parent
997e9915
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
docker-entrypoint
bin/docker-entrypoint
+16
-6
No files found.
bin/docker-entrypoint
View file @
e1b89d94
...
...
@@ -93,23 +93,33 @@ else
git config
--global
--add
safe.directory /rails/code
# 清空目录以确保没有隐藏文件干扰
rm
-rf
/rails/code/
*
/rails/code/.[!.]
*
2>/dev/null
||
true
rm
-rf
/rails/code/
*
/rails/code/.[!.]
*
2>/dev/null
||
{
echo
"Error removing files:
$?
"
;
}
# 检查是否安装了 git 命令
if
!
command
-v
git &> /dev/null
;
then
echo
"⚠️ Git command not found. Skipping Git operations."
else
# 检查是否能访问 Git 仓库
if
git ls-remote
--quiet
${
GIT_REPOSITORY
}
&> /dev/null
;
then
if
!
git ls-remote
--quiet
${
GIT_REPOSITORY
}
&> /tmp/git_error
;
then
echo
"⚠️ Cannot access Git repository. Error details:"
cat
/tmp/git_error
echo
"Skipping Git operations."
else
# 尝试克隆仓库
echo
"Cloning repository..."
if
[
-n
"
${
GIT_BRANCH
}
"
]
;
then
git clone
--branch
${
GIT_BRANCH
}
${
GIT_REPOSITORY
}
/rails/code
||
echo
"Git clone failed, but continuing anyway"
else
git clone
${
GIT_REPOSITORY
}
/rails/code
||
echo
"Git clone failed, but continuing anyway"
if
!
git clone
--branch
${
GIT_BRANCH
}
${
GIT_REPOSITORY
}
/rails/code 2> /tmp/git_clone_error
;
then
echo
"Git clone failed with error:"
cat
/tmp/git_clone_error
echo
"Continuing anyway, but deployment may fail."
fi
else
echo
"⚠️ Cannot access Git repository. Skipping Git operations."
if
!
git clone
${
GIT_REPOSITORY
}
/rails/code 2> /tmp/git_clone_error
;
then
echo
"Git clone failed with error:"
cat
/tmp/git_clone_error
echo
"Continuing anyway, but deployment may fail."
fi
fi
fi
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment