Skip to content

Latest commit

 

History

History
71 lines (54 loc) · 2.19 KB

postgresql_setup.md

File metadata and controls

71 lines (54 loc) · 2.19 KB

PostgreSQL

Extra runtime requirements for PostgreSQL database support

Install & setup additional dependencies

Tested on Ubuntu LTS 14.04.2


# get the extra postgresql packages
sudo apt-get install libpq-dev python-dev postgresql postgresql-client-common postgresql-common

# Note: The following PostgreSQL specific steps are only needed when PostgreSQL
# is used for checking. By default CodeChecker uses SQLite.

# setup database for a test_user
sudo -i -u postgres
# add a test user with "test_pwd" password
createuser --createdb --login --pwprompt test_user
exit

# PostgreSQL authentication
# PGPASSFILE environment variable should be set to a pgpass file
# For format and further information see PostgreSQL documentation:
# http://www.postgresql.org/docs/current/static/libpq-pgpass.html

echo "*:5432:*:test_user:test_pwd" >> ~/.pgpass
chmod 0600 ~/.pgpass

# activate the already created virtualenv in the basic setup
source ~/checker_env/bin/activate

# install required python modules
pip install -r .ci/python_requirements

# create codechecker package
./build_package.py -o ~/codechecker_package
cd ..

Run CodeChecker

Activate virtualenv.

source ~/checker_env/bin/activate

Add package bin directory to PATH. This step can be skipped if you always give the path of CodeChecker command.

export PATH=~/codechecker_package/CodeChecker/bin:$PATH

Check a test project.

CodeChecker check --dbusername test_user --postgresql -n test_project_check -b "cd my_test_project && make clean && make"

Start web server to view the results.

CodeChecker server --dbusername test_user --postgresql

View the results with firefox.

firefox http://localhost:8001