Compare commits
4 Commits
583126b0c0
...
8a0baeb596
Author | SHA1 | Date | |
---|---|---|---|
8a0baeb596 | |||
f23b37241e | |||
f5ebf42d15 | |||
396f54ef0c |
3
.gitignore
vendored
3
.gitignore
vendored
@ -28,4 +28,5 @@ src/*/cache/*
|
|||||||
config/__pycache__
|
config/__pycache__
|
||||||
|
|
||||||
# Template generated files:
|
# Template generated files:
|
||||||
src/docker-compose.yml
|
src/docker-compose.yml
|
||||||
|
src/clean-data.sh
|
@ -25,3 +25,4 @@ def template(filename, target_path):
|
|||||||
# Render the templates:
|
# Render the templates:
|
||||||
## Create Docker-Compose
|
## Create Docker-Compose
|
||||||
template("docker-compose.yml.j2", "./src/")
|
template("docker-compose.yml.j2", "./src/")
|
||||||
|
template("clean-data.sh.j2", "./src/")
|
4
makefile
4
makefile
@ -20,7 +20,9 @@ start: db-start api-start ui-start
|
|||||||
stop: ui-stop api-stop db-stop
|
stop: ui-stop api-stop db-stop
|
||||||
|
|
||||||
# Clean everything
|
# Clean everything
|
||||||
clean: ui-clean api-clean db-clean
|
clean:
|
||||||
|
chmod +x ./src/clean-data.sh
|
||||||
|
./src/clean-data.sh
|
||||||
|
|
||||||
# Setup Database
|
# Setup Database
|
||||||
db-init: config
|
db-init: config
|
||||||
|
30
src/templates/clean-data.sh.j2
Normal file
30
src/templates/clean-data.sh.j2
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
## Static
|
||||||
|
CLEAN_ERROR_ID=0
|
||||||
|
|
||||||
|
# Pre Tasks
|
||||||
|
## Stop Project
|
||||||
|
make stop
|
||||||
|
|
||||||
|
# Clean Tasks
|
||||||
|
echo "Executing Clean tasks"
|
||||||
|
## Remove Generated docker-compose
|
||||||
|
rm -rf src/docker-compose.yml || CLEAN_ERROR_ID=1
|
||||||
|
|
||||||
|
## Clean DB-Data
|
||||||
|
rm -rf {% if db.data_path_mysql is defined %}{{ data_path_mysql }}{% else %}./src/db/cache/mysql_data{% endif %} || CLEAN_ERROR_ID=3
|
||||||
|
rm -rf {% if db.data_path_mysql_backup is defined %}{{ data_path_mysql_backup }}{% else %}./src/db/cache/mysql_backup{% endif %} || CLEAN_ERROR_ID=4
|
||||||
|
|
||||||
|
# Post Task
|
||||||
|
## Remove Clean script itself
|
||||||
|
rm -rf src/clean-data.sh || CLEAN_ERROR_ID=2
|
||||||
|
|
||||||
|
## Output
|
||||||
|
if [ $CLEAN_ERROR_ID -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "Cleaning Tasks were Successfull"
|
||||||
|
else
|
||||||
|
echo "There where some Issues while cleaning, check ID: $CLEAN_ERROR_ID"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user