Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated testing #19

Merged
merged 1 commit into from
Oct 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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