From f0346e732de8808bce0dcc2100a97feddd816c52 Mon Sep 17 00:00:00 2001 From: bellyster Date: Sat, 14 Jan 2023 18:59:20 -0300 Subject: [PATCH 01/12] =?UTF-8?q?Causando=20problemas=20comentando=20c?= =?UTF-8?q?=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/training/taylor/timetracker/core/Tracker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/training/taylor/timetracker/core/Tracker.java b/core/src/main/java/training/taylor/timetracker/core/Tracker.java index 74ee98ce3..5a28ab7ca 100644 --- a/core/src/main/java/training/taylor/timetracker/core/Tracker.java +++ b/core/src/main/java/training/taylor/timetracker/core/Tracker.java @@ -1,7 +1,7 @@ package training.taylor.timetracker.core; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; import training.taylor.timetracker.core.dao.TimeEntry; import java.util.List; From 1f0cd134f7c79f2b63ae2c90f0e6228838abf2cc Mon Sep 17 00:00:00 2001 From: bellyster Date: Sat, 14 Jan 2023 19:41:21 -0300 Subject: [PATCH 02/12] Resolve problems --- .../main/java/training/taylor/timetracker/core/Tracker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/training/taylor/timetracker/core/Tracker.java b/core/src/main/java/training/taylor/timetracker/core/Tracker.java index 5a28ab7ca..74ee98ce3 100644 --- a/core/src/main/java/training/taylor/timetracker/core/Tracker.java +++ b/core/src/main/java/training/taylor/timetracker/core/Tracker.java @@ -1,7 +1,7 @@ package training.taylor.timetracker.core; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; import training.taylor.timetracker.core.dao.TimeEntry; import java.util.List; From 7e6a61bf06d66b0e5ff6f6aad084c1d8edc38b65 Mon Sep 17 00:00:00 2001 From: bellyster Date: Tue, 17 Jan 2023 20:43:56 -0300 Subject: [PATCH 03/12] Create Jenkinsfile --- Jenkinsfile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..d7f417ee9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,44 @@ +pipeline { + agent any + + tools { + // Install the Maven version configured as "M3" and add it to the path. + maven "Maven3" + jdk "Java11" + } + + stages { + stage('Build') { + steps { + // Get some code from a GitHub repository + git branch: 'master', url: 'https://github.com/bellyster/time-tracker.git' + + // Run Maven on a Unix agent. + //sh "mvn -Dmaven.test.failure.ignore=true clean package" + + // To run Maven on a Windows agent, use + bat "mvn clean package -DskipTests" + } + + post { + // failed, record the artifacts. + success { + echo 'Archivando artefacto' + archiveArtifacts 'core/target/*.jar' + archiveArtifacts 'web/target/*.war' + } + } + } + + stage('UNIT TESTS'){ + steps{ + //Unix version + //sh: 'mvn test' + //Ejecutar los tests + echo 'Ejecutando Tests' + bat "mvn test" + } + } + + } +} From a6a215826bb583f16da501701a7c77acfa8df48e Mon Sep 17 00:00:00 2001 From: bellyster Date: Wed, 24 May 2023 19:33:41 -0400 Subject: [PATCH 04/12] Update web.xml --- web/src/main/webapp/WEB-INF/web.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/main/webapp/WEB-INF/web.xml b/web/src/main/webapp/WEB-INF/web.xml index 88f096e5b..59439cf74 100644 --- a/web/src/main/webapp/WEB-INF/web.xml +++ b/web/src/main/webapp/WEB-INF/web.xml @@ -5,4 +5,7 @@ index.jsp - \ No newline at end of file + + index.jsp + + From 1f19b9862d79e2ae5df74080845a25c9cfd579db Mon Sep 17 00:00:00 2001 From: bellyster Date: Wed, 24 May 2023 19:37:37 -0400 Subject: [PATCH 05/12] Update TimeEntry.java --- .../java/training/taylor/timetracker/core/dao/TimeEntry.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java b/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java index ebc63ab9c..cb4f0098f 100644 --- a/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java +++ b/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java @@ -1,7 +1,6 @@ package training.taylor.timetracker.core.dao; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; + /** * Created by Jason on 6/19/2015. From 35c65522041cfb912927d36144d694c5fc2fe09c Mon Sep 17 00:00:00 2001 From: bellyster Date: Wed, 24 May 2023 19:41:22 -0400 Subject: [PATCH 06/12] Update TimeEntry.java --- .../java/training/taylor/timetracker/core/dao/TimeEntry.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java b/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java index cb4f0098f..22c4d4353 100644 --- a/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java +++ b/core/src/main/java/training/taylor/timetracker/core/dao/TimeEntry.java @@ -1,5 +1,7 @@ package training.taylor.timetracker.core.dao; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; /** From 12ebec9f5cce211a7bc4890e245e425189d6ac84 Mon Sep 17 00:00:00 2001 From: bellyster Date: Thu, 25 May 2023 15:48:38 -0400 Subject: [PATCH 07/12] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9e3d4e79b..c4319f236 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # time-tracker Java (Maven) application for tracking time on the job +push! + Time tracker From 32b404be3052da63b8490503d0f4cb70a7af2ccd Mon Sep 17 00:00:00 2001 From: bellyster Date: Thu, 25 May 2023 19:06:53 -0400 Subject: [PATCH 08/12] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c4319f236..a28f14344 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # time-tracker -Java (Maven) application for tracking time on the job - -push! - +Java (Maven) application for tracking time on the job!! +Commit +Otro commit! Time tracker From db82f09ff63c921582d5ca5b81fe79f9fcd43a18 Mon Sep 17 00:00:00 2001 From: bellyster Date: Thu, 25 May 2023 19:41:03 -0400 Subject: [PATCH 09/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a28f14344..4c4e070d7 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,4 @@ Java (Maven) application for tracking time on the job!! Commit Otro commit! Time tracker +PUSH AL REPO! From 77a9cc94613d6096a64a612da02f04914be02d0e Mon Sep 17 00:00:00 2001 From: bellyster Date: Thu, 25 May 2023 19:42:56 -0400 Subject: [PATCH 10/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c4e070d7..d83acde2f 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,4 @@ Commit Otro commit! Time tracker PUSH AL REPO! +Otro push! From cc0a59bc00fdeca07a9b3d65eea8060f36734797 Mon Sep 17 00:00:00 2001 From: bellyster Date: Thu, 25 May 2023 19:44:37 -0400 Subject: [PATCH 11/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d83acde2f..698b51136 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,4 @@ Otro commit! Time tracker PUSH AL REPO! Otro push! +Otro push mas From e102ae2c42855ba0edab89d82b09973dee21cce7 Mon Sep 17 00:00:00 2001 From: bellyster Date: Fri, 26 May 2023 20:03:07 -0400 Subject: [PATCH 12/12] Update Jenkinsfile --- Jenkinsfile | 74 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7f417ee9..ef400e718 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,44 +1,60 @@ pipeline { agent any - + tools { - // Install the Maven version configured as "M3" and add it to the path. + //Que herramientas queremos utilizar maven "Maven3" jdk "Java11" } + environment { + DISABLE_AUTH = 'true' + DB_ENGINE = 'sqlite' + } + stages { - stage('Build') { + stage('Hello') { steps { - // Get some code from a GitHub repository - git branch: 'master', url: 'https://github.com/bellyster/time-tracker.git' - - // Run Maven on a Unix agent. - //sh "mvn -Dmaven.test.failure.ignore=true clean package" - - // To run Maven on a Windows agent, use - bat "mvn clean package -DskipTests" + echo "Database engine is ${DB_ENGINE}" + echo "DISABLE_AUTH is ${DISABLE_AUTH}" + echo "Running ${env.BUILD_ID} on ${env.JENKINS_URL}" + echo "Job Name: ${env.JOB_NAME}" + echo "Job Name: ${env.JAVA_HOME}" } - - post { - // failed, record the artifacts. - success { - echo 'Archivando artefacto' - archiveArtifacts 'core/target/*.jar' - archiveArtifacts 'web/target/*.war' + + } + + stage('Git Polling'){ + steps{ + //git branch: 'master', url: 'https://github.com/bellyster/time-tracker.git' + git branch: 'master', credentialsId: 'GitHubKey', url: 'git@github.com:bellyster/time-tracker.git' + + } + } + + stage('BUILD CON MAVEN'){ + steps{ + bat "mvn clean package -DskipTests" //windows + + // sh "mvn -Dmaven.test.failure.ignore=true clean package " //Unix + } + + post{ + success{ + echo 'Archivar Artefactos' + archiveArtifacts "core/target/*.jar" + archiveArtifacts "web/target/*.war" } } } - - stage('UNIT TESTS'){ - steps{ - //Unix version - //sh: 'mvn test' - //Ejecutar los tests - echo 'Ejecutando Tests' - bat "mvn test" - } - } - + + stage('test maven'){ + steps{ + bat "mvn test" + //sh "mvn test" + } + } + + } }