Public Repository

Last pushed: 7 months ago
Short Description
python3-postgres environment for bitbucket piplines
Full Description

Example piplines settings for Python3.5/Django project with PostgreSQL database.

This is a sample build configuration for Python.

Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples.

Only use spaces to indent your .yml configuration.

-----

You can specify a custom docker image from Docker Hub as your build environment.

image: h1hg/python3-postgres
pipelines:
default:

- step:
    script: # Modify the commands below to build your repository.
      - /etc/init.d/postgresql start
      - sudo -u postgres psql -c "CREATE USER ${DB_USER} WITH ENCRYPTED PASSWORD '${DB_PASS}' SUPERUSER;"
      - sudo -u postgres psql -c "CREATE DATABASE ${DB_NAME} OWNER ${DB_USER};"
      - pip install -r requirements.txt
      - python manage.py migrate
      - python manage.py test

You can specify environment variables in your bitbucket repo settings like:
DB_HOST 127.0.0.1
DB_PORT 5432
DB_NAME tests
DB_USER test
DB_PASS test

Don't change DB_HOST and DB_PORT for this image.

Thanks 'valtechcanada' for shared info.

Docker Pull Command
Owner
h1hg

Comments (0)