Skip to content

Commit 02f6f5b

Browse files
🔨 Added a patch to copy the jar file and updated toolbox.sh script parameters
1 parent 6769ec0 commit 02f6f5b

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

‎Dockerfile‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22

33
ARG MAVEN_BUILDER_VERSION
44
ARG SONARQUBE_VERSION
5-
ARG ECOCODE_SRC_PATH=/usr/src/ecocode
6-
ARG SONARQUBE_PLUGINS_PATH=/opt/sonarqube/extensions/plugins/
75

86
FROM maven:${MAVEN_BUILDER_VERSION} AS builder
97

8+
ARG ECOCODE_SRC_PATH=/usr/src/ecocode
9+
1010
COPY . ${ECOCODE_SRC_PATH}
1111

1212
WORKDIR ${ECOCODE_SRC_PATH}
1313
RUN ${ECOCODE_SRC_PATH}/toolbox.sh build
1414

1515
FROM sonarqube:${SONARQUBE_VERSION}
16+
17+
ARG ECOCODE_SRC_PATH=/usr/src/ecocode
18+
ARG SONARQUBE_PLUGINS_PATH=/opt/sonarqube/extensions/plugins/
19+
1620
COPY --from=builder ${ECOCODE_SRC_PATH}/target/ecocode-*.jar ${SONARQUBE_PLUGINS_PATH}
1721
USER sonarqube

‎tests/test_toolbox.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,5 @@ def test_release_push(shell):
211211

212212
def test_display_help(shell):
213213
ret = shell.run(script, "display_help", "--test")
214-
assert len(ret.stdout.splitlines()) == 19
214+
assert len(ret.stdout.splitlines()) == 18
215215
assert ret.returncode == 0

‎toolbox.sh‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,11 @@ $(colors 'G')build-docker$(colors 'W') Build Docker services
237237
$(colors 'G')release$(colors 'W') Create a new release
238238
$(colors 'G')release-push$(colors 'W') Push the new release
239239
$(colors 'Y')Options:$(colors 'N')
240+
$(colors 'G')--token=<TOKEN>$(colors 'W') Creating containers with previously created token
241+
$(colors 'G')-v, --verbose$(colors 'W') Make the command more talkative
240242
$(colors 'G')-l, --logs$(colors 'W') Display Docker container logs
241-
$(colors 'G')-p, --push$(colors 'W') Push the new release
242243
$(colors 'G')-f, --force$(colors 'W') To delete the target folder or recompile the source code
243-
$(colors 'G')--token=<TOKEN>$(colors 'W') Creating containers with previously created token
244244
$(colors 'G')-h, --help$(colors 'W') Display help
245-
$(colors 'G')-v, --verbose$(colors 'W') Make the command more talkative
246245
"
247246
echo -e "$output\n"|sed '1d; $d'
248247
return 0
@@ -263,9 +262,9 @@ function check_opts() {
263262
compile) COMPILE=1 ; ARGS+=("$opt") ;;
264263
build-docker) BUILD_DOCKER=1 ; ARGS+=("$opt") ;;
265264
--token=*) ECOCODE_TOKEN=$(echo "$opt"|awk -F= '{print $2}') ;;
266-
--logs) DISPLAY_LOGS=1 ;;
267-
--verbose) VERBOSE=1 ;;
268-
--force) FORCE=1 ;;
265+
--verbose|-v) VERBOSE=1 ;;
266+
--logs|-l) DISPLAY_LOGS=1 ;;
267+
--force|-f) FORCE=1 ;;
269268
--test) TEST=1 ;;
270269
--fixture=*) FIXTURE=$(echo "$opt"|awk -F= '{print $2}') ;;
271270
--help) HELP=1 ;;

0 commit comments

Comments
 (0)