fix: move check and migrate to prepare.js for diff/cli builds. (#4398)
This commit is contained in:
parent
4bcf896fef
commit
7ea3e18705
|
@ -700,10 +700,6 @@ async function main () {
|
|||
task: async (subctx, subtask) => {
|
||||
await executeCommand(subtask, containers.appSource, ['bash', '-c', 'chmod +x ./dev/diff/prepare.sh'])
|
||||
await executeCommand(subtask, containers.appSource, ['bash', './dev/diff/prepare.sh'])
|
||||
subtask.title = `Preparing source Datatracker instance - Running checks...`
|
||||
await executeCommand(subtask, containers.appSource, ['bash', '-c', './ietf/manage.py check'])
|
||||
subtask.title = `Preparing source Datatracker instance - Applying migrations...`
|
||||
await executeCommand(subtask, containers.appSource, ['bash', '-c', './ietf/manage.py migrate'])
|
||||
subtask.title = `Source Datatracker instance is now ready.`
|
||||
}
|
||||
},
|
||||
|
@ -712,10 +708,6 @@ async function main () {
|
|||
task: async (subctx, subtask) => {
|
||||
await executeCommand(subtask, containers.appTarget, ['bash', '-c', 'chmod +x ./dev/diff/prepare.sh'])
|
||||
await executeCommand(subtask, containers.appTarget, ['bash', './dev/diff/prepare.sh'])
|
||||
subtask.title = `Run target Datatracker instance - Running checks...`
|
||||
await executeCommand(subtask, containers.appTarget, ['bash', '-c', './ietf/manage.py check'])
|
||||
subtask.title = `Run target Datatracker instance - Applying migrations...`
|
||||
await executeCommand(subtask, containers.appTarget, ['bash', '-c', './ietf/manage.py migrate'])
|
||||
subtask.title = `Run target Datatracker instance - Starting server...`
|
||||
executeCommand(subtask, containers.appTarget, ['bash', '-c', './ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local'])
|
||||
subtask.title = `Run target Datatracker instance - Waiting for server to accept connections...`
|
||||
|
|
|
@ -12,3 +12,24 @@ yarn legacy:build
|
|||
echo "Creating data directories..."
|
||||
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
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue