Skip to content

Commit

Permalink
Merge pull request #19 from partio-scout/tests
Browse files Browse the repository at this point in the history
Automated testing
  • Loading branch information
ZeiP authored Oct 11, 2020
2 parents 39707e1 + 92f4ce4 commit ae162e1
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Automated tests

on: pull_request

jobs:
sqlite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: bash -x scripts/citest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
*.pyc
src
env*
*.orig
*.rej
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM ubuntu:12.04
FROM python:2

MAINTAINER siimeon<[email protected]>
WORKDIR /app/web

RUN apt-get update && apt-get install -y python python-django git
COPY . /app/

RUN git clone https://github.com/siimeon/Kipa.git /root/kipa
RUN echo "PYTHONPATH=/usr/local/lib/python2.7/site-packages" | tee -a /etc/profile

EXPOSE 8000
ENTRYPOINT ["/app/docker-entrypoint.sh"]

WORKDIR /root/kipa/web
EXPOSE 3000

CMD git pull && python manage.py runserver 0.0.0.0:8000
CMD ["./manage.py", "runserver", "0.0.0.0:3000"]

RUN pip install -r /app/requirements.txt
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'
services:
web:
build: .
ports:
- 3000:3000
5 changes: 5 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

export PYTHONPATH="/usr/local/lib/python2.7/site-packages"

exec "$@"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#django
#django==1.2.7
#https://www.djangoproject.com/download/1.2.7/tarball/
-e git+https://github.com/django/[email protected]#egg=django
git+https://github.com/django/[email protected]#egg=django
south
#mysql-python
-e git+https://github.com/PyMySQL/mysqlclient-python.git#egg=MySQLdb
git+https://github.com/PyMySQL/mysqlclient-python.git@v1.4.6#egg=MySQLdb
20 changes: 20 additions & 0 deletions scripts/citest
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e

docker_compose="docker-compose --file docker-compose.yml"

function cleanup() {
$docker_compose down
}

function die() {
echo $@
exit 1
}

trap cleanup EXIT

$docker_compose build
$docker_compose up -d
$docker_compose run web './manage.py' test
3 changes: 3 additions & 0 deletions web/manage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/python2

import sys
print sys.path
from tupa.dia2django import luoMallienRungot
from django.core.management import execute_manager

#try:
import settings #
import legacySettings # Legacy settings for exporting an legacy db
Expand Down

0 comments on commit ae162e1

Please sign in to comment.