order in update form gitea

This commit is contained in:
Artur Kuś 2025-03-26 20:42:53 +01:00
parent 84cf10f43e
commit d0d7fcb6ed
1 changed files with 18 additions and 24 deletions

View File

@ -1,11 +1,13 @@
def git_remote = "https://git.arti24.eu/gitea"
def projects = [
"proxy-nginx",
"arti24",
"arti-angular-app",
"angular-services"
"angular-services",
"arti-angular-app"
]
def git_take( projects ){
def git_take( projects, git_remote ){
if( 0 == projects.size() ){
def git_pull ="git pull"
@ -13,23 +15,18 @@ def git_take( projects ){
sh("git log -n 1")
}else{
for( project in projects ){
def git_take ="git "
if( fileExists( project ) ){
dir( project ){
git_reset = git_take +" reset --hard "
sh( git_reset )
git_take = git_take +"pull"
sh( git_take )
sh "git fetch --all && git reset --hard origin/HEAD"
}
}else{
git_take = git_take +"clone https://git.arti24.eu/gitea/"+project+".git"
sh( git_take )
sh "git clone "+git_remote+"/"+project+".git"
}
dir( project ){
sh( "git log -n 1");
}
}
}
@ -40,7 +37,6 @@ def disableSafeDirCheck(){
sh( disableSafeDirCheck )
}
pipeline {
agent any
@ -56,8 +52,6 @@ pipeline {
git_take( projects )
}
}
}
}
}