Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Switch Pulp to use sqlite3 as default #3344

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions .travis.yml
Expand Up @@ -2,6 +2,9 @@ sudo: false
# https://docs.travis-ci.com/user/trusty-ci-environment/
dist: trusty
language: python
env:
- DB=sqlite
- DB=postgres
python:
# python versions used in el7 SCL & supported fedora
- "3.5"
Expand All @@ -20,8 +23,10 @@ install:
- "pushd pulpcore/ && pip install -e . && popd"
- "pushd plugin/ && pip install -e . && popd"
before_script:
- psql -U postgres -c "CREATE USER pulp WITH SUPERUSER LOGIN;"
- psql -U postgres -c "CREATE DATABASE pulp OWNER pulp;"
- sh -c "if [ '$DB' = 'postgres' ]; then sed -i \"s/'ENGINE': 'django.db.backends.sqlite3'/'ENGINE': 'django.db.backends.postgresql_psycopg2'/\" pulpcore/pulpcore/app/settings.py"
- sh -c "if [ '$DB' = 'postgres' ]; then sed -i \"s/'USER': ''/'USER': 'pulp'/\" pulpcore/pulpcore/app/settings.py"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -U postgres -c 'CREATE USER pulp WITH SUPERUSER LOGIN;'"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -U postgres -c 'CREATE DATABASE pulp OWNER pulp;'"
script:
# flake8
- "flake8 --config flake8.cfg"
Expand Down
4 changes: 2 additions & 2 deletions pulpcore/pulpcore/app/settings.py
Expand Up @@ -168,9 +168,9 @@
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
'databases': {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'pulp',
'USER': 'pulp',
'USER': '',
'CONN_MAX_AGE': 0,
},
},
Expand Down
10 changes: 5 additions & 5 deletions pulpcore/pulpcore/etc/pulp/server.yaml
Expand Up @@ -17,15 +17,15 @@
# shipped with your version of Django, or online at
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
#
# By default, Pulp will attempt to connect to PostgreSQL on a local Unix
# socket using the 'pulp' user with a database name of 'pulp'.
# By default, Pulp will use a sqlite3 database. If your environment is used in production
# consider configuring Postgresql or another Django supported database.
#
# databases:
# default:
# CONN_MAX_AGE: 0
# ENGINE: django.db.backends.postgresql_psycopg2
# NAME: pulp
# USER: pulp
# ENGINE: django.db.backends.sqlite3
# NAME:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, this needs to be 'pulp'

# USER:
# PASSWORD:
# HOST:
# PORT:
Expand Down