diff --git a/README.md b/README.md index 1d8edc0..4c26f29 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,28 @@ Joomla CMS. -Make sure the projectName is set correctly, it's very important. +Make sure the projectName is set correctly, it's very important, because it's used for git, docker, mysql and joomla. +## Installation 1. Clone me ```git clone git@git.nickyeoman.com:nick/joomla.git projectName``` 1. cd projectName 1. Setup your .env file ```mv env.sample .env``` then edit with your favorite editor. 1. Prepare your project for git ```bash bin/new_project.sh``` 1. Run the containers to initialize ```sudo bash bin/docker_up.sh``` -1. Prepare the installer ```bash bin/setup_joomla_installer.sh``` -1. Go to ```http://localhost:8000``` and follow the installation steps -1. Manually set Site Meta Description in [Administrator](http://localhost:8000/administrator) +1. cli installer ```bash bin/setup_joomla_installer.sh``` +1. Manually set Site Meta Description in [Administrator](http://localhost:8000/administrator/index.php?option=com_config) 1. Run ```sudo bash bin/finalize.sh``` +## Working Environment + +Let's update our bash_profile with some alias: +```bash +alias joomla='docker-compose exec -u www-data joomla php cli/joomla.php' +``` +Allowing you to just run commands like this: ```joomla core:check-updates``` + ## References * [Develop a component](https://docs.joomla.org/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component) * [Minimal component](https://joomla.stackexchange.com/questions/22176/minimal-basic-structure-for-a-frontend-joomla-component-without-using-joomla-mvc) +* [Joomla CLI Cheatsheet](https://magazine.joomla.org/all-issues/june-2022/joomla-4-a-powerful-cli-application) \ No newline at end of file diff --git a/bin/finalize.sh b/bin/finalize.sh index fc0db54..12c6a32 100644 --- a/bin/finalize.sh +++ b/bin/finalize.sh @@ -12,6 +12,7 @@ PROJECTNAME=$(basename "$(pwd)") rm -f html/web.config.txt rm -f html/htaccess.txt rm -f html/LICENSE.txt +rm -f html/README.txt # Set configuration.php docker-compose exec -u www-data joomla php cli/joomla.php config:set error_reporting=none diff --git a/bin/inc_new_project/remote_git_setup.sh b/bin/inc_new_project/remote_git_setup.sh index a7c5d3d..4eaaecd 100644 --- a/bin/inc_new_project/remote_git_setup.sh +++ b/bin/inc_new_project/remote_git_setup.sh @@ -4,14 +4,6 @@ PROJECTNAME=$(basename "$(pwd)") echo -e "\n\e[32mSetup Git Remotely\e[0m\n"; -if [ "$DEBUG" = "true" ]; then - # Debugging - echo "DEBUGGING" - echo "GITEA API url: $GITEA_API_URL" - echo "Access token: $ACCESS_TOKEN" - echo "Project name: $PROJECTNAME"; -fi - DESC="Repo auto created by Joomla remote git script creator for $PROJECTNAME" # Create the repository using Gitea API @@ -21,11 +13,6 @@ RESPONSE=$(curl -s -X POST \ -d "{\"name\":\"$PROJECTNAME\",\"private\": true,\"description\": \"$DESC\"}" \ $GITEA_API_URL/user/repos) -if [ "$DEBUG" = "true" ]; then - echo "The RESPONSE:" - echo "$RESPONSE" -fi - if [ -z "$RESPONSE" ] || [ "$(echo "$RESPONSE" | jq -r '.id')" = "null" ]; then echo "Error: Failed to create $PROJECTNAME repository." exit 1 @@ -37,11 +24,6 @@ if [ "$SSH_URL" = "null" ]; then exit 1 fi -if [ "$DEBUG" = "true" ]; then - echo "SSH URL:" - echo "$SSH_URL" -fi - # Add new remote repository git remote add origin "$SSH_URL" git remote -v diff --git a/bin/install_extensions.sh b/bin/install_extensions.sh new file mode 100644 index 0000000..bca3a65 --- /dev/null +++ b/bin/install_extensions.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Sitemap +docker-compose exec -u www-data joomla php cli/joomla.php extension:install --url=https://deploy.ostraining.com/client/download/free/latest-stable/com_osmap + +# Comments +docker-compose exec -u www-data joomla php cli/joomla.php extension:install --url=https://cdn.akeeba.com/updates/pkgengage.xml \ No newline at end of file diff --git a/docs/FAQs.md b/docs/FAQs.md new file mode 100644 index 0000000..49f89ff --- /dev/null +++ b/docs/FAQs.md @@ -0,0 +1,10 @@ +# Frequently Asked Questions + +## How do I add user to Docker + +Read more on [Docker's Official Post Instalation Docs](https://docs.docker.com/engine/install/linux-postinstall/) + +```bash +sudo usermod -aG docker $USER +newgrp docker +``` diff --git a/env.sample b/env.sample index 9ad4d64..f145290 100644 --- a/env.sample +++ b/env.sample @@ -1,6 +1,3 @@ -# Run Scripts -DEBUG=false - # Docker NETWORKNAME=admin_web