From cc40e5e9fb370cdabc7c0dee9883e15162596960 Mon Sep 17 00:00:00 2001 From: Cao Cao <30380422+Caophuc799@users.noreply.github.com> Date: Fri, 22 Sep 2023 09:58:13 +0700 Subject: [PATCH 1/3] Update Jenkinsfile --- Jenkinsfile | 70 ++++++----------------------------------------------- 1 file changed, 8 insertions(+), 62 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 889c8e62..f624c1fd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,69 +1,15 @@ pipeline { - - agent { - node { - label 'master' - } - } - - options { - buildDiscarder logRotator( - daysToKeepStr: '16', - numToKeepStr: '10' - ) - } + agent any stages { - - stage('Cleanup Workspace') { - steps { - cleanWs() - sh """ - echo "Cleaned Up Workspace For Project" - """ - } - } - - stage('Code Checkout') { - steps { - checkout([ - $class: 'GitSCM', - branches: [[name: '*/main']], - userRemoteConfigs: [[url: 'https://github.com/spring-projects/spring-petclinic.git']] - ]) - } - } - - stage(' Unit Testing') { + stage('Print Value') { steps { - sh """ - echo "Running Unit Tests" - """ + script { + def myValue = "Hello, Jenkins!" + echo "My value is: ${myValue}" + } } } - - stage('Code Analysis') { - steps { - sh """ - echo "Running Code Analysis" - """ - } - } - - stage('Build Deploy Code') { - when { - branch 'develop' - } - steps { - sh """ - echo "Building Artifact" - """ - - sh """ - echo "Deploying Code" - """ - } - } - - } + // Add more stages as needed + } } From 05b19032be43a709e5407e0c823fe1e2ff5fcbb6 Mon Sep 17 00:00:00 2001 From: Cao Cao <30380422+Caophuc799@users.noreply.github.com> Date: Fri, 22 Sep 2023 10:10:51 +0700 Subject: [PATCH 2/3] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f624c1fd..de41fc22 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { script { def myValue = "Hello, Jenkins!" - echo "My value is: ${myValue}" + echo "My value is in develop-test branch: ${myValue}" } } } From 5cb202720716266be391b679a3a649fdda830a3f Mon Sep 17 00:00:00 2001 From: Cao Cao <30380422+Caophuc799@users.noreply.github.com> Date: Fri, 3 May 2024 12:59:42 +0700 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 384308a8..eb6bdb65 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # multibranch-pipeline-demo -Jenkins Multibranch Pipeline Example Repo +Jenkins Multibranch Pipeline Example Repo 1