Created
March 28, 2019 08:41
-
-
Save koffisani/eb42db0f39d881cc704d46c35333efd3 to your computer and use it in GitHub Desktop.
Gitlab CI config for GeoDjango
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: python:latest | |
services: | |
- postgres:latest | |
variables: | |
POSTGRES_DB: ci | |
cache: | |
paths: | |
- ~/.cache/pip/ | |
before_script: | |
- python -V | |
- wget https://download.osgeo.org/geos/geos-3.7.1.tar.bz2 | |
- tar xjf geos-3.7.1.tar.bz2 | |
- cd geos-3.7.1 | |
- ./configure | |
- make | |
- make install | |
- wget https://download.osgeo.org/proj/proj-5.2.0.tar.gz | |
- wget https://download.osgeo.org/proj/proj-datumgrid-1.8.tar.gz | |
- tar xzf proj-5.2.0.tar.gz | |
- cd proj-5.2.0/nad | |
- tar xzf ../../proj-datumgrid-1.8.tar.gz | |
- cd .. | |
- ./configure | |
- make | |
- make install | |
- cd .. | |
- wget https://download.osgeo.org/gdal/2.4.1/gdal-2.4.1.tar.gz | |
- tar xzf gdal-2.4.1.tar.gz | |
- ls -al | |
- cd gdal-2.4.1 | |
- ./configure | |
- make | |
- make install | |
- cd .. | |
- cd .. | |
- pwd | |
- ls -al | |
- ln -s /usr/lib/libgdal.so /usr/lib/libgdal.so.1 | |
- /sbin/ldconfig | |
- pip install -r requirements.txt | |
test: | |
variables: | |
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB" | |
script: | |
- python manage.py test --settings world.settings.ci | |
# my app is named world. Set the right name here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# world/settings/ci.py | |
from .default import * | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'ci', | |
'USER': 'postgres', | |
'PASSWORD': 'postgres', | |
'HOST': 'postgres', | |
'PORT': '5432', | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment