trying to get installer working
This commit is contained in:
		
							parent
							
								
									8ab2a67e46
								
							
						
					
					
						commit
						6ffd91151e
					
				@ -7,5 +7,7 @@ Make sure the projectName is set correctly, it's very important.
 | 
				
			|||||||
1. Clone me ```git clone git@git.nickyeoman.com:nick/joomla.git projectName```
 | 
					1. Clone me ```git clone git@git.nickyeoman.com:nick/joomla.git projectName```
 | 
				
			||||||
1. cd projectName
 | 
					1. cd projectName
 | 
				
			||||||
1. Setup your .env file ```mv env.sample .env``` then edit with your favorite editor.
 | 
					1. Setup your .env file ```mv env.sample .env``` then edit with your favorite editor.
 | 
				
			||||||
1. bash bin/new_project.sh
 | 
					1. Prepare your project for git ```bash bin/new_project.sh```
 | 
				
			||||||
1. bash bin/docker_up.sh
 | 
					1. Run the containers to initialize ```sudo bash bin/docker_up.sh```
 | 
				
			||||||
 | 
					1. Prepare the installer ```bash bin/setup_joomla_installer.sh```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,23 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$EUID" -ne 0 ]; then
 | 
				
			||||||
 | 
					    echo -e "\033[0;31mThis script must be run as root.\033[0m"
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Load environment variables from .env file
 | 
				
			||||||
 | 
					set -o allexport
 | 
				
			||||||
 | 
					source .env
 | 
				
			||||||
 | 
					set +o allexport
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					PROJECTNAME=$(basename "$(pwd)")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$DEBUG" = "true" ]; then
 | 
				
			||||||
 | 
					    docker ps
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm -f html/index.html
 | 
					rm -f html/index.html
 | 
				
			||||||
sudo docker-compose up -d
 | 
					
 | 
				
			||||||
 | 
					docker-compose up -d
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker-compose ps
 | 
				
			||||||
@ -12,6 +12,7 @@ echo "" > README.md
 | 
				
			|||||||
echo "Created a fresh repo for your ${PROJECTNAME}  project." >> README.md
 | 
					echo "Created a fresh repo for your ${PROJECTNAME}  project." >> README.md
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Initialize a new Git repository
 | 
					# Initialize a new Git repository
 | 
				
			||||||
 | 
					echo -e "\n\e[32mSetup Git Locally\e[0m\n"; 
 | 
				
			||||||
git init
 | 
					git init
 | 
				
			||||||
git add .
 | 
					git add .
 | 
				
			||||||
git commit -m "Initial commit of new project $PROJECTNAME"
 | 
					git commit -m "Initial commit of new project $PROJECTNAME"
 | 
				
			||||||
 | 
				
			|||||||
@ -2,6 +2,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
PROJECTNAME=$(basename "$(pwd)")
 | 
					PROJECTNAME=$(basename "$(pwd)")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -e "\n\e[32mSetup Git Remotely\e[0m\n"; 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$DEBUG" = "true" ]; then
 | 
					if [ "$DEBUG" = "true" ]; then
 | 
				
			||||||
  # Debugging
 | 
					  # Debugging
 | 
				
			||||||
  echo "DEBUGGING"
 | 
					  echo "DEBUGGING"
 | 
				
			||||||
@ -40,8 +42,6 @@ if [ "$DEBUG" = "true" ]; then
 | 
				
			|||||||
  echo "$SSH_URL"
 | 
					  echo "$SSH_URL"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Repository '$PROJECTNAME' created successfully on Gitea."
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Add new remote repository
 | 
					# Add new remote repository
 | 
				
			||||||
git remote add origin "$SSH_URL"
 | 
					git remote add origin "$SSH_URL"
 | 
				
			||||||
git remote -v
 | 
					git remote -v
 | 
				
			||||||
 | 
				
			|||||||
@ -17,7 +17,12 @@ set +o allexport
 | 
				
			|||||||
# Run Git setup
 | 
					# Run Git setup
 | 
				
			||||||
bash bin/inc_new_project/git_setup.sh
 | 
					bash bin/inc_new_project/git_setup.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$GITEA_API_URL" = "REPLACEME" ]; then
 | 
				
			||||||
 | 
					  SETGITEA=false
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Run remote Git setup
 | 
					# Run remote Git setup
 | 
				
			||||||
