File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,7 +101,27 @@ echo "Starting memcached..."
101101echo " Running initial checks..."
102102/usr/local/bin/python $WORKSPACEDIR /ietf/manage.py check --settings=settings_local
103103
104- /usr/local/bin/python $WORKSPACEDIR /ietf/manage.py migrate --settings=settings_local || (echo " USE_TZ = True" >> $WORKSPACEDIR /ietf/settings_local.py; /usr/local/bin/python $WORKSPACEDIR /ietf/manage.py migrate --settings=settings_local)
104+ # Migrate, adjusting to what the current state of the underlying database might be:
105+
106+ if ietf/manage.py showmigrations | grep " \[ \] 0003_pause_to_change_use_tz" ; then
107+ if grep " USE_TZ" $WORKSPACEDIR /ietf/settings_local.py; then
108+ cat $WORKSPACEDIR /ietf/settings_local.py | sed ' s/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR /ietf/settings_local.py
109+ else
110+ echo " USE_TZ = False" >> $WORKSPACEDIR /ietf/settings_local.py
111+ fi
112+ # This is expected to exit non-zero at the pause
113+ /usr/local/bin/python $WORKSPACEDIR /ietf/manage.py migrate --settings=settings_local || true
114+ cat $WORKSPACEDIR /ietf/settings_local.py | sed ' s/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR /ietf/settings_local.py
115+ /usr/local/bin/python $WORKSPACEDIR /ietf/manage.py migrate --settings=settings_local
116+
117+ else
118+ if grep " USE_TZ" $WORKSPACEDIR /ietf/settings_local.py; then
119+ cat $WORKSPACEDIR /ietf/settings_local.py | sed ' s/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR /ietf/settings_local.py
120+ else
121+ echo " USE_TZ = True" >> $WORKSPACEDIR /ietf/settings_local.py
122+ /usr/local/bin/python $WORKSPACEDIR /ietf/manage.py migrate --settings=settings_local
123+ fi
124+ fi
105125
106126echo " -----------------------------------------------------------------"
107127echo " Done!"
You can’t perform that action at this time.
0 commit comments