提交 24095d85 authored 作者: 陈欢's avatar 陈欢

更新 start.sh

上级 134ccf76
......@@ -34,51 +34,51 @@ if [ ! -z "$OPcache" ]; then
sed -i 's#zend_extension=opcache#;zend_extension=opcache#g' /usr/local/etc/php/php.ini
fi
# Setup git variables
if [ ! -z "$GIT_EMAIL" ]; then
git config --global user.email "$GIT_EMAIL"
fi
if [ ! -z "$GIT_NAME" ]; then
git config --global user.name "$GIT_NAME"
git config --global push.default simple
fi
# Dont pull code down if the .git folder exists
if [ ! -d "/var/www/html/.git" ]; then
# Pull down code from git for our site!
if [ ! -z "$GIT_REPO" ]; then
# Remove the test index file if you are pulling in a git repo
if [ ! -z ${REMOVE_FILES} ] && [ ${REMOVE_FILES} == 0 ]; then
echo "skiping removal of files"
else
rm -Rf /var/www/html/*
fi
GIT_COMMAND='git clone '
if [ ! -z "$GIT_BRANCH" ]; then
GIT_COMMAND=${GIT_COMMAND}" -b ${GIT_BRANCH}"
fi
# # Setup git variables
# if [ ! -z "$GIT_EMAIL" ]; then
# git config --global user.email "$GIT_EMAIL"
# fi
# if [ ! -z "$GIT_NAME" ]; then
# git config --global user.name "$GIT_NAME"
# git config --global push.default simple
# fi
if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then
GIT_COMMAND=${GIT_COMMAND}" ${GIT_REPO}"
else
if [[ "$GIT_USE_SSH" == "1" ]]; then
GIT_COMMAND=${GIT_COMMAND}" ${GIT_REPO}"
else
GIT_COMMAND=${GIT_COMMAND}" https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO}"
fi
fi
${GIT_COMMAND} /var/www/html || exit 1
if [ ! -z "$GIT_TAG" ]; then
git checkout ${GIT_TAG} || exit 1
fi
if [ ! -z "$GIT_COMMIT" ]; then
git checkout ${GIT_COMMIT} || exit 1
fi
if [ -z "$SKIP_CHOWN" ]; then
chown -Rf nginx.nginx /var/www/html
fi
fi
fi
# # Dont pull code down if the .git folder exists
# if [ ! -d "/var/www/html/.git" ]; then
# # Pull down code from git for our site!
# if [ ! -z "$GIT_REPO" ]; then
# # Remove the test index file if you are pulling in a git repo
# if [ ! -z ${REMOVE_FILES} ] && [ ${REMOVE_FILES} == 0 ]; then
# echo "skiping removal of files"
# else
# rm -Rf /var/www/html/*
# fi
# GIT_COMMAND='git clone '
# if [ ! -z "$GIT_BRANCH" ]; then
# GIT_COMMAND=${GIT_COMMAND}" -b ${GIT_BRANCH}"
# fi
# if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then
# GIT_COMMAND=${GIT_COMMAND}" ${GIT_REPO}"
# else
# if [[ "$GIT_USE_SSH" == "1" ]]; then
# GIT_COMMAND=${GIT_COMMAND}" ${GIT_REPO}"
# else
# GIT_COMMAND=${GIT_COMMAND}" https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO}"
# fi
# fi
# ${GIT_COMMAND} /var/www/html || exit 1
# if [ ! -z "$GIT_TAG" ]; then
# git checkout ${GIT_TAG} || exit 1
# fi
# if [ ! -z "$GIT_COMMIT" ]; then
# git checkout ${GIT_COMMIT} || exit 1
# fi
# if [ -z "$SKIP_CHOWN" ]; then
# chown -Rf nginx.nginx /var/www/html
# fi
# fi
# fi
# Enable custom nginx config files if they exist
if [ -f /var/www/html/conf/nginx/nginx.conf ]; then
......@@ -157,38 +157,38 @@ if [ ! -z "$PHP_UPLOAD_MAX_FILESIZE" ]; then
sed -i "s/upload_max_filesize = 100M/upload_max_filesize= ${PHP_UPLOAD_MAX_FILESIZE}M/g" /usr/local/etc/php/conf.d/docker-vars.ini
fi
# Enable xdebug
XdebugFile='/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini'
if [[ "$ENABLE_XDEBUG" == "1" ]] ; then
if [ -f $XdebugFile ]; then
echo "Xdebug enabled"
else
echo "Enabling xdebug"
echo "If you get this error, you can safely ignore it: /usr/local/bin/docker-php-ext-enable: line 83: nm: not found"
# see https://github.com/docker-library/php/pull/420
docker-php-ext-enable xdebug
# see if file exists
if [ -f $XdebugFile ]; then
# See if file contains xdebug text.
if grep -q xdebug.remote_enable "$XdebugFile"; then
echo "Xdebug already enabled... skipping"
else
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > $XdebugFile # Note, single arrow to overwrite file.
echo "xdebug.remote_enable=1 " >> $XdebugFile
echo "xdebug.remote_host=host.docker.internal" >> $XdebugFile
echo "xdebug.remote_log=/tmp/xdebug.log" >> $XdebugFile
echo "xdebug.remote_autostart=false " >> $XdebugFile # I use the xdebug chrome extension instead of using autostart
# NOTE: xdebug.remote_host is not needed here if you set an environment variable in docker-compose like so `- XDEBUG_CONFIG=remote_host=192.168.111.27`.
# you also need to set an env var `- PHP_IDE_CONFIG=serverName=docker`
fi
fi
fi
else
if [ -f $XdebugFile ]; then
echo "Disabling Xdebug"
rm $XdebugFile
fi
fi
# # Enable xdebug
# XdebugFile='/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini'
# if [[ "$ENABLE_XDEBUG" == "1" ]] ; then
# if [ -f $XdebugFile ]; then
# echo "Xdebug enabled"
# else
# echo "Enabling xdebug"
# echo "If you get this error, you can safely ignore it: /usr/local/bin/docker-php-ext-enable: line 83: nm: not found"
# # see https://github.com/docker-library/php/pull/420
# docker-php-ext-enable xdebug
# # see if file exists
# if [ -f $XdebugFile ]; then
# # See if file contains xdebug text.
# if grep -q xdebug.remote_enable "$XdebugFile"; then
# echo "Xdebug already enabled... skipping"
# else
# echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > $XdebugFile # Note, single arrow to overwrite file.
# echo "xdebug.remote_enable=1 " >> $XdebugFile
# echo "xdebug.remote_host=host.docker.internal" >> $XdebugFile
# echo "xdebug.remote_log=/tmp/xdebug.log" >> $XdebugFile
# echo "xdebug.remote_autostart=false " >> $XdebugFile # I use the xdebug chrome extension instead of using autostart
# # NOTE: xdebug.remote_host is not needed here if you set an environment variable in docker-compose like so `- XDEBUG_CONFIG=remote_host=192.168.111.27`.
# # you also need to set an env var `- PHP_IDE_CONFIG=serverName=docker`
# fi
# fi
# fi
# else
# if [ -f $XdebugFile ]; then
# echo "Disabling Xdebug"
# rm $XdebugFile
# fi
# fi
if [ ! -z "$PUID" ]; then
if [ -z "$PGID" ]; then
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论