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

🔨 Added toolbox.sh utility script for SonarQube dev environment installation #39

Closed

Conversation

christopherlouet
Copy link
Collaborator

No description provided.

Copy link

sonarqubecloud bot commented May 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@christopherlouet christopherlouet marked this pull request as draft May 5, 2024 17:44
@dedece35
Copy link
Member

Hi @christopherlouet,
PR still in progress ? or OK for review ?

Copy link
Member

@dedece35 dedece35 left a comment

Choose a reason for hiding this comment

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

why do you move "tool_.sh" files on subdirectories ? to have a backup ? because I don't see any usage of these scripts in your toolbox.sh ... but maybe normal ?!
if it's to have a backup, OK ... but once all is ok, we have to remind to delete them and change documentation on "ecoCode-common" repository (where we explain the usage of these scripts)
warning, because, moved scripts won't success because the have to be at the root directory of the repository to succeed

docker.env Outdated
@@ -0,0 +1,3 @@
ECOCODE_DOCKERCOMPOSE_SONAR="sonarqube:10.3.0-community"
ECOCODE_DOCKERCOMPOSE_DATABASE="postgres:12"
ECOCODE_JAVA_PLUGIN_VERSION="1.6.1"
Copy link
Member

Choose a reason for hiding this comment

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

versions of postrgesql and sonarqube don't change often ... ok to manage these versions like that.
but for version plugin (here "1.6.1"), this version change very often, indeed each time we create a new release. Do you think we can find a system to get this plugin version from pom.xml, where the version is automatically managed by maven ?
second think about this plugin version, I think to be strict on version managment, I think we have to put 1.6.1-SNAPHOT here, don't you think ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the easiest way is to extract the version directly from the pom file.
The “SNAPHOT” prefix could be added directly to the script.

toolbox.sh Outdated

# Global variables
HELP=0 INIT=0 START=0 STOP=0 CLEAN=0 DISPLAY_LOGS=0 VERBOSE=0
ECOCODE_JAVA_PLUGIN_JAR="$CURRENT_PATH/target/ecocode-java-plugin-$ECOCODE_JAVA_PLUGIN_VERSION-SNAPSHOT.jar"
Copy link
Member

Choose a reason for hiding this comment

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

same feedback, I think the version will be totally managed with "SNAPSHOT" keyword included

toolbox.sh Outdated
@@ -0,0 +1,240 @@
#!/usr/bin/env bash
Copy link
Member

Choose a reason for hiding this comment

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

WARNING ... there are some contributors on WINDOWS system, not only on Linux or MAC system.
Do you think it's ok for them ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it would be interesting to have a .bat script for Windows users as well.

toolbox.sh Outdated
# @exitcode 1 If docker is not correctly installed.
# @exitcode 2 If java is not installed.
# @exitcode 3 If maven is not installed.
function check_env() {
Copy link
Member

Choose a reason for hiding this comment

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

WARNING ... there is already a documentation and a script to check environment requirements : please check documentation here https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/starter-pack.md#method-1---automatic-check
maybe make a reference on this script (one for unix / MAc users, and one for windows users)

@christopherlouet
Copy link
Collaborator Author

Hi @christopherlouet, PR still in progress ? or OK for review ?

Hi @dedece35, the PR is still in progress. I still have to see about integrating the TOKEN and creating a release.

@christopherlouet
Copy link
Collaborator Author

why do you move "tool_.sh" files on subdirectories ? to have a backup ? because I don't see any usage of these scripts in your toolbox.sh ... but maybe normal ?! if it's to have a backup, OK ... but once all is ok, we have to remind to delete them and change documentation on "ecoCode-common" repository (where we explain the usage of these scripts) warning, because, moved scripts won't success because the have to be at the root directory of the repository to succeed

I'm going to add the root folder to these scripts, so that we can move these scripts into these subfolders.
If we validate this option, I'll update the “ecoCode-common” documentation.

docker.env Outdated
@@ -0,0 +1,2 @@
ECOCODE_DOCKERCOMPOSE_SONAR="sonarqube:10.3.0-community"
Copy link
Member

Choose a reason for hiding this comment

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

"10.5.1-community"

@dedece35 dedece35 requested review from glalloue and removed request for glalloue May 27, 2024 20:14
Copy link

This PR has been automatically marked as stale because it has no activity for 30 days.
Please add a comment if you want to keep the issue open. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants