-
Notifications
You must be signed in to change notification settings - Fork 24
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
christopherlouet
wants to merge
16
commits into
green-code-initiative:main
Choose a base branch
from
christopherlouet:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
08b3e51
🔨 Initialize the toolbox.sh script to install the SonarQube developme…
christopherlouet edb4ea1
🔨 Initializing unit tests for bash scripts with pytest
christopherlouet 7790373
🔨 Add utils.sh script to launch toolbox commands
christopherlouet c682295
🔨 Added utils_bash.sh script to run unit tests and generate documenta…
christopherlouet cb55031
🔨 Added release functions and updated bash documentation
christopherlouet e2210cc
🔨 Update release function
christopherlouet 59a2b92
🔨 Update the pytest environment and add various fix
christopherlouet acc0891
🔨 Merge of release 1.6.2
christopherlouet 708c6d5
Merge branch 'main' into main
christopherlouet 96e76ae
🔨 Updated utils.sh to start a container with docker and java environm…
christopherlouet 85ff7b3
🔨 Added fixes to the toolbox.sh script and updated unit tests.
christopherlouet 2cb42db
🔨 Add a github action for Bash Tests
christopherlouet 6769ec0
🔨 Add condition for publishing image in github action
christopherlouet 02f6f5b
🔨 Added a patch to copy the jar file and updated toolbox.sh script pa…
christopherlouet c8cba33
🔨 Add SONAR_LOG_LEVEL_WEB environment variable
christopherlouet b7fec57
test toolbox
christopherlouet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
MAVEN_BUILDER_VERSION=3-openjdk-17-slim | ||
SONARQUBE_VERSION=10.6.0-community | ||
POSTGRES_VERSION=12 | ||
DOCKER_BUILDKIT=1 | ||
COMPOSE_DOCKER_CLI_BUILD=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
# Ignore IDE files | ||
*.iml | ||
.idea | ||
|
||
# Ignore all files and folders starting with ".", except a few exceptions | ||
.* | ||
!.gitignore | ||
!.gitattributes | ||
!.github/ | ||
!.default.docker.env | ||
|
||
# Ignore generated files | ||
target | ||
bin | ||
dependency-reduced-pom.xml | ||
|
||
# Ignore IDE files | ||
*.iml | ||
release.properties | ||
pom.xml.* | ||
tests/__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
ARG MAVEN_BUILDER=3-openjdk-17-slim | ||
ARG SONARQUBE_VERSION=10.6.0-community | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM maven:${MAVEN_BUILDER} AS builder | ||
ARG MAVEN_BUILDER_VERSION | ||
ARG SONARQUBE_VERSION | ||
ARG ECOCODE_SRC_PATH=/usr/src/ecocode | ||
ARG SONARQUBE_PLUGINS_PATH=/opt/sonarqube/extensions/plugins/ | ||
|
||
COPY . /usr/src/ecocode | ||
FROM maven:${MAVEN_BUILDER_VERSION} AS builder | ||
|
||
WORKDIR /usr/src/ecocode | ||
COPY src src/ | ||
COPY pom.xml tool_build.sh ./ | ||
COPY . ${ECOCODE_SRC_PATH} | ||
|
||
RUN ./tool_build.sh | ||
WORKDIR ${ECOCODE_SRC_PATH} | ||
RUN ${ECOCODE_SRC_PATH}/toolbox.sh build | ||
|
||
FROM sonarqube:${SONARQUBE_VERSION} | ||
COPY --from=builder /usr/src/ecocode/target/ecocode-*.jar /opt/sonarqube/extensions/plugins/ | ||
COPY --from=builder ${ECOCODE_SRC_PATH}/target/ecocode-*.jar ${SONARQUBE_PLUGINS_PATH} | ||
USER sonarqube |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
# toolbox.sh | ||
|
||
## Overview | ||
|
||
This toolbox enables you to install the SonarQube dev environment. | ||
|
||
## Index | ||
|
||
* [docker_env_source](#dockerenvsource) | ||
* [docker_build](#dockerbuild) | ||
* [init](#init) | ||
* [start](#start) | ||
* [stop](#stop) | ||
* [clean](#clean) | ||
* [display_logs](#displaylogs) | ||
* [build](#build) | ||
* [compile](#compile) | ||
* [release](#release) | ||
* [release_push](#releasepush) | ||
* [display_help](#displayhelp) | ||
|
||
### docker_env_source | ||
|
||
Export environment variables from .default.docker.env file. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If the environment file cannot be found. | ||
|
||
### docker_build | ||
|
||
Build Docker services. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error was encountered retrieving environment variables. | ||
* **2**: If an error has been encountered when building services. | ||
|
||
### init | ||
|
||
Building the ecoCode plugin and creating containers. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error was encountered when building project code in the target folder. | ||
* **2**: If an error was encountered retrieving environment variables. | ||
* **3**: If an error was encountered during container creating. | ||
|
||
### start | ||
|
||
Starting Docker containers. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If the ecoCode plugin is not present in the target folder. | ||
* **2**: If an error was encountered retrieving environment variables. | ||
* **3**: If an error was encountered during container startup. | ||
|
||
### stop | ||
|
||
Stopping Docker containers. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error was encountered retrieving environment variables. | ||
* **2**: If an error was encountered during container shutdown. | ||
|
||
### clean | ||
|
||
Stop and remove containers, networks and volumes. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error was encountered retrieving environment variables. | ||
* **2**: If an error was encountered during deletion. | ||
|
||
### display_logs | ||
|
||
Display Docker container logs. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error was encountered retrieving environment variables. | ||
|
||
### build | ||
|
||
Compile and package source code with maven. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error was encountered when building source code. | ||
* **2**: If the ecoCode plugin in target directory cannot be found. | ||
|
||
### compile | ||
|
||
Compile source code with maven. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error was encountered when compiling the source code. | ||
|
||
### release | ||
|
||
Use maven plugin release to prepare locally next release and next SNAPSHOT. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If an error is encountered when prepare the release. | ||
* **2**: If an error is encountered when cleaning files. | ||
|
||
### release_push | ||
|
||
Create a push and a new branch with commits previously prepared | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
* **1**: If the last commit tag does not match the last git tag. | ||
|
||
### display_help | ||
|
||
Display help. | ||
|
||
#### Exit codes | ||
|
||
* **0**: If successful. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
site_name: ecoCode-java | ||
christopherlouet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
repo_url: https://github.com/green-code-initiative/ecoCode-java/ | ||
site_description: Documentation based on ecoCode bash scripts | ||
nav: | ||
- index.md | ||
theme: | ||
name: material | ||
palette: | ||
scheme: slate | ||
primary: purple | ||
accent: cyan | ||
features: | ||
- navigation.tabs | ||
- navigation.tabs.sticky | ||
- navigation.sections | ||
plugins: | ||
- search | ||
- include_dir_to_nav: | ||
sort_file: true | ||
sort_directory: true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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