Changeset View
Changeset View
Standalone View
Standalone View
dockerfiles/swh-indexer-storage/entrypoint.sh
#!/bin/bash | #!/bin/bash | ||||
set -e | set -e | ||||
if [[ -d /src ]] ; then | if [[ -d /src ]] ; then | ||||
for srcrepo in /src/swh-* ; do | for srcrepo in /src/swh-* ; do | ||||
pushd $srcrepo | pushd $srcrepo | ||||
pip install -e . | echo "WARNING: $srcrepo will NOT be pip installed in dev mode" | ||||
echo " due to permission limitations." | |||||
pip install --user . | |||||
popd | popd | ||||
done | done | ||||
fi | fi | ||||
echo "${PGHOST}:5432:${POSTGRES_DB}:${PGUSER}:${POSTGRES_PASSWORD}" > ~/.pgpass | echo "${PGHOST}:5432:${POSTGRES_DB}:${PGUSER}:${POSTGRES_PASSWORD}" > ~/.pgpass | ||||
cat > ~/.pg_service.conf <<EOF | cat > ~/.pg_service.conf <<EOF | ||||
[swh-indexer] | [swh-indexer] | ||||
dbname=${POSTGRES_DB} | dbname=${POSTGRES_DB} | ||||
Show All 13 Lines | case "$1" in | ||||
echo Waiting for postgresql to start | echo Waiting for postgresql to start | ||||
until psql service=swh-indexer -c "select 1" 2>&1 > /dev/null; do sleep 0.1; done | until psql service=swh-indexer -c "select 1" 2>&1 > /dev/null; do sleep 0.1; done | ||||
echo Setup the database | echo Setup the database | ||||
PGPASSWORD=${POSTGRES_PASSWORD} swh-db-init indexer \ | PGPASSWORD=${POSTGRES_PASSWORD} swh-db-init indexer \ | ||||
--db-name ${POSTGRES_DB} | --db-name ${POSTGRES_DB} | ||||
echo Starting the swh-indexer-storage API server | echo Starting the swh-indexer-storage API server | ||||
exec python -m swh.indexer.storage.api.server /indexer_storage.yml | exec python -m swh.indexer.storage.api.server /indexer_storage | ||||
;; | ;; | ||||
esac | esac |