if [ "$SETGITEA" = "true" ]; then
 | 
					if [ "$SETGITEA" = "true" ]; then
 | 
				
			||||||
  bash bin/inc_new_project/remote_git_setup.sh
 | 
					  bash bin/inc_new_project/remote_git_setup.sh
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					echo -e "\e[32mAll Done\e[0m"; 
 | 
				
			||||||
							
								
								
									
										51
									
								
								bin/setup_joomla_installer.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								bin/setup_joomla_installer.sh
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					PROJECTNAME=$(basename "$(pwd)")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Are you root?
 | 
				
			||||||
 | 
					if [ "$EUID" -ne 0 ]; then
 | 
				
			||||||
 | 
					    echo -e "\033[0;31mThis script must be run as root.\033[0m"
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					##################################################################
 | 
				
			||||||
 | 
					# ENV file
 | 
				
			||||||
 | 
					##################################################################
 | 
				
			||||||
 | 
					# Verify the .env file exists
 | 
				
			||||||
 | 
					if [ ! -f ".env" ]; then
 | 
				
			||||||
 | 
					  echo "Error: The .env file does not exist."
 | 
				
			||||||
 | 
					  exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Load environment variables from .env file
 | 
				
			||||||
 | 
					set -o allexport
 | 
				
			||||||
 | 
					source .env
 | 
				
			||||||
 | 
					set +o allexport
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					##################################################################
 | 
				
			||||||
 | 
					# create json file
 | 
				
			||||||
 | 
					##################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DB_PREFIX=$(echo $RANDOM | md5sum | awk '{print substr($1, 1, 3)}')_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker-compose exec -u www-data joomla sh -c "echo '{
 | 
				
			||||||
 | 
					  \"language\":\"en-GB\",
 | 
				
			||||||
 | 
					  \"site_name\":\"$PROJECTNAME\",
 | 
				
			||||||
 | 
					  \"admin_email\":\"$EMAIL\",
 | 
				
			||||||
 | 
					  \"admin_user\":\"$JOOMLA_USER\",
 | 
				
			||||||
 | 
					  \"admin_password\":\"$JOOMLA_PASSWORD\",
 | 
				
			||||||
 | 
					  \"db_type\":\"mysql\",
 | 
				
			||||||
 | 
					  \"db_host\":\"mariadb\",
 | 
				
			||||||
 | 
					  \"db_user\":\"$MYSQL_USER\",
 | 
				
			||||||
 | 
					  \"db_pass\":\"$MYSQL_PASSWORD\",
 | 
				
			||||||
 | 
					  \"db_name\":\"$MYSQL_DATABASE\",
 | 
				
			||||||
 | 
					  \"db_prefix\":\"$DB_PREFIX\",
 | 
				
			||||||
 | 
					  \"db_old\":\"remove\",
 | 
				
			||||||
 | 
					  \"helpurl\":\"https://joomla.org\"
 | 
				
			||||||
 | 
					}' > config.json"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					##################################################################
 | 
				
			||||||
 | 
					# run the installer
 | 
				
			||||||
 | 
					##################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker-compose exec -u www-data joomla php cli/joomla.php core:install --file=config.json
 | 
				
			||||||
@ -11,6 +11,10 @@ MYSQL_PASSWORD=REPLACEME
 | 
				
			|||||||
MYSQL_DATABASE=REPLACEME
 | 
					MYSQL_DATABASE=REPLACEME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# GITEA
 | 
					# GITEA
 | 
				
			||||||
GITEA_API_URL=<your_gitea_api_url>
 | 
					GITEA_API_URL=REPLACEME
 | 
				
			||||||
ACCESS_TOKEN=<your_access_token>
 | 
					ACCESS_TOKEN=REPLACEME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Joomla
 | 
				
			||||||
 | 
					EMAIL=noreply@example.com
 | 
				
			||||||
 | 
					JOOMLA_USER=admin
 | 
				
			||||||
 | 
					JOOMLA_PASSWORD=REPLACEME
 | 
				
			||||||
		Reference in New Issue
	
	Block a user