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

Integration of the toolbox.sh script and associated unit tests to install the SonarQube development environment #62

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

christopherlouet
Copy link
Collaborator

  • Add toolbox.sh utility script for SonarQube development environment installation
  • Add utils.sh script to launch toolbox commands
  • Addition of the pytest framework for unit testing bash scripts

docker-compose.yml Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
@@ -0,0 +1,336 @@
#!/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.

error during execution of toolbox.sh

   ~/git_ecocode/ecoCode-java   PR_62 ✔  ./toolbox.sh                                                                                                                            
./toolbox.sh: line 14: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
Usage toolbox.sh [OPTIONS] COMMAND
Commands:
init                Initialize and creating containers
start               Starting Docker containers
stop                Stopping Docker containers
clean               Stop and remove containers, networks and volumes
build               Build the ecoCode plugin
compile             Compile the ecoCode plugin
build-docker        Build Docker services
release             Create a new release
release-push        Push the new release
Options:
-l, --logs          Display Docker container logs
-p, --push          Push the new release
-f, --force         To delete the target folder or recompile the source code
--token=<TOKEN>     Creating containers with previously created token
-h, --help          Display help
-v, --verbose       Make the command more talkative

Copy link
Member

Choose a reason for hiding this comment

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

error after checking the result => no plugin deployed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The “declare: -A: invalid option” error is linked to the use of bash on macOS, which is not recent (3.2?). The shebang line “#!/usr/bin/env bash” should have used the most recent version of bash (4.0 or higher) located in /usr/local/bin/bash.
As a precaution, a correction will be made to make the array compatible with bash v3.
The documentation for this script will be updated in the README and the ecoCode-common project today.

Copy link
Member

Choose a reason for hiding this comment

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

ok for correction ... but the main problem is the JAR deployment to correct

utils.sh Show resolved Hide resolved
utils_bash.sh Show resolved Hide resolved
@christopherlouet
Copy link
Collaborator Author

As a first step, I propose to update the script documentation directly in the README, as these new utilities are currently only used in the ecoCode-java project.

…ent. The toolbox.sh script can now be run correctly from this container
Copy link

sonarcloud bot commented Jul 23, 2024

MAVEN_BUILDER_VERSION=3-openjdk-17-slim
SONARQUBE_VERSION=10.6.0-community
POSTGRES_VERSION=12
DOCKER_BUILDKIT=1
Copy link
Member

Choose a reason for hiding this comment

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

put a comment for these 2 options, please

mkdocs.yml Outdated Show resolved Hide resolved
@christopherlouet
Copy link
Collaborator Author

Following on from the last point, here are the changes to be made in the future:

  • add a patch to correctly copy the jar file to the target folder
  • update documentation on environment variables in .default.docker.env file
  • display in the console the port used by the SonarQube web interface
  • don't use mkdocs to view API documutation, the markdown file will suffice for now
  • include a patch in the toolbox.Dockerfile for macOS compatibility
  • externalize tooling in ecoCode-common so that the toolbox can be used in other ecoCode projects
  • create a toolbox-wrapper script to retrieve the toolbox from the ecoCode-Common project
  • include architecture documentation in the ecoCode-common project to explain how the toolbox works

@dedece35 dedece35 added 🏗️ refactoring refactoring for best practices 🔥 in progress 🔥 🚀 enhancement New feature or request labels Jul 25, 2024
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!

@github-actions github-actions bot added the stale label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏗️ refactoring refactoring for best practices 🔥 in progress 🔥 🚀 enhancement New feature or request stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants