This script deploys custom Magerun2 commands to a Magento installation. It checks if the current directory is the Magento root, extracts necessary files, and places them in the correct locations.
This script provides the possibility to set up with one click:
- Grunt
- Xdebug
- SSH
- Coding standards (PHPCS, PHPMD)
Run following command
curl -o- https://raw.githubusercontent.com/Md5Inj/MageGo/main/install.sh | bash
- Install MageGo
- Run it
php ./magego.phar
- Displays a list of available commands or detailed help for a specific command.
- Enable verbose output for commands, providing more detailed logs and error messages.
- Updates the MageGo to the latest version.
- Shows current version
- Deploy custom commands packaged within a PHAR (PHP Archive) file to a Magento application. It extracts the PHAR file contents to a specified directory and verifies if the current directory is a Magento root directory before proceeding with the extraction.
- Check the script for updates and reports if a newer version is available.
- Install coding standards tools (PHPCS, PHPMD) into an LXC container.
- Available options:
-b <container_name>: Required. The name of the LXC container where the coding standards tools will be installed.
- Configures Xdebug for PHP on an LXC container.
- Available options
-b <container_name>: Required. The name of the LXC container where the xdebug should be configured.
- Configure SSH access to an LXC container by adding a private key.
- Available options
-b <container_name>: Required. The name of the LXC container where SSH will be configured.-u <ssh_user>: Optional. The name of the SSH user to configure. Default iswww-data.--keyPath <key_path>: Optional. The path to the private key file to be added to the container.
- Configures Grunt for the Magento installation in an LXC container.
- Available options
-b <container_name>: Required. The name of the LXC container where Grunt will be configured.--magentoDir <magento_directory>: Optional. The Magento root directory inside the container. Default is/var/www/source.
-
dev:git:branch: This command shelves current changes. Fetches data from the repository. Changes the current branch.-
Enable Maintenance Mode:
- Runs
sys:maintenance --onto enable maintenance mode before making changes.
- Runs
-
Update Git Branch:
- Stash Changes: Executes
git stashto save any uncommitted changes. - Fetch Updates: Runs
git fetch --allto fetch all updates from the remote repository. - Checkout Remote Branch: Uses
git checkout -f origin/[branch]to switch to the remote branch. - Checkout Local Branch: Executes
git checkout -f [branch]to switch to the local branch. - Pull Latest Changes: Runs
git pullto pull the latest changes from the remote branch.
- Stash Changes: Executes
-
Disable Maintenance Mode:
- Runs
sys:maintenance --offto turn off maintenance mode after updates are complete.
- Runs
-
-
dev:deploy: This command automates the deployment process for Magento. It handles tasks such as deploying code updates, syncing files, and performing necessary deployment steps to ensure your Magento installation is up-to-date.-
Upgrade Setup:
- Runs
setup:upgradeto apply any database schema updates and configuration changes.
- Runs
-
Compile Dependency Injection:
- Executes
setup:di:compileto compile dependency injection configurations.
- Executes
-
-
dev:deploy:full: This comprehensive deployment command performs a full deployment of the Magento installation. It includes code updates, database migrations, and other essential tasks to ensure that the Magento environment is fully updated and functional. This command performs a full deployment of the Magento installation. It handles the following tasks:-
Branch Detection and Switching:
- Executes the
dev:git:branchcommand to switch to the specified Git branch. Defaults tomasterif no branch is provided.
- Executes the
-
Composer Installation:
- Runs
composer installto ensure that all PHP dependencies are correctly installed.
- Runs
-
User Installation:
- Executes the
dev:install:usercommand to set up user accounts within Magento.
- Executes the
-
Magento Setup and Compilation:
- Runs
setup:upgradeto apply any database schema changes. - Executes
setup:di:compileto compile dependency injection configuration.
- Runs
-
-
dev:install:user: This command simplifies the creation and configuration of user accounts within Magento. It ensures that new users are properly set up with the necessary permissions and configurations, streamlining user management.-
Delete Existing Admin User:
- Executes
admin:user:delete admin -fto forcefully delete the existing admin user with the usernameadmin.
- Executes
-
Create New Admin User:
- Runs
admin:user:createto create a new admin user with the following details:- Username:
admin - Email:
admin@test.com - Password:
admin123 - First Name:
Admin - Last Name:
Admin
- Username:
- Runs
-
-
db:install: Installs a database fromMAGENTO_ROOT/dumpsdirectory with one click. -
db:init: Installs a fresh database and runs post-import actions.- Behavior:
- Activates maintenance mode.
- Executes database installation and sanitization.
- Installs user-related configurations.
- Deactivates maintenance mode.
- Behavior:
-
db:sanitize: Sanitizes database entries as per the defined rules.- Behavior:
- Initiate the database sanitization process.
- Custom actions for sanitization can be added in the command implementation.
- Behavior: