Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check dependencies script #1018

Merged

Conversation

YevhenZvieriev
Copy link
Contributor

Script Overview

Introduces a script for the swift and straightforward installation of Magento 2, specifically tailored for beginners. The script provides helpful recommendations for dependencies.

Highlighted Features

  • Simple interface for selecting the Magento 2 version.
  • Dependency recommendations tailored to the chosen Magento version.
  • Streamlines the installation process, saving time and effort.

Screenshot_2023-12-07_18-25-55

Screenshot_2023-12-07_18-26-24

Your contributions, feedback, and suggestions are welcome!

Copy link

what-the-diff bot commented Dec 7, 2023

PR Summary

  • Introduction of a New File to Monitor Software Dependencies
    We've added a new file named compose/bin/check-dependencies. This is a script that interacts with the user, specifically asking for their Magento 2 version. Once received, it then provides recommended software dependencies correlating to that version. Key functions in this file are print_magento_versions and print_dependencies. These specifically list out available Magento 2 versions and display the relevant dependencies for a chosen version, respectively. This feature enhances the user's ability to manage software dependencies effectively.

@YevhenZvieriev YevhenZvieriev deleted the feature/magento-software-dependencies branch December 21, 2023 12:03
@YevhenZvieriev YevhenZvieriev restored the feature/magento-software-dependencies branch December 21, 2023 12:03
compose/bin/check-dependencies Outdated Show resolved Hide resolved
compose/bin/check-dependencies Outdated Show resolved Hide resolved
compose/bin/check-dependencies Outdated Show resolved Hide resolved
Copy link
Owner

@markshust markshust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments that still need answers/modifications for

compose/bin/check-dependencies Outdated Show resolved Hide resolved
compose/bin/check-dependencies Outdated Show resolved Hide resolved
Copy link
Owner

@markshust markshust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The shebang is incorrect.
  2. The related documentation needs to be added to the README and related Makefile.
  3. I'm getting errors when running this script:
~/Sites/magento246-p4 bin/check-dependencies 
bin/check-dependencies: line 7: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
bin/check-dependencies: line 10: 2.4.7-beta3: syntax error: invalid arithmetic operator (error token is ".4.7-beta3")
bin/check-dependencies: line 11: 2.4.7-beta2: syntax error: invalid arithmetic operator (error token is ".4.7-beta2")
bin/check-dependencies: line 12: 2.4.6-p4: syntax error: invalid arithmetic operator (error token is ".4.6-p4")
bin/check-dependencies: line 13: 2.4.6-p3: syntax error: invalid arithmetic operator (error token is ".4.6-p3")
bin/check-dependencies: line 14: 2.4.6-p2: syntax error: invalid arithmetic operator (error token is ".4.6-p2")
bin/check-dependencies: line 15: 2.4.6-p1: syntax error: invalid arithmetic operator (error token is ".4.6-p1")
bin/check-dependencies: line 16: 2.4.6: syntax error: invalid arithmetic operator (error token is ".4.6")
bin/check-dependencies: line 17: 2.4.5-p5: syntax error: invalid arithmetic operator (error token is ".4.5-p5")
bin/check-dependencies: line 18: 2.4.5-p4: syntax error: invalid arithmetic operator (error token is ".4.5-p4")
bin/check-dependencies: line 19: 2.4.5-p3: syntax error: invalid arithmetic operator (error token is ".4.5-p3")
bin/check-dependencies: line 20: 2.4.5-p2: syntax error: invalid arithmetic operator (error token is ".4.5-p2")
bin/check-dependencies: line 21: 2.4.5-p1: syntax error: invalid arithmetic operator (error token is ".4.5-p1")
bin/check-dependencies: line 22: 2.4.5: syntax error: invalid arithmetic operator (error token is ".4.5")
bin/check-dependencies: line 23: 2.4.4-p6: syntax error: invalid arithmetic operator (error token is ".4.4-p6")
bin/check-dependencies: line 24: 2.4.4-p5: syntax error: invalid arithmetic operator (error token is ".4.4-p5")
bin/check-dependencies: line 25: 2.4.4-p4: syntax error: invalid arithmetic operator (error token is ".4.4-p4")
bin/check-dependencies: line 26: 2.4.4-p3: syntax error: invalid arithmetic operator (error token is ".4.4-p3")
bin/check-dependencies: line 27: 2.4.4-p2: syntax error: invalid arithmetic operator (error token is ".4.4-p2")
bin/check-dependencies: line 28: 2.4.4-p1: syntax error: invalid arithmetic operator (error token is ".4.4-p1")
bin/check-dependencies: line 29: 2.4.4: syntax error: invalid arithmetic operator (error token is ".4.4")
bin/check-dependencies: line 30: 2.4.3-p3: syntax error: invalid arithmetic operator (error token is ".4.3-p3")
bin/check-dependencies: line 31: 2.4.2-p2: syntax error: invalid arithmetic operator (error token is ".4.2-p2")
Enter the Magento 2 version you'd like to check dependencies on:

compose/bin/check-dependencies Outdated Show resolved Hide resolved
@YevhenZvieriev
Copy link
Contributor Author

YevhenZvieriev commented Mar 19, 2024

  1. The shebang was changed from #!/bin/bash to #!/usr/bin/env bash.

  2. I added the documentation to the README and Makefile.

  3. Can you check it again?

The problem is that MacOS uses an older version of Bash by default, which does not support associative arrays (declare -A). To fix this, you need to use bash version 4 or higher.

In my case, the script works perfectly:

jenyamba@Acer-Aspire-A515-47:~/Projects/magento247$ bin/check-dependencies 
Enter the Magento 2 version you'd like to check dependencies on:  2.4.6-p4
Recommended software dependencies:
  • Composer:2.2
  • Elasticsearch:8.5,7.17
  • OpenSearch:2.5
  • MariaDB:10.6
  • MySQL:8.0
  • PHP:8.2,8.1
  • RabbitMQ:3.11,3.9
  • Redis:7.0
  • Varnish:7.3
  • Apache:2.4
  • nginx:1.24
  • 'AWS-Aurora-(MySQL)':8.0
  • 'AWS-S3':✔️
  • 'AWS-MQ':3.9.16
  • 'AWS-ElastiCache':Redis6.2
  • 'AWS-Elasticsearch':--
  • 'AWS-OpenSearch':1.2
jenyamba@Acer-Aspire-A515-47:~

I will fix compatibility with MacOS in the next commit.

@YevhenZvieriev
Copy link
Contributor Author

I added compatibility with MacOS in the previous commit, so now it should work on MacOS.

Please feel free to check it.

@YevhenZvieriev YevhenZvieriev force-pushed the feature/magento-software-dependencies branch from a5f45e7 to 040b212 Compare March 19, 2024 14:56
@markshust
Copy link
Owner

Great, thanks, works as expected! Merging in 👍

@markshust markshust merged commit 3c8a3f0 into markshust:master Mar 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants