Selaa lähdekoodia

modified jenkins files

Avinash 1 vuosi sitten
vanhempi
commit
24264d2630
1 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 9
    3
      Jenkinsfile

+ 9
- 3
Jenkinsfile Näytä tiedosto

91
 
91
 
92
     // Check for changes
92
     // Check for changes
93
     sh """
93
     sh """
94
+        git status
94
         git pull origin ${env.BRANCH_NAME}
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…
Peruuta
Tallenna