Explorar el Código

modified jenkins files

Avinash hace 1 año
padre
commit
24264d2630
Se han modificado 1 ficheros con 9 adiciones y 3 borrados
  1. 9
    3
      Jenkinsfile

+ 9
- 3
Jenkinsfile Ver fichero

@@ -91,10 +91,16 @@ def commitChanges() {
91 91
 
92 92
     // Check for changes
93 93
     sh """
94
+        git status
94 95
         git pull origin ${env.BRANCH_NAME}
95
-        git add .
96
-        git commit -m "Moved processed XML files to backup"
97
-        git push --force https://jenkinstest:Bizgaze123@code.bizgaze.com/devops.bizgaze/imports.git ${env.BRANCH_NAME}
96
+        # Only proceed if there are changes
97
+        if [[ $(git status -s) ]]; then
98
+            git add .
99
+            git commit -m "Moved processed XML files to backup"
100
+            git push https://jenkinstest:Bizgaze123@code.bizgaze.com/devops.bizgaze/imports.git ${env.BRANCH_NAME}
101
+        else
102
+            echo "No changes to commit."
103
+        fi
98 104
     """
99 105
 }
100 106
 

Loading…
Cancelar
Guardar