Skip to content

Commit

Permalink
🔨 Added a patch to copy the jar file and updated toolbox.sh script pa…
Browse files Browse the repository at this point in the history
…rameters
  • Loading branch information
christopherlouet committed Jul 24, 2024
1 parent 6769ec0 commit 02f6f5b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

ARG MAVEN_BUILDER_VERSION
ARG SONARQUBE_VERSION
ARG ECOCODE_SRC_PATH=/usr/src/ecocode
ARG SONARQUBE_PLUGINS_PATH=/opt/sonarqube/extensions/plugins/

FROM maven:${MAVEN_BUILDER_VERSION} AS builder

ARG ECOCODE_SRC_PATH=/usr/src/ecocode

COPY . ${ECOCODE_SRC_PATH}

WORKDIR ${ECOCODE_SRC_PATH}
RUN ${ECOCODE_SRC_PATH}/toolbox.sh build

FROM sonarqube:${SONARQUBE_VERSION}

ARG ECOCODE_SRC_PATH=/usr/src/ecocode
ARG SONARQUBE_PLUGINS_PATH=/opt/sonarqube/extensions/plugins/

COPY --from=builder ${ECOCODE_SRC_PATH}/target/ecocode-*.jar ${SONARQUBE_PLUGINS_PATH}
USER sonarqube
2 changes: 1 addition & 1 deletion tests/test_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ def test_release_push(shell):

def test_display_help(shell):
ret = shell.run(script, "display_help", "--test")
assert len(ret.stdout.splitlines()) == 19
assert len(ret.stdout.splitlines()) == 18
assert ret.returncode == 0
11 changes: 5 additions & 6 deletions toolbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,11 @@ $(colors 'G')build-docker$(colors 'W') Build Docker services
$(colors 'G')release$(colors 'W') Create a new release
$(colors 'G')release-push$(colors 'W') Push the new release
$(colors 'Y')Options:$(colors 'N')
$(colors 'G')--token=<TOKEN>$(colors 'W') Creating containers with previously created token
$(colors 'G')-v, --verbose$(colors 'W') Make the command more talkative
$(colors 'G')-l, --logs$(colors 'W') Display Docker container logs
$(colors 'G')-p, --push$(colors 'W') Push the new release
$(colors 'G')-f, --force$(colors 'W') To delete the target folder or recompile the source code
$(colors 'G')--token=<TOKEN>$(colors 'W') Creating containers with previously created token
$(colors 'G')-h, --help$(colors 'W') Display help
$(colors 'G')-v, --verbose$(colors 'W') Make the command more talkative
"
echo -e "$output\n"|sed '1d; $d'
return 0
Expand All @@ -263,9 +262,9 @@ function check_opts() {
compile) COMPILE=1 ; ARGS+=("$opt") ;;
build-docker) BUILD_DOCKER=1 ; ARGS+=("$opt") ;;
--token=*) ECOCODE_TOKEN=$(echo "$opt"|awk -F= '{print $2}') ;;
--logs) DISPLAY_LOGS=1 ;;
--verbose) VERBOSE=1 ;;
--force) FORCE=1 ;;
--verbose|-v) VERBOSE=1 ;;
--logs|-l) DISPLAY_LOGS=1 ;;
--force|-f) FORCE=1 ;;
--test) TEST=1 ;;
--fixture=*) FIXTURE=$(echo "$opt"|awk -F= '{print $2}') ;;
--help) HELP=1 ;;
Expand Down

0 comments on commit 02f6f5b

Please sign in to comment.