更新 entrypoint.sh
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
mol
2024-02-24 02:43:32 +00:00
parent be74918615
commit 36894f4dc2

View File

@ -2,14 +2,14 @@
if [ -n "$ROOT_PASSWD" ]; then if [ -n "$ROOT_PASSWD" ]; then
echo "root:${ROOT_PASSWD}" | chpasswd echo "root:${ROOT_PASSWD}" | chpasswd
echo "密码设置完毕" >> /app/info.log echo "密码设置完毕" >> /home/coder/info.log
fi fi
if [ -e "/root/.gitconfig" ]; then if [ -e "/root/.gitconfig" ]; then
echo "git配置文件已存在" >> /app/info.log echo "git配置文件已存在" >> /home/coder/info.log
else else
touch /root/.gitconfig touch /root/.gitconfig
echo "git配置文件已创建" >> /app/info.log echo "git配置文件已创建" >> /home/coder/info.log
fi fi
# git使用openssh的shh程序 # git使用openssh的shh程序
@ -18,18 +18,18 @@ git config --global core.sshCommand "/usr/bin/ssh"
if [ -n "$GIT_USER" ] && [ -n "$GIT_EMAIL" ]; then if [ -n "$GIT_USER" ] && [ -n "$GIT_EMAIL" ]; then
git config --global user.name "$GIT_USER" git config --global user.name "$GIT_USER"
git config --global user.email "$GIT_EMAIL" git config --global user.email "$GIT_EMAIL"
echo "git 用户已设置完毕" >> /app/info.log echo "git 用户已设置完毕" >> /home/coder/info.log
fi fi
if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_PASSWD" ]; then if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_PASSWD" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWD" docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWD"
echo "docker 用户登录完成" >> /app/info.log echo "docker 用户登录完成" >> /home/coder/info.log
fi fi
service ssh start >> /app/info.log service ssh start >> /home/coder/info.log
ssh-agent bash >> /app/info.log ssh-agent bash >> /home/coder/info.log
cat /app/info.log cat /home/coder/info.log
set -eu set -eu