|
@@ -62,11 +62,11 @@ intro() {
|
|
echo
|
|
echo
|
|
echo "Development project:"
|
|
echo "Development project:"
|
|
echo
|
|
echo
|
|
- echo " ${BOLD}init${NORMAL} initialize dev project for development."
|
|
|
|
|
|
+ echo " ${BOLD}init${NORMAL} initialize dev database for development."
|
|
echo " ${BOLD}afterinit${NORMAL} repeat help message displayed after init command is complete."
|
|
echo " ${BOLD}afterinit${NORMAL} repeat help message displayed after init command is complete."
|
|
- echo " ${BOLD}remove${NORMAL} if dev project exists, remove its files and docker containers."
|
|
|
|
|
|
+ echo " ${BOLD}clear${NORMAL} clear media and userdata dirs and destroy docker containers."
|
|
echo " ${BOLD}rebuild${NORMAL} rebuild docker containers."
|
|
echo " ${BOLD}rebuild${NORMAL} rebuild docker containers."
|
|
- echo " ${BOLD}reset${NORMAL} run remove followed by init."
|
|
|
|
|
|
+ echo " ${BOLD}reset${NORMAL} run clear followed by init."
|
|
echo
|
|
echo
|
|
echo " Both init and rebuild args can be followed with any number of extra args and options that should be appended to docker-compose build."
|
|
echo " Both init and rebuild args can be followed with any number of extra args and options that should be appended to docker-compose build."
|
|
echo
|
|
echo
|
|
@@ -152,13 +152,6 @@ after_init_message() {
|
|
echo "Username: $username"
|
|
echo "Username: $username"
|
|
echo "Password: $password"
|
|
echo "Password: $password"
|
|
echo
|
|
echo
|
|
- echo "Development project directories:"
|
|
|
|
- echo
|
|
|
|
- echo "devproject configuration files for development instance."
|
|
|
|
- echo "media user uploaded files."
|
|
|
|
- echo "userdata working directory for user data exports."
|
|
|
|
- echo "avatargallery example avatar gallery."
|
|
|
|
- echo
|
|
|
|
echo "To connect to development database use following credentials:"
|
|
echo "To connect to development database use following credentials:"
|
|
echo
|
|
echo
|
|
echo "User: misago"
|
|
echo "User: misago"
|
|
@@ -171,25 +164,26 @@ after_init_message() {
|
|
echo
|
|
echo
|
|
}
|
|
}
|
|
|
|
|
|
-# Remove existing dev project
|
|
|
|
-remove() {
|
|
|
|
- echo -e "${RED}Warning:${NORMAL} You are going remove current development project."
|
|
|
|
|
|
+# Clear existing dev project
|
|
|
|
+clear() {
|
|
|
|
+ echo -e "${RED}Warning:${NORMAL} You are going to delete files created during development and destroy docker containers."
|
|
echo
|
|
echo
|
|
|
|
|
|
- if [[ $will_delete_files = true ]]; then
|
|
|
|
- echo "Following files and directories will be deleted:"
|
|
|
|
- find ./devproject/media ! -name '.gitignode'
|
|
|
|
- find ./devproject/userdata ! -name '.gitignode'
|
|
|
|
- echo
|
|
|
|
- fi
|
|
|
|
|
|
+ devproject_path="$(pwd)/devproject"
|
|
|
|
+
|
|
|
|
+ echo "Following files and directories will be deleted:"
|
|
|
|
+ find $devproject_path/media/* ! -name '.gitignore'
|
|
|
|
+ find $devproject_path/userdata/* ! -name '.gitignore'
|
|
|
|
+ echo
|
|
|
|
+
|
|
echo "Enter \"y\" to confirm:"
|
|
echo "Enter \"y\" to confirm:"
|
|
|
|
|
|
read confirmation
|
|
read confirmation
|
|
if [[ $confirmation = "y" ]]; then
|
|
if [[ $confirmation = "y" ]]; then
|
|
docker-compose stop
|
|
docker-compose stop
|
|
docker-compose down --remove-orphans
|
|
docker-compose down --remove-orphans
|
|
- find ./devproject/media ! -name '.gitignode' -delete
|
|
|
|
- find ./devproject/userdata ! -name '.gitignode' -delete
|
|
|
|
|
|
+ find $devproject_path/media/* ! -name '.gitignore' -delete
|
|
|
|
+ find $devproject_path/userdata/* ! -name '.gitignore' -delete
|
|
else
|
|
else
|
|
echo "Operation canceled."
|
|
echo "Operation canceled."
|
|
fi
|
|
fi
|
|
@@ -283,10 +277,10 @@ if [[ $1 ]]; then
|
|
init_in_docker
|
|
init_in_docker
|
|
elif [[ $1 = "afterinit" ]]; then
|
|
elif [[ $1 = "afterinit" ]]; then
|
|
after_init_message
|
|
after_init_message
|
|
- elif [[ $1 = "remove" ]]; then
|
|
|
|
- remove
|
|
|
|
|
|
+ elif [[ $1 = "clear" ]]; then
|
|
|
|
+ clear
|
|
elif [[ $1 = "reset" ]]; then
|
|
elif [[ $1 = "reset" ]]; then
|
|
- remove
|
|
|
|
|
|
+ clear
|
|
init $@
|
|
init $@
|
|
elif [[ $1 = "rebuild" ]]; then
|
|
elif [[ $1 = "rebuild" ]]; then
|
|
rebuild $@
|
|
rebuild $@
|