From d35a149537f3e2955d2cd7f364994371277f3aef Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 18:21:29 +0000 Subject: [PATCH 1/8] Add new file --- .gitlab-ci.yml | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..262a9c7ca --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,87 @@ +stages: + - build + - test + - quality + - package + +cache: + paths: + - .m2/repository + key: "$CI_JOB_NAME" + +build_job: + stage: build + script: + - ./mvnw compile + -Dhttps.protocols=TLSv1.2 + -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN + -Dorg.slf4j.simpleLogger.showDateTime=true + -Djava.awt.headless=true + --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true + image: openjdk:8-alpine + +test_job: + stage: test + script: + - ./mvnw test + -Dhttps.protocols=TLSv1.2 + -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN + -Dorg.slf4j.simpleLogger.showDateTime=true + -Djava.awt.headless=true + --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true + image: openjdk:8-alpine + +#TESTING : Version du MOOC +#code_quality_job: +# stage: quality +# image: docker:stable +# allow_failure: true +# services: +# - docker:stable-dind +# script: +# - mkdir codequality-results +# - docker run +# --env CODECLIMATE_CODE="$PWD" +# --volume "$PWD":/code +# --volume /var/run/docker.sock:/var/run/docker.sock +# --volume /tmp/cc:/tmp/cc +# codeclimate/codeclimate analyze -f html > ./codequality-results/index.html +# artifacts: +# paths: +# - codequality-results/ + +#TESTING : Version officielle +#@see https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html +include: + - template: Code-Quality.gitlab-ci.yml +code_quality: + stage: quality + variables: + CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:latest" + +code_quality_html: + extends: code_quality + variables: + REPORT_FORMAT: html + artifacts: + paths: [gl-code-quality-report.html] + +package_job: + stage: package + services: + - docker:stable-dind + variables: + DOCKER_HOST: tcp://docker:2375 + script: + - apk add --no-cache docker + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - ./mvnw install -PbuildDocker -DskipTests=true -DpushImage + -Dhttps.protocols=TLSv1.2 + -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN + -Dorg.slf4j.simpleLogger.showDateTime=true + -Djava.awt.headless=true + --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true + image: openjdk:8-alpine From 9888fe81db941c719f352f19fd094879ba7a5fae Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 19:06:57 +0000 Subject: [PATCH 2/8] Suppression de l'annotation @SpringBootApplication(proxyBeanMethods = false) --- .../springframework/samples/petclinic/PetClinicApplication.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java index 191253587..6bc4d35ba 100644 --- a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java +++ b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java @@ -25,7 +25,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @author Dave Syer * */ -@SpringBootApplication(proxyBeanMethods = false) public class PetClinicApplication { public static void main(String[] args) { From 5bd076b99720ff2eb2bc08e58f6ef1518a8d65ad Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 19:10:13 +0000 Subject: [PATCH 3/8] Revert "Suppression de l'annotation @SpringBootApplication(proxyBeanMethods = false)" This reverts commit 9888fe81db941c719f352f19fd094879ba7a5fae --- .../springframework/samples/petclinic/PetClinicApplication.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java index 6bc4d35ba..191253587 100644 --- a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java +++ b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java @@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @author Dave Syer * */ +@SpringBootApplication(proxyBeanMethods = false) public class PetClinicApplication { public static void main(String[] args) { From f37eba47fa71375244cadce57b8fdd3acf57d328 Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 19:15:16 +0000 Subject: [PATCH 4/8] Fix [ERROR] /builds/mooc-gitlab/spring-petclinic/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java:[28,43] cannot find symbol symbol: method proxyBeanMethods() --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index cc8d8dafd..f5c09f34c 100644 --- a/pom.xml +++ b/pom.xml @@ -108,6 +108,13 @@ spring-boot-devtools true + + + + javax.annotation + javax.annotation-api + 1.2 + From ec4d1d499c8d4224ad83226042fdc833873bd0a2 Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 19:18:33 +0000 Subject: [PATCH 5/8] Revert "Fix [ERROR]..." This reverts commit f37eba47fa71375244cadce57b8fdd3acf57d328 --- pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pom.xml b/pom.xml index f5c09f34c..cc8d8dafd 100644 --- a/pom.xml +++ b/pom.xml @@ -108,13 +108,6 @@ spring-boot-devtools true - - - - javax.annotation - javax.annotation-api - 1.2 - From 07058948719fc50ed46dbe3c5bea9a3aa0f311ae Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 19:19:23 +0000 Subject: [PATCH 6/8] Fix [ERROR] /builds/mooc-gitlab/spring-petclinic/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java:[28,43] cannot find symbol symbol: method proxyBeanMethods() --- pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pom.xml b/pom.xml index cc8d8dafd..6912f55a5 100644 --- a/pom.xml +++ b/pom.xml @@ -108,6 +108,15 @@ spring-boot-devtools true + + + + javax.annotation + javax.annotation-api + 1.2 + + + From 378782493df0a9a4ad1c48e3c03abd1cc10329f0 Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 19:21:55 +0000 Subject: [PATCH 7/8] Suppression du en trop --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6912f55a5..2e3397494 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,6 @@ - From 1b83b3aa9a1e9798c0073c3b5df61208b3748006 Mon Sep 17 00:00:00 2001 From: St ef Date: Mon, 31 May 2021 19:34:00 +0000 Subject: [PATCH 8/8] Delete javax.annotation 1.2 and switch to spring-boot-starter-parent 2.1.3 --- pom.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2e3397494..fdb3bfad7 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.4.RELEASE + 2.1.3.RELEASE petclinic @@ -109,12 +109,6 @@ true - - - javax.annotation - javax.annotation-api - 1.2 -