Needed to cleanup Project
This commit is contained in:
		
							
								
								
									
										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
 | 
			
		||||
		Reference in New Issue
	
	Block a user