Skip to content

Commit

Permalink
fix(green-code-initiative#46): add jq in requirements documentation a…
Browse files Browse the repository at this point in the history
…nd scripts
  • Loading branch information
PREISNER Julien committed May 29, 2024
1 parent 588b734 commit a21d4ce
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
15 changes: 9 additions & 6 deletions doc/starter-pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ This section is to help you to install and configure your first environment to d

### Requirements

These tools are necessary :
- `Docker` : <https://docs.docker.com/get-docker/>
- `Docker-compose` : <https://docs.docker.com/compose/install/>
- `Java` JDK (and not only JRE) for Sonarqube plugin Development : <https://www.java.com/fr/download/manual.jsp>
- `Maven` for Sonarqube plugin Development : <https://maven.apache.org/download.cgi>
- `Git` : <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>
- `jq` : <https://jqlang.github.io/jq/download/>. If you need to install `jq`, you can launch `tools/check_requirements/install_jq.bat`

#### Method 1 - Automatic check (default method)

In the current repository, go to `tools/check_requirements` directory.
Expand All @@ -92,12 +100,6 @@ PS : if you have some problems with this script, please feel free to create a ne

#### Method 2 - Manual check (if above "method 1" doesn't work)

- `Docker` : <https://docs.docker.com/get-docker/>
- `Docker-compose` : <https://docs.docker.com/compose/install/>
- `Java` JDK (and not only JRE) for Sonarqube plugin Development : <https://www.java.com/fr/download/manual.jsp>
- `Maven` for Sonarqube plugin Development : <https://maven.apache.org/download.cgi>
- `Git` : <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>

If you want, you can check following file to know what are min and max versions for each tool : <https://github.com/green-code-initiative/ecoCode-common/blob/main/tools/check_requirements/config.txt>

Then launch check commands as follows (and check versions displayed) :
Expand All @@ -108,6 +110,7 @@ docker-compose --version
javap -version
mvn --version
git --version
jq --version
```

### Get source code
Expand Down
2 changes: 2 additions & 0 deletions tools/check_requirements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ For Mac OSX and Linux :
For Windows :

- `check_requirements.bat` : tool checker for Windows
- `install_jq.bat` : script to install easily `jq` for Windows with `winget`

Common files:

Expand All @@ -40,6 +41,7 @@ Common files:
## How does it work?

- [OPTIONAL] change the configuration in `config.txt` file
- [OPTIONAL] launch `install_jq.bat` if you need to install `jq` for Windows

For Mac OSX and Linux :

Expand Down
8 changes: 8 additions & 0 deletions tools/check_requirements/check_requirements.bat
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,12 @@ if errorlevel 1 (
echo [OK] Git is installed.
)

:: Check jq
call jq --version >nul 2>&1
if errorlevel 1 (
echo [FAIL] jq is not installed.
) else (
echo [OK] jq is installed.
)

endlocal
4 changes: 4 additions & 0 deletions tools/check_requirements/check_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ check_installation "docker --version"

echo -e "***** Docker-compose 🚀"
check_installation "docker-compose --version"
check_installation "docker-compose --version"

echo -e "***** Java 🚀"
check_installation "javap -version"
Expand All @@ -31,3 +32,6 @@ check_version_max_maven "$mvn_version" "$MAVEN_VERSION_MAX"

echo -e "***** Git 🚀"
check_installation "git --version"

echo -e "***** jq 🚀"
check_installation "jq --version"
4 changes: 4 additions & 0 deletions tools/check_requirements/install_jq.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off

:: install jq
call winget install jqlang.jq

0 comments on commit a21d4ce

Please sign in to comment.