Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ jobs:
run: |
echo "Running checks..."
./ietf/manage.py check
./ietf/manage.py migrate || true
echo "USE_TZ = True" >> ./ietf/settings_local.py
./ietf/manage.py migrate
echo "Validating migrations..."
if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ jobs:
run: |
echo "Running checks..."
./ietf/manage.py check
echo "Running migrations with USE_TZ=False..."
./ietf/manage.py migrate || true
echo "USE_TZ = True" >> ./ietf/settings_local.py
echo "Running migrations with USE_TZ=True..."
./ietf/manage.py migrate
echo "Validating migrations..."
if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then
Expand Down
24 changes: 2 additions & 22 deletions dev/deploy-to-container/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,9 @@ echo "Running Datatracker checks..."
./ietf/manage.py check

# Migrate, adjusting to what the current state of the underlying database might be:
WORKSPACEDIR=.
if ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
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
else
echo "USE_TZ = False" >> $WORKSPACEDIR/ietf/settings_local.py
fi
echo "Running Datatracker migrations with USE_TZ = False..."
# This is expected to exit non-zero at the pause
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local || true
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
echo "Running Datatracker migrations with USE_TZ = True..."
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local

else
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
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
else
echo "USE_TZ = True" >> $WORKSPACEDIR/ietf/settings_local.py
echo "Running Datatracker migrations..."
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
fi
fi
echo "Running Datatracker migrations..."
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local

echo "Starting Datatracker..."
./ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local
19 changes: 1 addition & 18 deletions dev/diff/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,5 @@ chmod +x ./docker/scripts/app-create-dirs.sh
./docker/scripts/app-create-dirs.sh

./ietf/manage.py check
if ./ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then
if grep "USE_TZ" ./ietf/settings_local.py; then
cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py
else
echo "USE_TZ = False" >> ./ietf/settings_local.py
fi
# This is expected to exit non-zero at the pause
/usr/local/bin/python ./ietf/manage.py migrate || true
cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py
/usr/local/bin/python ./ietf/manage.py migrate
./ietf/manage.py migrate

else
if grep "USE_TZ" ./ietf/settings_local.py; then
cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py
else
echo "USE_TZ = True" >> ./ietf/settings_local.py
/usr/local/bin/python ./ietf/manage.py migrate
fi
fi
19 changes: 1 addition & 18 deletions docker/scripts/app-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,25 +103,8 @@ echo "Running initial checks..."

# Migrate, adjusting to what the current state of the underlying database might be:

if ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
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
else
echo "USE_TZ = False" >> $WORKSPACEDIR/ietf/settings_local.py
fi
# This is expected to exit non-zero at the pause
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local || true
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
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local

else
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
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
else
echo "USE_TZ = True" >> $WORKSPACEDIR/ietf/settings_local.py
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
fi
fi

echo "-----------------------------------------------------------------"
echo "Done!"
Expand Down
2 changes: 1 addition & 1 deletion ietf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
# to load the internationalization machinery.
USE_I18N = False

USE_TZ = False
USE_TZ = True

if SERVER_MODE == 'production':
MEDIA_ROOT = '/a/www/www6s/lib/dt/media/'
Expand Down