增加环境变量DEV,默认为master稳定分支,设置为dev则为开发分支

This commit is contained in:
ngfchl
2022-10-04 15:45:33 +08:00
parent 458ba7ea4d
commit f75463fbd8
2 changed files with 6 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ ENV DJANGO_SUPERUSER_USERNAME=admin
ENV DJANGO_SUPERUSER_EMAIL=admin@eamil.com
ENV DJANGO_SUPERUSER_PASSWORD=adminadmin
ENV DJANGO_WEB_PORT=8000
ENV DEV=master
COPY pip.conf /root/.pip/pip.conf

View File

@@ -12,7 +12,7 @@ if [ ! -e $CONTAINER_ALREADY_STARTED ]; then
git remote add origin https://gitee.com/ngfchl/ptools &&
# 设置拉取最新文件并覆盖
git config pull.ff only &&
git pull origin master
git pull origin $DEV &&
ls -l && pwd
# git branch --set-upstream-to=origin/master master &&
pip install -r requirements.txt
@@ -28,9 +28,11 @@ if [ ! -e $CONTAINER_ALREADY_STARTED ]; then
python manage.py createsuperuser --noinput
else
echo "-- Not first container startup --"
fi
if [ $DEV == 'dev']; then
echo '您当前处于开发者测试版本,请注意备份数据'
pip install -r requirements.txt &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:$DJANGO_WEB_PORT --noreload
python manage.py runserver 0.0.0.0:$DJANGO_WEB_PORT