mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
增加环境变量DEV,默认为master稳定分支,设置为dev则为开发分支
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
8
start.sh
8
start.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user