This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
113 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from django.contrib import messages | ||
from django.core.mail import send_mail | ||
#from django.core.mail import send_mail | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
import stored_messages | ||
|
@@ -35,12 +35,14 @@ def inform_user(self, message_type, message_text, email=True): | |
|
||
if email: | ||
if hasattr(self.user, 'email'): | ||
send_mail( | ||
'[OSMAXX] '+message_text, | ||
message_text, | ||
'[email protected]', | ||
[self.user.email] | ||
) | ||
pass | ||
# TODO: fix it | ||
# send_mail( | ||
# '[OSMAXX] '+message_text, | ||
# message_text, | ||
# '[email protected]', | ||
# [self.user.email] | ||
# ) | ||
else: | ||
self.inform_user( | ||
messages.WARNING, | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Setup a docker compose container used to start the development application | ||
# Setup application & database | ||
|
||
# stop containers & cleanup | ||
docker-compose stop | ||
docker-compose rm -f | ||
|
||
# pull & build | ||
docker-compose pull | ||
docker-compose build | ||
|
||
# migrate | ||
docker-compose up -d databasedev | ||
sleep 3 | ||
docker-compose run --rm webappdev /bin/bash -c './manage.py migrate && ./manage.py createsuperuser' | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Setup a docker compose container used to start the production application | ||
# Setup application & database | ||
|
||
DOCKER_COMPOSE_TAG="1.3.1" | ||
|
||
# create container | ||
docker create --name osmaxx-starter -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" up --no-recreate | ||
|
||
# stop containers & cleanup | ||
docker run -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" --rm "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" stop | ||
# TODO: data containers should not be removed! | ||
docker run -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" --rm "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" rm -f | ||
|
||
# pull & build | ||
docker run -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" --rm "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" pull | ||
docker run -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" --rm "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" build | ||
|
||
# migrate | ||
docker run -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" --rm "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" up -d database | ||
sleep 3 | ||
docker run -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" -it --rm "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" \ | ||
run --rm webapp /bin/bash -c "python3 manage.py migrate && python3 manage.py createsuperuser" | ||
docker run -v "$(pwd):/app" -v "/var/run/docker.sock:/var/run/docker.sock" -e "COMPOSE_PROJECT_NAME=osmaxx" --rm "dduportal/docker-compose:$DOCKER_COMPOSE_TAG" stop |