Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: poetry run in docker scripts #873

Merged
merged 1 commit into from
Sep 26, 2024
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
6 changes: 3 additions & 3 deletions backend/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ while ! python manage.py showmigrations iam >/dev/null; do
sleep 10
done

python manage.py migrate --settings="${DJANGO_SETTINGS_MODULE}"
python manage.py storelibraries --settings="${DJANGO_SETTINGS_MODULE}"
poetry run python manage.py migrate --settings="${DJANGO_SETTINGS_MODULE}"
poetry run python manage.py storelibraries --settings="${DJANGO_SETTINGS_MODULE}"
if [ -n "$DJANGO_SUPERUSER_EMAIL" ]; then
python manage.py createsuperuser --noinput --settings="${DJANGO_SETTINGS_MODULE}"
poetry run python manage.py createsuperuser --noinput --settings="${DJANGO_SETTINGS_MODULE}"
fi

exec gunicorn --chdir ciso_assistant --bind :8000 --timeout 300 --env RUN_MAIN=true ciso_assistant.wsgi:application
2 changes: 1 addition & 1 deletion docker-compose-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ else
sleep 30
# Initialize the superuser account
echo "Initialize your superuser account..."
docker compose exec backend python manage.py createsuperuser
docker compose exec backend poetry run python manage.py createsuperuser

echo "Connect to CISO Assistant on https://localhost:8443"
echo "For successive runs, you can now use 'docker compose up'."
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-pg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ if [ -d ./db ] ; then
else
docker rmi ghcr.io/intuitem/ciso-assistant-community/backend:latest ghcr.io/intuitem/ciso-assistant-community/frontend:latest 2> /dev/null
docker compose -f docker-compose-pg.yml up -d
docker compose -f docker-compose-pg.yml exec backend python manage.py migrate
docker compose -f docker-compose-pg.yml exec backend poetry run python manage.py migrate
echo "initialize your superuser account..."
docker compose -f docker-compose-pg.yml exec backend python manage.py createsuperuser
docker compose -f docker-compose-pg.yml exec backend poetry run python manage.py createsuperuser
echo "connect to ciso assistant on https://localhost:8443 or the custom url if you have set it"
echo "for successive runs you can now use docker compose -f docker-compose-pg.yml up"
fi
4 changes: 2 additions & 2 deletions docker-compose-remote-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ else
echo "Cleaning up old images and pulling the new ones ..."
docker rmi ghcr.io/intuitem/ciso-assistant-community/backend:latest ghcr.io/intuitem/ciso-assistant-community/frontend:latest 2> /dev/null
docker compose -f docker-compose-remote-api.yml up -d
docker compose -f docker-compose-remote-api.yml exec backend python manage.py migrate
docker compose -f docker-compose-remote-api.yml exec backend poetry run python manage.py migrate
echo "initialize your superuser account..."
docker compose -f docker-compose-remote-api.yml exec backend python manage.py createsuperuser
docker compose -f docker-compose-remote-api.yml exec backend poetry run python manage.py createsuperuser
echo "connect to ciso assistant on https://<your-host>:8443"
echo "for successive runs you can now use docker compose up"
fi
2 changes: 1 addition & 1 deletion docker-compose-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
echo "Giving some time for the database to be ready, please wait ..."
sleep 20
echo "initialize your superuser account..."
docker compose exec backend python manage.py createsuperuser
docker compose exec backend poetry run python manage.py createsuperuser
echo "connect to ciso assistant on https://cool-vm:8443"
echo "for successive runs you can now use docker compose up"
fi
2 changes: 1 addition & 1 deletion docker-compose.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (Test-Path "db/ciso-assistant.sqlite3") {
Write-Output "Giving some time for the database to be ready, please wait ..."
Start-Sleep -Seconds 20
Write-Output "Initialize your superuser account..."
docker-compose exec backend python manage.py createsuperuser
docker-compose exec backend poetry run python manage.py createsuperuser
Write-Output "Connect to CISO Assistant on https://localhost:8443"
Write-Output "For successive runs, you can now use docker-compose up."
}
2 changes: 1 addition & 1 deletion docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
echo "Giving some time for the database to be ready, please wait ..."
sleep 30
echo "initialize your superuser account..."
docker compose exec backend python manage.py createsuperuser
docker compose exec backend poetry run python manage.py createsuperuser
echo "connect to ciso assistant on https://localhost:8443"
echo "for successive runs you can now use docker compose up"
fi
Loading