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

Fix docker startup #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf
8 changes: 4 additions & 4 deletions src/Software/docker/django/start 100644 → 100755
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
python manage.py collectstatic --noinput
gunicorn teamverwaltung.wsgi -c /var/gunicorn/gunicorn.py
#!/usr/bin/env bash

python manage.py collectstatic --noinput
gunicorn teamverwaltung.wsgi -c /var/gunicorn/gunicorn.py
12 changes: 6 additions & 6 deletions src/Software/docker/django/wait 100644 → 100755
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
while ! mysqladmin ping -h"db" -P"3306" --silent; do
echo "Waiting for MySQL to be up..."
sleep 1
done
#!/usr/bin/env bash

while ! mysqladmin ping -h"db" -P"3306" --silent; do
echo "Waiting for MySQL to be up..."
sleep 1
done
28 changes: 14 additions & 14 deletions src/Software/fix_permissions.sh 100644 → 100755
@@ -1,14 +1,14 @@
#!/bin/bash
# cd & check
if ! cd "$(dirname "$0")"; then exit; fi
# fix permissions
find docker -type d -exec chmod 0775 {} \;
find docker -type f -exec chmod 0664 {} \;
find src -type d -exec chmod 0775 {} \;
find src -type f -exec chmod 0664 {} \;
chmod 775 docker/django/start
chmod 775 docker/django/wait
#!/bin/bash

# cd & check
if ! cd "$(dirname "$0")"; then exit; fi

# fix permissions
find docker -type d -exec chmod 0775 {} \;
find docker -type f -exec chmod 0664 {} \;

find src -type d -exec chmod 0775 {} \;
find src -type f -exec chmod 0664 {} \;

chmod 775 docker/django/start
chmod 775 docker/django/wait
4 changes: 2 additions & 2 deletions src/Software/src/teamverwaltung/teamverwaltung_main/parse.py
Expand Up @@ -156,7 +156,7 @@ def parse_snum(self, email: str):
return email[:6]

def parse_title(self, title: str):
"""Parst die Anrede aus den ersten 6 Zeichen der Email
"""Parst die Anrede des Studenten

:param title: Anrede des Studenten
:type title: str
Expand All @@ -170,7 +170,7 @@ def parse_title(self, title: str):
if title == "Herr":
return "h"
elif title == "Frau":
return = "f"
return "f"
else:
raise CSVStudentParserException("unknown title")

Expand Down
30 changes: 15 additions & 15 deletions src/Software/start.sh
@@ -1,15 +1,15 @@
#!/bin/bash
# cd & check
if ! cd "$(dirname "$0")"; then exit; fi
if [ "$1" = "--reset" -o "$1" = "-b" ]; then
sudo docker system prune --all
sudo docker volume prune
sudo docker compose up -d
#sudo docker compose up --build --force-recreate --no-deps
elif [ "$1" = "--build" -o "$1" = "-b" ]; then
sudo docker compose up --build -d
else
sudo docker compose up -d
fi
#!/bin/bash

# cd & check
if ! cd "$(dirname "$0")"; then exit; fi

if [ "$1" = "--reset" -o "$1" = "-b" ]; then
sudo docker system prune --all
sudo docker volume prune
sudo docker compose up -d
#sudo docker compose up --build --force-recreate --no-deps
elif [ "$1" = "--build" -o "$1" = "-b" ]; then
sudo docker compose up --build -d
else
sudo docker compose up -d
fi
12 changes: 6 additions & 6 deletions src/Software/stop.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# cd & check
if ! cd "$(dirname "$0")"; then exit; fi
sudo docker compose down
#!/bin/bash

# cd & check
if ! cd "$(dirname "$0")"; then exit; fi

sudo docker compose down