We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 497b1c9 + 223e4a6 commit 8ce5477Copy full SHA for 8ce5477
.dockerignore
@@ -0,0 +1,21 @@
1
+.idea
2
+._*
3
+.DS_Store
4
+.cache/
5
+staticfiles/
6
+media/
7
+bower_components/
8
+asylum/static/css/
9
+asylum/static/js/
10
+asylum/static/fonts/
11
+venv/
12
+.AppleDouble
13
+.LSOverride
14
+*.py[cod]
15
+*.pyc
16
+__pycache__
17
+*.log
18
+node_modules/
19
+project/asylum/media/
20
+*_backup.tar.gz
21
+.git
.gitignore
@@ -1,3 +1,5 @@
+# Everyone should keep their own configs
# OSX stuff
._*
.DS_Store
docker/dev.sh
@@ -1,8 +1,24 @@
-#!/bin/sh
+#!/bin/bash -e
+SCRIPTDIR=$(python -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
-docker build -t asylum_dev .
-docker run --name asylum_dev -d -p 8000:8000 -p 1080:1080 -v `pwd -P`/project:/opt/asylum asylum_dev
-read -p "Press enter to stop and remove the server" dummy
-docker stop asylum_dev
-docker rm asylum_dev
+# Make sure we're in the correct place relative to Dockerfile no matter where we were called from
+cd `dirname "$SCRIPTDIR"`
+if [ "$( docker images asylum_dev:latest )" == "" ]
+then
+ docker build -t asylum_dev .
+fi
+echo "Starting devel server."
+echo "To connect to shell in this instance run: docker exec -it asylum_dev /bin/bash"
+echo "Then in that shell run: source ../asylum-venv/bin/activate"
+if [ "$(docker ps -a -q -f name=asylum_dev)" == "" ]
+ echo "First run"
+ set -x
+ docker run --name asylum_dev -i -p 8000:8000 -p 1080:1080 -v `pwd -P`/project:/opt/asylum asylum_dev
+ set +x
+else
22
+ docker start -i asylum_dev
23
24
docker/run_unit_tests.sh
@@ -1,4 +1,8 @@
-#!/usr/bin/env bash
+
docker build -t asylum_test .
docker run --rm --name asylum_test -it asylum_test ./run_tests.sh
docker/start.sh
@@ -6,6 +6,6 @@ cd `dirname "$SCRIPTDIR"`
echo "Starting test server."
-echo "To connect to shell in this instance run: docker exec -it $(docker ps | grep asylum_test | awk '{print $1}') /bin/bash"
+echo "To connect to shell in this instance run: docker exec -it asylum_test /bin/bash"
echo "Then in that shell run: source ../asylum-venv/bin/activate"
docker run --rm --name asylum_test -it -p 8000:8000 -p 1080:1080 asylum_test
project/access/models.py
@@ -18,6 +18,7 @@ class Meta:
verbose_name_plural = _('Token Types')
ordering = ['label', ]
revisions.default_revision_manager.register(TokenType)
@@ -43,6 +44,7 @@ class Meta:
43
44
unique_together = ("ttype", "value")
45
ordering = ['owner__lname', 'owner__fname', 'ttype__label']
46
47
48
revisions.default_revision_manager.register(Token)
49
50
@@ -59,6 +61,7 @@ class Meta:
59
61
verbose_name_plural = _('Access Types')
60
62
63
64
65
revisions.default_revision_manager.register(AccessType)
66
67
@@ -76,6 +79,7 @@ class Meta:
76
79
unique_together = ('owner', 'atype')
77
80
ordering = ['owner__lname', 'owner__fname', 'atype__label']
78
81
82
83
revisions.default_revision_manager.register(Grant)
84
85
@@ -104,4 +108,5 @@ class Meta:
104
108
105
109
ordering = ['contact', 'ttype__label']
106
110
111
107
112
revisions.default_revision_manager.register(NonMemberToken)
project/bower.json
@@ -10,9 +10,6 @@
"dependencies": {
"bootstrap": "3.3.5",
"font-awesome": "~4.4.0",
- "jquery": "~2.1.4",
- "jquery.scrollTo": "~2.1.2",
- "scrollreveal": "scroll-reveal#~2.3.2",
- "vide": "~0.4.1"
+ "jquery": "~2.1.4"
}
project/config/wsgi.py
@@ -15,16 +15,18 @@
"""
import os
import environ
+from django.core.wsgi import get_wsgi_application
+from whitenoise.django import DjangoWhiteNoise
ROOT_DIR = environ.Path(__file__) - 2 # (/a/b/myfile.py - 3 = /)
env = environ.Env()
25
# If the project root contains a .env file, read it
26
if os.path.isfile(str(ROOT_DIR + '.env')):
27
environ.Env.read_env(str(ROOT_DIR + '.env'))
28
29
-from django.core.wsgi import get_wsgi_application
-from whitenoise.django import DjangoWhiteNoise
30
31
if env.bool('USE_SENTRY', False):
32
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
project/creditor/models.py
@@ -27,6 +27,7 @@ class Meta:
verbose_name_plural = _('Transaction Tags')
revisions.default_revision_manager.register(TransactionTag)
33
@@ -56,6 +57,7 @@ class Meta:
56
57
verbose_name_plural = _('Transactions')
58
ordering = ['-stamp', 'reference']
revisions.default_revision_manager.register(Transaction)
@@ -155,4 +157,5 @@ class Meta:
155
157
verbose_name_plural = _('Recurring Transactions')
156
158
ordering = ['owner__lname', 'owner__fname', '-start']
159
160
161
revisions.default_revision_manager.register(RecurringTransaction)
project/docker-entrypoint.sh
@@ -13,15 +13,20 @@ VENV_DIR_PATH=/opt/asylum-venv/
# make sure postgresql is running
sudo -u postgres service postgresql start
+set +e
+export PGPASSWORD=asylum; while true; do psql -q asylum -c 'SELECT 1;' 1>/dev/null 2>&1 ; if [ "$?" -ne "0" ]; then echo "Waiting for psql"; sleep 1; else break; fi; done
+set -e
# Start forego or execute a command in the virtualenv
if [ "$#" -eq 0 ]; then
+ echo "Starting devel server"
maildump --http-ip 0.0.0.0 -p ~/maildump.pid &
npm run build
npm run watch &
NPM=$!
./manage.py runserver 0.0.0.0:8000
maildump -p ~/maildump.pid --stop
else
+ echo "Calling $@"
"$@"
fi
0 commit comments