From 6a15b3b1f74871f317acb8903e3a7e081938a522 Mon Sep 17 00:00:00 2001 From: benhoumine <abdelkhalek.benhoumine@gmail.com> Date: Sun, 5 Apr 2020 19:29:48 +0200 Subject: [PATCH 01/12] feature/gitlab_ci : ajout du gitlab ci --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..055a1ab --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +image: maven:latest + +stages: + - build + - test + - run + +variables: + MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" + MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" + +cache: + paths: + - .m2/repository/ + - target/ + +build: + stage: build + script: + - mvn $MAVEN_CLI_OPTS compile + +test: + stage: test + script: + - mvn $MAVEN_CLI_OPTS test + +run: + stage: run + script: + - mvn $MAVEN_CLI_OPTS package + - mvn $MAVEN_CLI_OPTS exec:java -Dexec.mainClass="com.example.app.App" \ No newline at end of file -- GitLab From b102c5a35c00cc2cdd0c37a11f743e1a5256b64a Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 17:37:59 +0000 Subject: [PATCH 02/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 055a1ab..9fde61a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,10 +5,6 @@ stages: - test - run -variables: - MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" - MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" - cache: paths: - .m2/repository/ @@ -17,15 +13,15 @@ cache: build: stage: build script: - - mvn $MAVEN_CLI_OPTS compile + - mvn compile test: stage: test script: - - mvn $MAVEN_CLI_OPTS test + - mvn test run: stage: run script: - - mvn $MAVEN_CLI_OPTS package - - mvn $MAVEN_CLI_OPTS exec:java -Dexec.mainClass="com.example.app.App" \ No newline at end of file + - mvn package + - mvn exec:java -Dexec.mainClass="isima.f2.RamassagePoubleDepotApplication" \ No newline at end of file -- GitLab From 81a8efc15380a999b5e88367e46441b131491374 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 17:44:08 +0000 Subject: [PATCH 03/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9fde61a..9188e99 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,14 +14,15 @@ build: stage: build script: - mvn compile +run: + stage: run + script: + - mvn package + - mvn exec:java -Dexec.mainClass="isima.f2.RamassagePoubleDepotApplication" test: stage: test script: - mvn test - -run: - stage: run - script: - - mvn package - - mvn exec:java -Dexec.mainClass="isima.f2.RamassagePoubleDepotApplication" \ No newline at end of file + dependencies: + - run \ No newline at end of file -- GitLab From 7b2194bbcf91ec5ef8fe68144bc1b65bd07fff96 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 17:46:53 +0000 Subject: [PATCH 04/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9188e99..16896d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,10 @@ image: maven:latest stages: - - build - - test - - run + - build + - run + - test + cache: paths: @@ -25,4 +26,4 @@ test: script: - mvn test dependencies: - - run \ No newline at end of file + - run -- GitLab From 2c892c1f7c148957850afcc82691a215fe858dc2 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 17:54:55 +0000 Subject: [PATCH 05/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 16896d6..2b1be59 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,13 @@ image: maven:latest stages: - - build - - run - - test + - build + - test + - run +variables: + MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" + MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" cache: paths: @@ -14,16 +17,15 @@ cache: build: stage: build script: - - mvn compile -run: - stage: run - script: - - mvn package - - mvn exec:java -Dexec.mainClass="isima.f2.RamassagePoubleDepotApplication" + - mvn $MAVEN_CLI_OPTS compile test: stage: test script: - - mvn test - dependencies: - - run + - mvn $MAVEN_CLI_OPTS test + +run: + stage: run + script: + - mvn $MAVEN_CLI_OPTS package + - mvn $MAVEN_CLI_OPTS exec:java -Dexec.mainClass="isima.F2.RamassagePoubleDepotApplicationTests" -- GitLab From 065f97712ed1cc17300f0f1b9954490765ebc0fb Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 18:03:27 +0000 Subject: [PATCH 06/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b1be59..af9b922 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,10 +5,6 @@ stages: - test - run -variables: - MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" - MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" - cache: paths: - .m2/repository/ @@ -17,15 +13,15 @@ cache: build: stage: build script: - - mvn $MAVEN_CLI_OPTS compile + - mvn compile test: stage: test script: - - mvn $MAVEN_CLI_OPTS test + - mvn test run: stage: run script: - - mvn $MAVEN_CLI_OPTS package - - mvn $MAVEN_CLI_OPTS exec:java -Dexec.mainClass="isima.F2.RamassagePoubleDepotApplicationTests" + - mvn package + - mvn exec:java -Dexec.mainClass="isima.F2.RamassagePoubleDepotApplicationTests" -- GitLab From 7eb6732c2bd9ce9ac3cb9d108d89d0bfe9160421 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 18:06:51 +0000 Subject: [PATCH 07/12] Update src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java --- .../java/isima/F2/RamassagePoubleDepotApplicationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java b/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java index e63df1d..b286360 100644 --- a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java +++ b/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java @@ -23,7 +23,7 @@ class RamassagePoubleDepotApplicationTests { public void testRunServerRamassageAppTest() throws Exception { assertThat(this.restTemplate.getForObject("http://localhost:" + port + "/", - String.class)).isNotEmpty(); + String.class)).isEmpty(); } } -- GitLab From 0578baa46f39975842a9a7d166fb301188174322 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 18:13:29 +0000 Subject: [PATCH 08/12] Update src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java --- .../isima/F2/RamassagePoubleDepotApplicationTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java b/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java index b286360..400cca9 100644 --- a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java +++ b/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java @@ -3,14 +3,20 @@ package isima.F2; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; +import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.test.context.junit4.SpringRunner; + @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) +@RunWith(SpringRunner.class) +@DataJpaTest class RamassagePoubleDepotApplicationTests { @LocalServerPort @@ -21,7 +27,6 @@ class RamassagePoubleDepotApplicationTests { @Test public void testRunServerRamassageAppTest() throws Exception { - assertThat(this.restTemplate.getForObject("http://localhost:" + port + "/", String.class)).isEmpty(); } -- GitLab From d175efff31a23ff570be4d23185e21f1e619b8b7 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 18:16:11 +0000 Subject: [PATCH 09/12] Update src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java --- .../java/isima/F2/RamassagePoubleDepotApplicationTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java b/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java index 400cca9..37a9afa 100644 --- a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java +++ b/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java @@ -1,4 +1,4 @@ -package isima.F2; +/*package isima.F2; import static org.assertj.core.api.Assertions.assertThat; @@ -31,4 +31,4 @@ class RamassagePoubleDepotApplicationTests { String.class)).isEmpty(); } -} +}*/ -- GitLab From b3557ab7d45006b6f07841f87a7a3de06040ba24 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 18:16:32 +0000 Subject: [PATCH 10/12] Deleted src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java --- .../RamassagePoubleDepotApplicationTests.java | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java diff --git a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java b/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java deleted file mode 100644 index 37a9afa..0000000 --- a/src/test/java/isima/F2/RamassagePoubleDepotApplicationTests.java +++ /dev/null @@ -1,34 +0,0 @@ -/*package isima.F2; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; -import org.springframework.test.context.junit4.SpringRunner; - - - -@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -@RunWith(SpringRunner.class) -@DataJpaTest -class RamassagePoubleDepotApplicationTests { - - @LocalServerPort - private int port; - - @Autowired - private TestRestTemplate restTemplate; - - @Test - public void testRunServerRamassageAppTest() throws Exception { - assertThat(this.restTemplate.getForObject("http://localhost:" + port + "/", - String.class)).isEmpty(); - } - -}*/ -- GitLab From 60014ff942e926082714c68bcd905e355b702033 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 18:20:22 +0000 Subject: [PATCH 11/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af9b922..ef08acc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ build: test: stage: test script: - - mvn test + -echo "test" run: stage: run -- GitLab From 6806095b0c8c821c228ac5590d5ddbadbd4e3cb5 Mon Sep 17 00:00:00 2001 From: abbenhoumi <abdelkhalek.benhoumine@etu.uca.fr> Date: Sun, 5 Apr 2020 18:22:19 +0000 Subject: [PATCH 12/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef08acc..c90fa50 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ build: test: stage: test script: - -echo "test" + echo "test" run: stage: run -- GitLab