From 7e886c61923bd6b1a7af55c89a4512c9015bcb6c Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:10:34 +0100 Subject: [PATCH 01/46] feat: add sonarqube gradle plugin and sonarqube instance properties. GNP-5622. --- build.gradle.kts | 3 +++ gradle.properties | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 gradle.properties diff --git a/build.gradle.kts b/build.gradle.kts index e69de29b..24155372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.sonarqube") version "2.8" +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..8ad10a6c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,5 @@ +# gradle.properties +systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube + +#----- Token generated from an account with 'publish analysis' permission +systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 -- GitLab From 277a875c477f7f86c2d0d08e168d19a6f01fb902 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:24:50 +0100 Subject: [PATCH 02/46] feat: add sonarqube analysis step in test stage. GNP-5622. --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2459b62..830cda70 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,6 +68,10 @@ test-backend: junit: - "./backend/build/test-results/test/TEST-*.xml" +sonarqube-analysis: + stage: test + script: "./gradlew sonarqube" + # BUILD -- GitLab From e0b0c14d224e2499d867fa94d3e3a6b120efa3f3 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:44:10 +0100 Subject: [PATCH 03/46] feat: add elasticsearch service name to sonarqube-analysis step. GNP-5622. --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 830cda70..689f938d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,6 +71,20 @@ test-backend: sonarqube-analysis: stage: test script: "./gradlew sonarqube" + services: + # even if that would be ideal + # we can't just launch the service with just elasticsearch:6.3.1 + # because we need to pass some variables, but they are passed to _all_ containers + # so they fail the start of other docker images like urgi/docker-browsers + # the only solution is to override the entrypoint of the service and pass the arguments manually + - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 + alias: elasticsearch + # discovery.type=single-node + # single-node is necessary to start in development mode + # so there will be no bootstrap checks that would fail on CI + # especially the error regarding + # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` + command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] # BUILD -- GitLab From 7ffa8e6d2ce943ca9f42056836d9d462e394e8a0 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:53:43 +0100 Subject: [PATCH 04/46] feat: downgrade sonarqube plugin version from 2.8 to 2.7. GNP-5622. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24155372..342587ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.8" + id("org.sonarqube") version "2.7" } -- GitLab From b5234cc5fd2a4269d8309cf372c4090e5fd1e2dc Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 18 Feb 2020 14:42:09 +0100 Subject: [PATCH 05/46] chore: automatically updated file by IntelliJ. GNP-5622. --- .idea/compiler.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 677323ac..8b06b981 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> + <annotationProcessing> + <profile name="Gradle Imported" enabled="true"> + <outputRelativeToContentRoot value="true" /> + <processorPath useClasspath="false"> + <entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-configuration-processor/2.1.2.RELEASE/db9671c321defb942a6700fae8a7700a137a25e/spring-boot-configuration-processor-2.1.2.RELEASE.jar" /> + </processorPath> + <module name="faidare.backend.main" /> + </profile> + </annotationProcessing> <bytecodeTargetLevel> <module name="faidare.backend.main" target="1.8" /> <module name="faidare.backend.test" target="1.8" /> -- GitLab From e7e858219407143ccb06120fe67ccef712b9e05b Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 18 Feb 2020 14:43:17 +0100 Subject: [PATCH 06/46] feat: update command used to launch sonarqube in CI. Declare sonarqube plugin. Add properties for typescript code source analysis. GNP-5622. --- .gitlab-ci.yml | 2 +- backend/build.gradle.kts | 1 + build.gradle.kts | 2 +- frontend/build.gradle.kts | 1 + gradle.properties | 7 +++++++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 689f938d..30b5936b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,7 +70,7 @@ test-backend: sonarqube-analysis: stage: test - script: "./gradlew sonarqube" + script: "./gradlew :backend:test :frontend:test --parallel sonarqube" services: # even if that would be ideal # we can't just launch the service with just elasticsearch:6.3.1 diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index c15af8da..e80e4269 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -16,6 +16,7 @@ plugins { id("org.springframework.boot") version "2.1.2.RELEASE" id("com.gorylenko.gradle-git-properties") version "1.5.2" id("io.spring.dependency-management") version "1.0.6.RELEASE" + id("org.sonarqube") } diff --git a/build.gradle.kts b/build.gradle.kts index 342587ea..24155372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.7" + id("org.sonarqube") version "2.8" } diff --git a/frontend/build.gradle.kts b/frontend/build.gradle.kts index bb0567fa..c86af189 100644 --- a/frontend/build.gradle.kts +++ b/frontend/build.gradle.kts @@ -3,6 +3,7 @@ import com.moowork.gradle.node.npm.NpmTask plugins { base id("com.moowork.node") version "1.2.0" + id("org.sonarqube") } val isCi = System.getenv("CI") != null diff --git a/gradle.properties b/gradle.properties index 8ad10a6c..41041374 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,3 +3,10 @@ systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube #----- Token generated from an account with 'publish analysis' permission systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 + +systemProp.sonar.sources=frontend/src +systemProp.sonar.language=typescript +systemProp.sonar.scm.provider=git +systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json +systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info +systemProp.sonar.typescript.node=/tmp/node/node-v10.13.0/bin/node -- GitLab From 4e70b7d682c88f97b8b7500b8313685b976364d2 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 2 Jul 2020 10:59:54 +0200 Subject: [PATCH 07/46] chore: update project files. --- .idea/compiler.xml | 5 +---- .idea/misc.xml | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 8b06b981..ca99a00e 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -10,9 +10,6 @@ <module name="faidare.backend.main" /> </profile> </annotationProcessing> - <bytecodeTargetLevel> - <module name="faidare.backend.main" target="1.8" /> - <module name="faidare.backend.test" target="1.8" /> - </bytecodeTargetLevel> + <bytecodeTargetLevel target="1.8" /> </component> </project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index e208459b..ff8249e4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="FrameworkDetectionExcludesConfiguration"> + <file type="web" url="file://$PROJECT_DIR$" /> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> \ No newline at end of file -- GitLab From ba5a846388a84ca1d0a35704ec95fbc08567a193 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:10:34 +0100 Subject: [PATCH 08/46] feat: add sonarqube gradle plugin and sonarqube instance properties. GNP-5622. --- build.gradle.kts | 3 +++ gradle.properties | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 gradle.properties diff --git a/build.gradle.kts b/build.gradle.kts index e69de29b..24155372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.sonarqube") version "2.8" +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..8ad10a6c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,5 @@ +# gradle.properties +systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube + +#----- Token generated from an account with 'publish analysis' permission +systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 -- GitLab From 4d4161857eba20f4a4985a6b2a4e65e30a041c56 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:24:50 +0100 Subject: [PATCH 09/46] feat: add sonarqube analysis step in test stage. GNP-5622. --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa9555fc..1214ab6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,6 +75,10 @@ test-backend: junit: - "./backend/build/test-results/test/TEST-*.xml" +sonarqube-analysis: + stage: test + script: "./gradlew sonarqube" + # BUILD -- GitLab From 7557b9ef18843efac13b02b75cc02cedcfcdc323 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:44:10 +0100 Subject: [PATCH 10/46] feat: add elasticsearch service name to sonarqube-analysis step. GNP-5622. --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1214ab6d..daeb6e7e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,6 +78,20 @@ test-backend: sonarqube-analysis: stage: test script: "./gradlew sonarqube" + services: + # even if that would be ideal + # we can't just launch the service with just elasticsearch:6.3.1 + # because we need to pass some variables, but they are passed to _all_ containers + # so they fail the start of other docker images like urgi/docker-browsers + # the only solution is to override the entrypoint of the service and pass the arguments manually + - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 + alias: elasticsearch + # discovery.type=single-node + # single-node is necessary to start in development mode + # so there will be no bootstrap checks that would fail on CI + # especially the error regarding + # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` + command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] # BUILD -- GitLab From aff90b92c53cec815239610708156d69dcabfebe Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:53:43 +0100 Subject: [PATCH 11/46] feat: downgrade sonarqube plugin version from 2.8 to 2.7. GNP-5622. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24155372..342587ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.8" + id("org.sonarqube") version "2.7" } -- GitLab From e5daf15219146008d606620def5ba078a6b9ece5 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 18 Feb 2020 14:42:09 +0100 Subject: [PATCH 12/46] chore: automatically updated file by IntelliJ. GNP-5622. --- .idea/compiler.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 677323ac..8b06b981 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> + <annotationProcessing> + <profile name="Gradle Imported" enabled="true"> + <outputRelativeToContentRoot value="true" /> + <processorPath useClasspath="false"> + <entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-configuration-processor/2.1.2.RELEASE/db9671c321defb942a6700fae8a7700a137a25e/spring-boot-configuration-processor-2.1.2.RELEASE.jar" /> + </processorPath> + <module name="faidare.backend.main" /> + </profile> + </annotationProcessing> <bytecodeTargetLevel> <module name="faidare.backend.main" target="1.8" /> <module name="faidare.backend.test" target="1.8" /> -- GitLab From e833ee62de70ce957efd2843f908309645d779e3 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 18 Feb 2020 14:43:17 +0100 Subject: [PATCH 13/46] feat: update command used to launch sonarqube in CI. Declare sonarqube plugin. Add properties for typescript code source analysis. GNP-5622. --- .gitlab-ci.yml | 2 +- backend/build.gradle.kts | 1 + build.gradle.kts | 2 +- frontend/build.gradle.kts | 1 + gradle.properties | 7 +++++++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index daeb6e7e..2d12d314 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,7 +77,7 @@ test-backend: sonarqube-analysis: stage: test - script: "./gradlew sonarqube" + script: "./gradlew :backend:test :frontend:test --parallel sonarqube" services: # even if that would be ideal # we can't just launch the service with just elasticsearch:6.3.1 diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index c15af8da..e80e4269 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -16,6 +16,7 @@ plugins { id("org.springframework.boot") version "2.1.2.RELEASE" id("com.gorylenko.gradle-git-properties") version "1.5.2" id("io.spring.dependency-management") version "1.0.6.RELEASE" + id("org.sonarqube") } diff --git a/build.gradle.kts b/build.gradle.kts index 342587ea..24155372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.7" + id("org.sonarqube") version "2.8" } diff --git a/frontend/build.gradle.kts b/frontend/build.gradle.kts index bb0567fa..c86af189 100644 --- a/frontend/build.gradle.kts +++ b/frontend/build.gradle.kts @@ -3,6 +3,7 @@ import com.moowork.gradle.node.npm.NpmTask plugins { base id("com.moowork.node") version "1.2.0" + id("org.sonarqube") } val isCi = System.getenv("CI") != null diff --git a/gradle.properties b/gradle.properties index 8ad10a6c..41041374 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,3 +3,10 @@ systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube #----- Token generated from an account with 'publish analysis' permission systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 + +systemProp.sonar.sources=frontend/src +systemProp.sonar.language=typescript +systemProp.sonar.scm.provider=git +systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json +systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info +systemProp.sonar.typescript.node=/tmp/node/node-v10.13.0/bin/node -- GitLab From e154205e16f6eaf1db406fa39353689812a01bff Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 2 Jul 2020 10:59:54 +0200 Subject: [PATCH 14/46] chore: update project files. --- .idea/compiler.xml | 5 +---- .idea/misc.xml | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 8b06b981..ca99a00e 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -10,9 +10,6 @@ <module name="faidare.backend.main" /> </profile> </annotationProcessing> - <bytecodeTargetLevel> - <module name="faidare.backend.main" target="1.8" /> - <module name="faidare.backend.test" target="1.8" /> - </bytecodeTargetLevel> + <bytecodeTargetLevel target="1.8" /> </component> </project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index e208459b..ff8249e4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="FrameworkDetectionExcludesConfiguration"> + <file type="web" url="file://$PROJECT_DIR$" /> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> \ No newline at end of file -- GitLab From 08b0993a98411e751e923c9f368b02d0bcfd7f25 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 30 Jul 2020 14:25:34 +0200 Subject: [PATCH 15/46] feat: pull all tests and sonarqube jobs in a single one. Add sonarqube properties. GNP-5622. --- .gitlab-ci.yml | 104 +++++++++++++++++++++++++++++++++------------- gradle.properties | 6 ++- 2 files changed, 78 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d12d314..bdf8ba4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,22 +40,46 @@ lint: script: "./gradlew lint" -test-frontend: - stage: test - tags: - - openstack - script: "./gradlew :frontend:test --parallel" - artifacts: - reports: - junit: - - "./frontend/karma-junit-tests-report/TEST*.xml" +#test-frontend: +# stage: test +# tags: +# - openstack +# script: "./gradlew :frontend:test --parallel" +# artifacts: +# reports: +# junit: +# - "./frontend/karma-junit-tests-report/TEST*.xml" -test-backend: +#test-backend: +# stage: test +# tags: +# - openstack +# script: "./gradlew :backend:test --parallel" +# services: +# # even if that would be ideal +# # we can't just launch the service with just elasticsearch:6.3.1 +# # because we need to pass some variables, but they are passed to _all_ containers +# # so they fail the start of other docker images like urgi/docker-browsers +# # the only solution is to override the entrypoint of the service and pass the arguments manually +# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 +# alias: elasticsearch +# # discovery.type=single-node +# # single-node is necessary to start in development mode +# # so there will be no bootstrap checks that would fail on CI +# # especially the error regarding +# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` +# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] +# artifacts: +# reports: +# junit: +# - "./backend/build/test-results/test/TEST-*.xml" + +test-and-sonarqube: stage: test tags: - - openstack - script: "./gradlew :backend:test --parallel" + - openstack + # the backend tests need an elasticsearch instance services: # even if that would be ideal # we can't just launch the service with just elasticsearch:6.3.1 @@ -70,28 +94,48 @@ test-backend: # especially the error regarding # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] + variables: + GRADLE_OPTS: "-Dorg.gradle.daemon=true" + script: + - ./gradlew --parallel test + - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; + - export PATH="/tmp/node/:$PATH" + - ./gradlew sonarqube -x test + cache: + key: "$CI_COMMIT_REF_NAME" + policy: pull-push + paths: + - .gradle + - frontend/.gradle/ + - frontend/node_modules/ artifacts: reports: junit: - - "./backend/build/test-results/test/TEST-*.xml" + - ./backend/build/test-results/test/TEST-*.xml + - ./frontend/karma-junit-tests-report/TEST*.xml + only: + changes: + - backend/src/**/* + - frontend/**/* -sonarqube-analysis: - stage: test - script: "./gradlew :backend:test :frontend:test --parallel sonarqube" - services: - # even if that would be ideal - # we can't just launch the service with just elasticsearch:6.3.1 - # because we need to pass some variables, but they are passed to _all_ containers - # so they fail the start of other docker images like urgi/docker-browsers - # the only solution is to override the entrypoint of the service and pass the arguments manually - - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 - alias: elasticsearch - # discovery.type=single-node - # single-node is necessary to start in development mode - # so there will be no bootstrap checks that would fail on CI - # especially the error regarding - # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` - command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] + +#sonarqube-analysis: +# stage: test +# script: "./gradlew :backend:test :frontend:test --parallel sonarqube" +# services: +# # even if that would be ideal +# # we can't just launch the service with just elasticsearch:6.3.1 +# # because we need to pass some variables, but they are passed to _all_ containers +# # so they fail the start of other docker images like urgi/docker-browsers +# # the only solution is to override the entrypoint of the service and pass the arguments manually +# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 +# alias: elasticsearch +# # discovery.type=single-node +# # single-node is necessary to start in development mode +# # so there will be no bootstrap checks that would fail on CI +# # especially the error regarding +# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` +# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] # BUILD diff --git a/gradle.properties b/gradle.properties index 41041374..765b02c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # gradle.properties -systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube +systemProp.sonar.host.url=https://urgi.versailles.inrae.fr/sonarqube #----- Token generated from an account with 'publish analysis' permission systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 @@ -9,4 +9,6 @@ systemProp.sonar.language=typescript systemProp.sonar.scm.provider=git systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info -systemProp.sonar.typescript.node=/tmp/node/node-v10.13.0/bin/node +#systemProp.sonar.typescript.node=/tmp/node/node-v12.14.1-linux-x64/bin/node +systemProp.sonar.typescript.node=/tmp/node/node +systemProp.sonar.typescript.exclusions=**/*.spec.ts -- GitLab From 4a4ee61605ac86b86290b6394f538d59a5a9285c Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 30 Jul 2020 16:32:49 +0200 Subject: [PATCH 16/46] chore: remove commented code. GNP-5622. --- .gitlab-ci.yml | 54 -------------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bdf8ba4f..18d397cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,41 +40,6 @@ lint: script: "./gradlew lint" -#test-frontend: -# stage: test -# tags: -# - openstack -# script: "./gradlew :frontend:test --parallel" -# artifacts: -# reports: -# junit: -# - "./frontend/karma-junit-tests-report/TEST*.xml" - - -#test-backend: -# stage: test -# tags: -# - openstack -# script: "./gradlew :backend:test --parallel" -# services: -# # even if that would be ideal -# # we can't just launch the service with just elasticsearch:6.3.1 -# # because we need to pass some variables, but they are passed to _all_ containers -# # so they fail the start of other docker images like urgi/docker-browsers -# # the only solution is to override the entrypoint of the service and pass the arguments manually -# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 -# alias: elasticsearch -# # discovery.type=single-node -# # single-node is necessary to start in development mode -# # so there will be no bootstrap checks that would fail on CI -# # especially the error regarding -# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` -# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] -# artifacts: -# reports: -# junit: -# - "./backend/build/test-results/test/TEST-*.xml" - test-and-sonarqube: stage: test tags: @@ -119,25 +84,6 @@ test-and-sonarqube: - frontend/**/* -#sonarqube-analysis: -# stage: test -# script: "./gradlew :backend:test :frontend:test --parallel sonarqube" -# services: -# # even if that would be ideal -# # we can't just launch the service with just elasticsearch:6.3.1 -# # because we need to pass some variables, but they are passed to _all_ containers -# # so they fail the start of other docker images like urgi/docker-browsers -# # the only solution is to override the entrypoint of the service and pass the arguments manually -# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 -# alias: elasticsearch -# # discovery.type=single-node -# # single-node is necessary to start in development mode -# # so there will be no bootstrap checks that would fail on CI -# # especially the error regarding -# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` -# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] - - # BUILD -- GitLab From 6fc19d5d1e796e3dea5f1b284cc253c1efefed36 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 11:35:14 +0200 Subject: [PATCH 17/46] feat: remove gradle cache settings from test-and-sonarqube job because they are already set. GNP-5622. --- .gitlab-ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18d397cf..4bd79bc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,13 +66,6 @@ test-and-sonarqube: - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; - export PATH="/tmp/node/:$PATH" - ./gradlew sonarqube -x test - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull-push - paths: - - .gradle - - frontend/.gradle/ - - frontend/node_modules/ artifacts: reports: junit: -- GitLab From c1b7f2b543407842b10dfd347c8c4ba1e4e4f7bd Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 12:07:04 +0200 Subject: [PATCH 18/46] chore: try to put again the test-frontend job... GNP-5622. --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4bd79bc2..520b38a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,17 @@ lint: script: "./gradlew lint" +test-frontend: + stage: test + tags: + - openstack + script: "./gradlew :frontend:test --parallel" + artifacts: + reports: + junit: + - "./frontend/karma-junit-tests-report/TEST*.xml" + + test-and-sonarqube: stage: test tags: -- GitLab From 7e85b670acf56f6a85cde1ba0ac4f1ff64e91cb9 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 12:14:05 +0200 Subject: [PATCH 19/46] chore: try to use :fronted:test and :backend:test instead of test in test-and-sonarqube job. GNP-5622. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 520b38a9..1de64e92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,7 @@ test-and-sonarqube: variables: GRADLE_OPTS: "-Dorg.gradle.daemon=true" script: - - ./gradlew --parallel test + - ./gradlew :frontend:test :backend:test --parallel - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; - export PATH="/tmp/node/:$PATH" - ./gradlew sonarqube -x test -- GitLab From fb47531abf020a59886fe26942456be22d5d947f Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 13:21:41 +0200 Subject: [PATCH 20/46] chore: remove limitations for the build job. GNP-5622. --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1de64e92..3b97d204 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,11 +101,11 @@ build: paths: - "$JAR_PATH" expire_in: 1 week - only: - changes: - - .gitlab-ci.yml - - backend/src/**/* - - frontend/**/* +# only: +# changes: +# - .gitlab-ci.yml +# - backend/src/**/* +# - frontend/**/* # DEPLOY -- GitLab From e3db1db88339ab7c5518c763108c1162da53c18d Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 13:26:45 +0200 Subject: [PATCH 21/46] chore: remove limitations for the test-and-sonarqube job. GNP-5622. --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b97d204..86365c46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -82,10 +82,10 @@ test-and-sonarqube: junit: - ./backend/build/test-results/test/TEST-*.xml - ./frontend/karma-junit-tests-report/TEST*.xml - only: - changes: - - backend/src/**/* - - frontend/**/* +# only: +# changes: +# - backend/src/**/* +# - frontend/**/* # BUILD -- GitLab From e0e016da685fc44674c6473b60500ea136367e07 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 13:44:19 +0200 Subject: [PATCH 22/46] chore: separate frontend and backend tests in the test-and-sonarqube job. GNP-5622. --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86365c46..7c9c112b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,8 @@ test-and-sonarqube: variables: GRADLE_OPTS: "-Dorg.gradle.daemon=true" script: - - ./gradlew :frontend:test :backend:test --parallel + - ./gradlew :frontend:test --parallel + - ./gradlew :backend:test --parallel - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; - export PATH="/tmp/node/:$PATH" - ./gradlew sonarqube -x test -- GitLab From 72d45751defa2b14604f366b5fb8b3f518b41cc7 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 14:01:32 +0200 Subject: [PATCH 23/46] chore: remove test-frontend job. GNP-5622. --- .gitlab-ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c9c112b..fc5714a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,17 +40,6 @@ lint: script: "./gradlew lint" -test-frontend: - stage: test - tags: - - openstack - script: "./gradlew :frontend:test --parallel" - artifacts: - reports: - junit: - - "./frontend/karma-junit-tests-report/TEST*.xml" - - test-and-sonarqube: stage: test tags: -- GitLab From ffce4ff0239ca7c51c9115da855525944da7dc8b Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:10:34 +0100 Subject: [PATCH 24/46] feat: add sonarqube gradle plugin and sonarqube instance properties. GNP-5622. --- build.gradle.kts | 3 +++ gradle.properties | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 gradle.properties diff --git a/build.gradle.kts b/build.gradle.kts index e69de29b..24155372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.sonarqube") version "2.8" +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..8ad10a6c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,5 @@ +# gradle.properties +systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube + +#----- Token generated from an account with 'publish analysis' permission +systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 -- GitLab From 662d05f31464163429f617237e170e7d162a47fc Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:24:50 +0100 Subject: [PATCH 25/46] feat: add sonarqube analysis step in test stage. GNP-5622. --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa9555fc..1214ab6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,6 +75,10 @@ test-backend: junit: - "./backend/build/test-results/test/TEST-*.xml" +sonarqube-analysis: + stage: test + script: "./gradlew sonarqube" + # BUILD -- GitLab From 7b999f92a067a5cfb6d993cb7e92a9114eae4f84 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:44:10 +0100 Subject: [PATCH 26/46] feat: add elasticsearch service name to sonarqube-analysis step. GNP-5622. --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1214ab6d..daeb6e7e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,6 +78,20 @@ test-backend: sonarqube-analysis: stage: test script: "./gradlew sonarqube" + services: + # even if that would be ideal + # we can't just launch the service with just elasticsearch:6.3.1 + # because we need to pass some variables, but they are passed to _all_ containers + # so they fail the start of other docker images like urgi/docker-browsers + # the only solution is to override the entrypoint of the service and pass the arguments manually + - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 + alias: elasticsearch + # discovery.type=single-node + # single-node is necessary to start in development mode + # so there will be no bootstrap checks that would fail on CI + # especially the error regarding + # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` + command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] # BUILD -- GitLab From 5ee18f9567b4136812e175185489bb3d3e639fbc Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:53:43 +0100 Subject: [PATCH 27/46] feat: downgrade sonarqube plugin version from 2.8 to 2.7. GNP-5622. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24155372..342587ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.8" + id("org.sonarqube") version "2.7" } -- GitLab From 5f55ecb847f79245b00dcc2b153c6e64c2fe93f0 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 18 Feb 2020 14:43:17 +0100 Subject: [PATCH 28/46] feat: update command used to launch sonarqube in CI. Declare sonarqube plugin. Add properties for typescript code source analysis. GNP-5622. --- .gitlab-ci.yml | 2 +- backend/build.gradle.kts | 1 + build.gradle.kts | 2 +- frontend/build.gradle.kts | 1 + gradle.properties | 7 +++++++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index daeb6e7e..2d12d314 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,7 +77,7 @@ test-backend: sonarqube-analysis: stage: test - script: "./gradlew sonarqube" + script: "./gradlew :backend:test :frontend:test --parallel sonarqube" services: # even if that would be ideal # we can't just launch the service with just elasticsearch:6.3.1 diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index c15af8da..e80e4269 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -16,6 +16,7 @@ plugins { id("org.springframework.boot") version "2.1.2.RELEASE" id("com.gorylenko.gradle-git-properties") version "1.5.2" id("io.spring.dependency-management") version "1.0.6.RELEASE" + id("org.sonarqube") } diff --git a/build.gradle.kts b/build.gradle.kts index 342587ea..24155372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.7" + id("org.sonarqube") version "2.8" } diff --git a/frontend/build.gradle.kts b/frontend/build.gradle.kts index bb0567fa..c86af189 100644 --- a/frontend/build.gradle.kts +++ b/frontend/build.gradle.kts @@ -3,6 +3,7 @@ import com.moowork.gradle.node.npm.NpmTask plugins { base id("com.moowork.node") version "1.2.0" + id("org.sonarqube") } val isCi = System.getenv("CI") != null diff --git a/gradle.properties b/gradle.properties index 8ad10a6c..41041374 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,3 +3,10 @@ systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube #----- Token generated from an account with 'publish analysis' permission systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 + +systemProp.sonar.sources=frontend/src +systemProp.sonar.language=typescript +systemProp.sonar.scm.provider=git +systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json +systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info +systemProp.sonar.typescript.node=/tmp/node/node-v10.13.0/bin/node -- GitLab From f4677974821c4a038ce2142fe5d693a64f67adfd Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 2 Jul 2020 10:59:54 +0200 Subject: [PATCH 29/46] chore: update project files. --- .idea/compiler.xml | 5 +---- .idea/misc.xml | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 8b06b981..ca99a00e 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -10,9 +10,6 @@ <module name="faidare.backend.main" /> </profile> </annotationProcessing> - <bytecodeTargetLevel> - <module name="faidare.backend.main" target="1.8" /> - <module name="faidare.backend.test" target="1.8" /> - </bytecodeTargetLevel> + <bytecodeTargetLevel target="1.8" /> </component> </project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index e208459b..ff8249e4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="FrameworkDetectionExcludesConfiguration"> + <file type="web" url="file://$PROJECT_DIR$" /> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> \ No newline at end of file -- GitLab From 223b87f4ab15bd01a0a3fab24a7ccfa0b10d5dc0 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:10:34 +0100 Subject: [PATCH 30/46] feat: add sonarqube gradle plugin and sonarqube instance properties. GNP-5622. --- gradle.properties | 7 ------- 1 file changed, 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index 41041374..8ad10a6c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,3 @@ systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube #----- Token generated from an account with 'publish analysis' permission systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 - -systemProp.sonar.sources=frontend/src -systemProp.sonar.language=typescript -systemProp.sonar.scm.provider=git -systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json -systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info -systemProp.sonar.typescript.node=/tmp/node/node-v10.13.0/bin/node -- GitLab From 7361a0b1d0e18a0c5f94930f8d0220021b11af06 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:24:50 +0100 Subject: [PATCH 31/46] feat: add sonarqube analysis step in test stage. GNP-5622. --- .gitlab-ci.yml | 148 ++++++++++++++++++++----------------------------- 1 file changed, 59 insertions(+), 89 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d12d314..830cda70 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,8 @@ stages: - test - build - - deploy-beta - - deploy-staging - - deploy-production + - staging + - production image: urgi/docker-browsers:latest @@ -35,15 +34,11 @@ cache: lint: stage: test - tags: - - openstack script: "./gradlew lint" test-frontend: stage: test - tags: - - openstack script: "./gradlew :frontend:test --parallel" artifacts: reports: @@ -53,8 +48,6 @@ test-frontend: test-backend: stage: test - tags: - - openstack script: "./gradlew :backend:test --parallel" services: # even if that would be ideal @@ -77,29 +70,13 @@ test-backend: sonarqube-analysis: stage: test - script: "./gradlew :backend:test :frontend:test --parallel sonarqube" - services: - # even if that would be ideal - # we can't just launch the service with just elasticsearch:6.3.1 - # because we need to pass some variables, but they are passed to _all_ containers - # so they fail the start of other docker images like urgi/docker-browsers - # the only solution is to override the entrypoint of the service and pass the arguments manually - - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 - alias: elasticsearch - # discovery.type=single-node - # single-node is necessary to start in development mode - # so there will be no bootstrap checks that would fail on CI - # especially the error regarding - # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` - command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] + script: "./gradlew sonarqube" # BUILD build: - tags: - - openstack stage: build script: - ./gradlew assemble @@ -117,117 +94,110 @@ build: # DEPLOY -.deploy-to-vm-proxmox: &deploy_to_vm_proxmox +.deploy-to-vm: &deploy_to_vm # Hidden job which serves as template for executed jobs below. # See https://docs.gitlab.com/ee/ci/yaml/#anchors retry: 2 - script: - ## SSH initialization + ## SSH initialization + before_script: - eval $(ssh-agent -s) - ssh-add <(echo "${SSH_PRIVATE_KEY}") - - ssh -o StrictHostKeyChecking=no ${SERVER_USER}@${SERVER_IP} 'echo "Successfully connected on $(hostname)"' + - ssh -o StrictHostKeyChecking=no root@${SERVER_IP} 'echo "Successfully connected on $(hostname)"' + script: # Copy jar - - scp ./backend/build/libs/${APP_NAME}.jar ${SERVER_USER}@${SERVER_IP}:/tmp/${APP_NAME}-${ENV}.jar - - ssh ${SERVER_USER}@${SERVER_IP} "sudo mv /tmp/${APP_NAME}-${ENV}.jar /opt/bootapp/${APP_NAME}-${ENV}.jar ; sudo chown -R bootapp:bootapp /opt/bootapp/" + - scp ./$JAR_PATH root@${SERVER_IP}:/opt/bootapp/${APP_NAME}-${ENV}.jar # Restarting service with the updated jar and the according Spring profiles enabled - - ssh ${SERVER_USER}@${SERVER_IP} "sudo systemctl restart bootapp@${APP_NAME}-${ENV}" + - ssh root@${SERVER_IP} "systemctl restart bootapp@${APP_NAME}-${ENV}" - eval $(ssh-agent -k) - echo "Deploy done. Application should be available at http://${SERVER_IP}:${APP_PORT}/${CONTEXT_PATH}" - only: - changes: - - .gitlab-ci.yml - - backend/src/**/* - - frontend/**/* -.deploy-to-vm-openstack: &deploy_to_vm_openstack - # Hidden job which serves as template for executed jobs below. - # See https://docs.gitlab.com/ee/ci/yaml/#anchors - retry: 2 - tags: - - openstack - script: - ## SSH initialization - - eval $(ssh-agent -s) - - ssh-add <(echo "${SSH_PRIVATE_KEY}") - - ssh -o StrictHostKeyChecking=no ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK} 'echo "Successfully connected on $(hostname)"' - # Copy jar - - scp ./backend/build/libs/${APP_NAME}.jar ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK}:/tmp/${APP_NAME}-${ENV}.jar - - ssh ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK} "sudo mv /tmp/${APP_NAME}-${ENV}.jar /opt/bootapp/${APP_NAME}-${ENV}.jar ; sudo chown -R bootapp:bootapp /opt/bootapp/" - # Restarting service with the updated jar and the according Spring profiles enabled - - ssh ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK} "sudo systemctl restart bootapp@${APP_NAME}-${ENV}" - - eval $(ssh-agent -k) - - echo "Deploy done. Application should be available at http://${SERVER_IP_OPENSTACK}:${APP_PORT}/${CONTEXT_PATH}" +deploy-to-staging: + stage: staging + variables: + ENV: staging + APP_PORT: ${STAGING_GPDS_PORT} + CONTEXT_PATH: ${STAGING_GPDS_CONTEXT_PATH} + <<: *deploy_to_vm only: + refs: + - master changes: - .gitlab-ci.yml - backend/src/**/* - frontend/**/* - when: manual - allow_failure: false + deploy-to-beta: - stage: deploy-beta - extends: .deploy-to-vm-openstack + stage: staging variables: - APP_PORT: ${BETA_FAIDARE_PORT} ENV: beta - CONTEXT_PATH: faidare-beta + APP_PORT: ${BETA_GPDS_PORT} + CONTEXT_PATH: ${BETA_GPDS_CONTEXT_PATH} + <<: *deploy_to_vm except: refs: - master only: refs: - branches - when: always - -deploy-to-staging: - stage: deploy-staging - extends: .deploy-to-vm-openstack - variables: - APP_PORT: ${STAGING_FAIDARE_PORT} - ENV: staging - CONTEXT_PATH: faidare-staging - only: - refs: - - branches - except: - refs: - - master + changes: + - .gitlab-ci.yml + - backend/src/**/* + - frontend/**/* when: manual + allow_failure: false + deploy-to-int: - stage: deploy-production - extends: .deploy-to-vm-proxmox + stage: production variables: - APP_PORT: ${INT_FAIDARE_PORT} ENV: int - CONTEXT_PATH: faidare-int + APP_PORT: ${INT_GPDS_PORT} + CONTEXT_PATH: ${INT_GPDS_CONTEXT_PATH} + <<: *deploy_to_vm only: refs: - master + changes: + - .gitlab-ci.yml + - backend/src/**/* + - frontend/**/* when: manual + allow_failure: false + deploy-to-prod-public: - stage: deploy-production - extends: .deploy-to-vm-proxmox + stage: production variables: - APP_PORT: ${PROD_PUBLIC_FAIDARE_PORT} ENV: prod-public - CONTEXT_PATH: faidare + APP_PORT: ${PROD_PUBLIC_GPDS_PORT} + CONTEXT_PATH: ${PROD_PUBLIC_GPDS_CONTEXT_PATH} + <<: *deploy_to_vm only: refs: - master + changes: + - .gitlab-ci.yml + - backend/src/**/* + - frontend/**/* when: manual + allow_failure: false + deploy-to-prod-private: - stage: deploy-production - extends: .deploy-to-vm-proxmox + stage: production variables: - APP_PORT: ${PROD_PRIVATE_FAIDARE_PORT} ENV: prod-private - CONTEXT_PATH: faidare-private + APP_PORT: ${PROD_PRIVATE_GPDS_PORT} + CONTEXT_PATH: ${PROD_PRIVATE_GPDS_CONTEXT_PATH} + <<: *deploy_to_vm only: refs: - master + changes: + - .gitlab-ci.yml + - backend/src/**/* + - frontend/**/* when: manual + allow_failure: false -- GitLab From 0eb7e968ced46f79d8762547b9df88bbd202be44 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:44:10 +0100 Subject: [PATCH 32/46] feat: add elasticsearch service name to sonarqube-analysis step. GNP-5622. --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 830cda70..689f938d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,6 +71,20 @@ test-backend: sonarqube-analysis: stage: test script: "./gradlew sonarqube" + services: + # even if that would be ideal + # we can't just launch the service with just elasticsearch:6.3.1 + # because we need to pass some variables, but they are passed to _all_ containers + # so they fail the start of other docker images like urgi/docker-browsers + # the only solution is to override the entrypoint of the service and pass the arguments manually + - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 + alias: elasticsearch + # discovery.type=single-node + # single-node is necessary to start in development mode + # so there will be no bootstrap checks that would fail on CI + # especially the error regarding + # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` + command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] # BUILD -- GitLab From 51b2e38f8c0276f249637f9a59201cbb4d835fc5 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 10 Dec 2019 14:53:43 +0100 Subject: [PATCH 33/46] feat: downgrade sonarqube plugin version from 2.8 to 2.7. GNP-5622. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24155372..342587ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.8" + id("org.sonarqube") version "2.7" } -- GitLab From 87f32606c37e237e2a96b69fdec1df38765fcf89 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 18 Feb 2020 14:42:09 +0100 Subject: [PATCH 34/46] chore: automatically updated file by IntelliJ. GNP-5622. --- .idea/compiler.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index ca99a00e..8b06b981 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -10,6 +10,9 @@ <module name="faidare.backend.main" /> </profile> </annotationProcessing> - <bytecodeTargetLevel target="1.8" /> + <bytecodeTargetLevel> + <module name="faidare.backend.main" target="1.8" /> + <module name="faidare.backend.test" target="1.8" /> + </bytecodeTargetLevel> </component> </project> \ No newline at end of file -- GitLab From 8c4727a83f6fdc34bf1f0400e982533391ffd11e Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Tue, 18 Feb 2020 14:43:17 +0100 Subject: [PATCH 35/46] feat: update command used to launch sonarqube in CI. Declare sonarqube plugin. Add properties for typescript code source analysis. GNP-5622. --- .gitlab-ci.yml | 2 +- build.gradle.kts | 2 +- gradle.properties | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 689f938d..30b5936b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,7 +70,7 @@ test-backend: sonarqube-analysis: stage: test - script: "./gradlew sonarqube" + script: "./gradlew :backend:test :frontend:test --parallel sonarqube" services: # even if that would be ideal # we can't just launch the service with just elasticsearch:6.3.1 diff --git a/build.gradle.kts b/build.gradle.kts index 342587ea..24155372 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.sonarqube") version "2.7" + id("org.sonarqube") version "2.8" } diff --git a/gradle.properties b/gradle.properties index 8ad10a6c..41041374 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,3 +3,10 @@ systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube #----- Token generated from an account with 'publish analysis' permission systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 + +systemProp.sonar.sources=frontend/src +systemProp.sonar.language=typescript +systemProp.sonar.scm.provider=git +systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json +systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info +systemProp.sonar.typescript.node=/tmp/node/node-v10.13.0/bin/node -- GitLab From f85379bf3449b50c4970d1750362bb3ad2474d7b Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 2 Jul 2020 10:59:54 +0200 Subject: [PATCH 36/46] chore: update project files. --- .idea/compiler.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 8b06b981..ca99a00e 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -10,9 +10,6 @@ <module name="faidare.backend.main" /> </profile> </annotationProcessing> - <bytecodeTargetLevel> - <module name="faidare.backend.main" target="1.8" /> - <module name="faidare.backend.test" target="1.8" /> - </bytecodeTargetLevel> + <bytecodeTargetLevel target="1.8" /> </component> </project> \ No newline at end of file -- GitLab From eb75be969a4adc4dd5887a4f5cd7d7196020040e Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 30 Jul 2020 14:25:34 +0200 Subject: [PATCH 37/46] feat: pull all tests and sonarqube jobs in a single one. Add sonarqube properties. GNP-5622. --- .gitlab-ci.yml | 234 +++++++++++++++++++++++++++++----------------- gradle.properties | 6 +- 2 files changed, 151 insertions(+), 89 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30b5936b..bdf8ba4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,8 +2,9 @@ stages: - test - build - - staging - - production + - deploy-beta + - deploy-staging + - deploy-production image: urgi/docker-browsers:latest @@ -34,21 +35,51 @@ cache: lint: stage: test + tags: + - openstack script: "./gradlew lint" -test-frontend: +#test-frontend: +# stage: test +# tags: +# - openstack +# script: "./gradlew :frontend:test --parallel" +# artifacts: +# reports: +# junit: +# - "./frontend/karma-junit-tests-report/TEST*.xml" + + +#test-backend: +# stage: test +# tags: +# - openstack +# script: "./gradlew :backend:test --parallel" +# services: +# # even if that would be ideal +# # we can't just launch the service with just elasticsearch:6.3.1 +# # because we need to pass some variables, but they are passed to _all_ containers +# # so they fail the start of other docker images like urgi/docker-browsers +# # the only solution is to override the entrypoint of the service and pass the arguments manually +# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 +# alias: elasticsearch +# # discovery.type=single-node +# # single-node is necessary to start in development mode +# # so there will be no bootstrap checks that would fail on CI +# # especially the error regarding +# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` +# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] +# artifacts: +# reports: +# junit: +# - "./backend/build/test-results/test/TEST-*.xml" + +test-and-sonarqube: stage: test - script: "./gradlew :frontend:test --parallel" - artifacts: - reports: - junit: - - "./frontend/karma-junit-tests-report/TEST*.xml" - - -test-backend: - stage: test - script: "./gradlew :backend:test --parallel" + tags: + - openstack + # the backend tests need an elasticsearch instance services: # even if that would be ideal # we can't just launch the service with just elasticsearch:6.3.1 @@ -63,34 +94,56 @@ test-backend: # especially the error regarding # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] + variables: + GRADLE_OPTS: "-Dorg.gradle.daemon=true" + script: + - ./gradlew --parallel test + - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; + - export PATH="/tmp/node/:$PATH" + - ./gradlew sonarqube -x test + cache: + key: "$CI_COMMIT_REF_NAME" + policy: pull-push + paths: + - .gradle + - frontend/.gradle/ + - frontend/node_modules/ artifacts: reports: junit: - - "./backend/build/test-results/test/TEST-*.xml" + - ./backend/build/test-results/test/TEST-*.xml + - ./frontend/karma-junit-tests-report/TEST*.xml + only: + changes: + - backend/src/**/* + - frontend/**/* -sonarqube-analysis: - stage: test - script: "./gradlew :backend:test :frontend:test --parallel sonarqube" - services: - # even if that would be ideal - # we can't just launch the service with just elasticsearch:6.3.1 - # because we need to pass some variables, but they are passed to _all_ containers - # so they fail the start of other docker images like urgi/docker-browsers - # the only solution is to override the entrypoint of the service and pass the arguments manually - - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 - alias: elasticsearch - # discovery.type=single-node - # single-node is necessary to start in development mode - # so there will be no bootstrap checks that would fail on CI - # especially the error regarding - # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` - command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] + +#sonarqube-analysis: +# stage: test +# script: "./gradlew :backend:test :frontend:test --parallel sonarqube" +# services: +# # even if that would be ideal +# # we can't just launch the service with just elasticsearch:6.3.1 +# # because we need to pass some variables, but they are passed to _all_ containers +# # so they fail the start of other docker images like urgi/docker-browsers +# # the only solution is to override the entrypoint of the service and pass the arguments manually +# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 +# alias: elasticsearch +# # discovery.type=single-node +# # single-node is necessary to start in development mode +# # so there will be no bootstrap checks that would fail on CI +# # especially the error regarding +# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` +# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] # BUILD build: + tags: + - openstack stage: build script: - ./gradlew assemble @@ -108,110 +161,117 @@ build: # DEPLOY -.deploy-to-vm: &deploy_to_vm +.deploy-to-vm-proxmox: &deploy_to_vm_proxmox # Hidden job which serves as template for executed jobs below. # See https://docs.gitlab.com/ee/ci/yaml/#anchors retry: 2 - ## SSH initialization - before_script: + script: + ## SSH initialization - eval $(ssh-agent -s) - ssh-add <(echo "${SSH_PRIVATE_KEY}") - - ssh -o StrictHostKeyChecking=no root@${SERVER_IP} 'echo "Successfully connected on $(hostname)"' - script: + - ssh -o StrictHostKeyChecking=no ${SERVER_USER}@${SERVER_IP} 'echo "Successfully connected on $(hostname)"' # Copy jar - - scp ./$JAR_PATH root@${SERVER_IP}:/opt/bootapp/${APP_NAME}-${ENV}.jar + - scp ./backend/build/libs/${APP_NAME}.jar ${SERVER_USER}@${SERVER_IP}:/tmp/${APP_NAME}-${ENV}.jar + - ssh ${SERVER_USER}@${SERVER_IP} "sudo mv /tmp/${APP_NAME}-${ENV}.jar /opt/bootapp/${APP_NAME}-${ENV}.jar ; sudo chown -R bootapp:bootapp /opt/bootapp/" # Restarting service with the updated jar and the according Spring profiles enabled - - ssh root@${SERVER_IP} "systemctl restart bootapp@${APP_NAME}-${ENV}" + - ssh ${SERVER_USER}@${SERVER_IP} "sudo systemctl restart bootapp@${APP_NAME}-${ENV}" - eval $(ssh-agent -k) - echo "Deploy done. Application should be available at http://${SERVER_IP}:${APP_PORT}/${CONTEXT_PATH}" + only: + changes: + - .gitlab-ci.yml + - backend/src/**/* + - frontend/**/* -deploy-to-staging: - stage: staging - variables: - ENV: staging - APP_PORT: ${STAGING_GPDS_PORT} - CONTEXT_PATH: ${STAGING_GPDS_CONTEXT_PATH} - <<: *deploy_to_vm +.deploy-to-vm-openstack: &deploy_to_vm_openstack + # Hidden job which serves as template for executed jobs below. + # See https://docs.gitlab.com/ee/ci/yaml/#anchors + retry: 2 + tags: + - openstack + script: + ## SSH initialization + - eval $(ssh-agent -s) + - ssh-add <(echo "${SSH_PRIVATE_KEY}") + - ssh -o StrictHostKeyChecking=no ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK} 'echo "Successfully connected on $(hostname)"' + # Copy jar + - scp ./backend/build/libs/${APP_NAME}.jar ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK}:/tmp/${APP_NAME}-${ENV}.jar + - ssh ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK} "sudo mv /tmp/${APP_NAME}-${ENV}.jar /opt/bootapp/${APP_NAME}-${ENV}.jar ; sudo chown -R bootapp:bootapp /opt/bootapp/" + # Restarting service with the updated jar and the according Spring profiles enabled + - ssh ${SERVER_USER_OPENSTACK}@${SERVER_IP_OPENSTACK} "sudo systemctl restart bootapp@${APP_NAME}-${ENV}" + - eval $(ssh-agent -k) + - echo "Deploy done. Application should be available at http://${SERVER_IP_OPENSTACK}:${APP_PORT}/${CONTEXT_PATH}" only: - refs: - - master changes: - .gitlab-ci.yml - backend/src/**/* - frontend/**/* - + when: manual + allow_failure: false deploy-to-beta: - stage: staging + stage: deploy-beta + extends: .deploy-to-vm-openstack variables: + APP_PORT: ${BETA_FAIDARE_PORT} ENV: beta - APP_PORT: ${BETA_GPDS_PORT} - CONTEXT_PATH: ${BETA_GPDS_CONTEXT_PATH} - <<: *deploy_to_vm + CONTEXT_PATH: faidare-beta except: refs: - master only: refs: - branches - changes: - - .gitlab-ci.yml - - backend/src/**/* - - frontend/**/* - when: manual - allow_failure: false + when: always +deploy-to-staging: + stage: deploy-staging + extends: .deploy-to-vm-openstack + variables: + APP_PORT: ${STAGING_FAIDARE_PORT} + ENV: staging + CONTEXT_PATH: faidare-staging + only: + refs: + - branches + except: + refs: + - master + when: manual deploy-to-int: - stage: production + stage: deploy-production + extends: .deploy-to-vm-proxmox variables: + APP_PORT: ${INT_FAIDARE_PORT} ENV: int - APP_PORT: ${INT_GPDS_PORT} - CONTEXT_PATH: ${INT_GPDS_CONTEXT_PATH} - <<: *deploy_to_vm + CONTEXT_PATH: faidare-int only: refs: - master - changes: - - .gitlab-ci.yml - - backend/src/**/* - - frontend/**/* when: manual - allow_failure: false - deploy-to-prod-public: - stage: production + stage: deploy-production + extends: .deploy-to-vm-proxmox variables: + APP_PORT: ${PROD_PUBLIC_FAIDARE_PORT} ENV: prod-public - APP_PORT: ${PROD_PUBLIC_GPDS_PORT} - CONTEXT_PATH: ${PROD_PUBLIC_GPDS_CONTEXT_PATH} - <<: *deploy_to_vm + CONTEXT_PATH: faidare only: refs: - master - changes: - - .gitlab-ci.yml - - backend/src/**/* - - frontend/**/* when: manual - allow_failure: false - deploy-to-prod-private: - stage: production + stage: deploy-production + extends: .deploy-to-vm-proxmox variables: + APP_PORT: ${PROD_PRIVATE_FAIDARE_PORT} ENV: prod-private - APP_PORT: ${PROD_PRIVATE_GPDS_PORT} - CONTEXT_PATH: ${PROD_PRIVATE_GPDS_CONTEXT_PATH} - <<: *deploy_to_vm + CONTEXT_PATH: faidare-private only: refs: - master - changes: - - .gitlab-ci.yml - - backend/src/**/* - - frontend/**/* when: manual - allow_failure: false diff --git a/gradle.properties b/gradle.properties index 41041374..765b02c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # gradle.properties -systemProp.sonar.host.url=https://urgi.versailles.inra.fr/sonarqube +systemProp.sonar.host.url=https://urgi.versailles.inrae.fr/sonarqube #----- Token generated from an account with 'publish analysis' permission systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562 @@ -9,4 +9,6 @@ systemProp.sonar.language=typescript systemProp.sonar.scm.provider=git systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info -systemProp.sonar.typescript.node=/tmp/node/node-v10.13.0/bin/node +#systemProp.sonar.typescript.node=/tmp/node/node-v12.14.1-linux-x64/bin/node +systemProp.sonar.typescript.node=/tmp/node/node +systemProp.sonar.typescript.exclusions=**/*.spec.ts -- GitLab From 92bc1a9df5c61b8b6b35f9f7e29a46e22f16fffc Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Thu, 30 Jul 2020 16:32:49 +0200 Subject: [PATCH 38/46] chore: remove commented code. GNP-5622. --- .gitlab-ci.yml | 54 -------------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bdf8ba4f..18d397cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,41 +40,6 @@ lint: script: "./gradlew lint" -#test-frontend: -# stage: test -# tags: -# - openstack -# script: "./gradlew :frontend:test --parallel" -# artifacts: -# reports: -# junit: -# - "./frontend/karma-junit-tests-report/TEST*.xml" - - -#test-backend: -# stage: test -# tags: -# - openstack -# script: "./gradlew :backend:test --parallel" -# services: -# # even if that would be ideal -# # we can't just launch the service with just elasticsearch:6.3.1 -# # because we need to pass some variables, but they are passed to _all_ containers -# # so they fail the start of other docker images like urgi/docker-browsers -# # the only solution is to override the entrypoint of the service and pass the arguments manually -# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 -# alias: elasticsearch -# # discovery.type=single-node -# # single-node is necessary to start in development mode -# # so there will be no bootstrap checks that would fail on CI -# # especially the error regarding -# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` -# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] -# artifacts: -# reports: -# junit: -# - "./backend/build/test-results/test/TEST-*.xml" - test-and-sonarqube: stage: test tags: @@ -119,25 +84,6 @@ test-and-sonarqube: - frontend/**/* -#sonarqube-analysis: -# stage: test -# script: "./gradlew :backend:test :frontend:test --parallel sonarqube" -# services: -# # even if that would be ideal -# # we can't just launch the service with just elasticsearch:6.3.1 -# # because we need to pass some variables, but they are passed to _all_ containers -# # so they fail the start of other docker images like urgi/docker-browsers -# # the only solution is to override the entrypoint of the service and pass the arguments manually -# - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 -# alias: elasticsearch -# # discovery.type=single-node -# # single-node is necessary to start in development mode -# # so there will be no bootstrap checks that would fail on CI -# # especially the error regarding -# # `max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]` -# command: ["bin/elasticsearch", "-Ediscovery.type=single-node"] - - # BUILD -- GitLab From f68289c37f91f7b59c75fb761d4db0cc3ffd5d74 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 11:35:14 +0200 Subject: [PATCH 39/46] feat: remove gradle cache settings from test-and-sonarqube job because they are already set. GNP-5622. --- .gitlab-ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18d397cf..4bd79bc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,13 +66,6 @@ test-and-sonarqube: - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; - export PATH="/tmp/node/:$PATH" - ./gradlew sonarqube -x test - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull-push - paths: - - .gradle - - frontend/.gradle/ - - frontend/node_modules/ artifacts: reports: junit: -- GitLab From 1466843464f96b06cdb831b20f62ae3c5c2893c1 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 12:07:04 +0200 Subject: [PATCH 40/46] chore: try to put again the test-frontend job... GNP-5622. --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4bd79bc2..520b38a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,17 @@ lint: script: "./gradlew lint" +test-frontend: + stage: test + tags: + - openstack + script: "./gradlew :frontend:test --parallel" + artifacts: + reports: + junit: + - "./frontend/karma-junit-tests-report/TEST*.xml" + + test-and-sonarqube: stage: test tags: -- GitLab From 1f2df49ae8f66949b1690c0e6e506f307c5d2b54 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 12:14:05 +0200 Subject: [PATCH 41/46] chore: try to use :fronted:test and :backend:test instead of test in test-and-sonarqube job. GNP-5622. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 520b38a9..1de64e92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,7 @@ test-and-sonarqube: variables: GRADLE_OPTS: "-Dorg.gradle.daemon=true" script: - - ./gradlew --parallel test + - ./gradlew :frontend:test :backend:test --parallel - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; - export PATH="/tmp/node/:$PATH" - ./gradlew sonarqube -x test -- GitLab From de8d213b6a3e339958e63cc00044d7a17e683e4d Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 13:21:41 +0200 Subject: [PATCH 42/46] chore: remove limitations for the build job. GNP-5622. --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1de64e92..3b97d204 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,11 +101,11 @@ build: paths: - "$JAR_PATH" expire_in: 1 week - only: - changes: - - .gitlab-ci.yml - - backend/src/**/* - - frontend/**/* +# only: +# changes: +# - .gitlab-ci.yml +# - backend/src/**/* +# - frontend/**/* # DEPLOY -- GitLab From fa4cd86530f436523627071ed5feb18dde166d1f Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 13:26:45 +0200 Subject: [PATCH 43/46] chore: remove limitations for the test-and-sonarqube job. GNP-5622. --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b97d204..86365c46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -82,10 +82,10 @@ test-and-sonarqube: junit: - ./backend/build/test-results/test/TEST-*.xml - ./frontend/karma-junit-tests-report/TEST*.xml - only: - changes: - - backend/src/**/* - - frontend/**/* +# only: +# changes: +# - backend/src/**/* +# - frontend/**/* # BUILD -- GitLab From 6ad642bdcd5484eca6e57a2e33a92e80281fdcf6 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 13:44:19 +0200 Subject: [PATCH 44/46] chore: separate frontend and backend tests in the test-and-sonarqube job. GNP-5622. --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86365c46..7c9c112b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,8 @@ test-and-sonarqube: variables: GRADLE_OPTS: "-Dorg.gradle.daemon=true" script: - - ./gradlew :frontend:test :backend:test --parallel + - ./gradlew :frontend:test --parallel + - ./gradlew :backend:test --parallel - find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \; - export PATH="/tmp/node/:$PATH" - ./gradlew sonarqube -x test -- GitLab From 43b9dbce4eee6626aa49aa3bede2dd7120a0ad50 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inra.fr> Date: Fri, 31 Jul 2020 14:01:32 +0200 Subject: [PATCH 45/46] chore: remove test-frontend job. GNP-5622. --- .gitlab-ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c9c112b..fc5714a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,17 +40,6 @@ lint: script: "./gradlew lint" -test-frontend: - stage: test - tags: - - openstack - script: "./gradlew :frontend:test --parallel" - artifacts: - reports: - junit: - - "./frontend/karma-junit-tests-report/TEST*.xml" - - test-and-sonarqube: stage: test tags: -- GitLab From 5d1adc60f4bf5e7859babc64b31e6cb82d355a46 Mon Sep 17 00:00:00 2001 From: Erik Kimmel <erik.kimmel@inrae.fr> Date: Mon, 24 Aug 2020 18:48:02 +0200 Subject: [PATCH 46/46] chore: clean commented code. GNP-5622. --- .gitlab-ci.yml | 9 --------- gradle.properties | 1 - 2 files changed, 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc5714a6..7c1fb1d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,10 +72,6 @@ test-and-sonarqube: junit: - ./backend/build/test-results/test/TEST-*.xml - ./frontend/karma-junit-tests-report/TEST*.xml -# only: -# changes: -# - backend/src/**/* -# - frontend/**/* # BUILD @@ -91,11 +87,6 @@ build: paths: - "$JAR_PATH" expire_in: 1 week -# only: -# changes: -# - .gitlab-ci.yml -# - backend/src/**/* -# - frontend/**/* # DEPLOY diff --git a/gradle.properties b/gradle.properties index 765b02c4..4ce5f430 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,5 @@ systemProp.sonar.language=typescript systemProp.sonar.scm.provider=git systemProp.sonar.typescript.tsconfigPath=frontend/tsconfig.json systemProp.sonar.typescript.lcov.reportPaths=frontend/coverage/lcov.info -#systemProp.sonar.typescript.node=/tmp/node/node-v12.14.1-linux-x64/bin/node systemProp.sonar.typescript.node=/tmp/node/node systemProp.sonar.typescript.exclusions=**/*.spec.ts -- GitLab