order in update form gitea
This commit is contained in:
parent
84cf10f43e
commit
d0d7fcb6ed
|
|
@ -1,37 +1,34 @@
|
||||||
|
def git_remote = "https://git.arti24.eu/gitea"
|
||||||
|
|
||||||
def projects = [
|
def projects = [
|
||||||
"proxy-nginx",
|
"proxy-nginx",
|
||||||
"arti24",
|
"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() ){
|
if( 0 == projects.size() ){
|
||||||
def git_pull ="git pull"
|
def git_pull ="git pull"
|
||||||
sh( git_pull )
|
sh( git_pull )
|
||||||
sh("git log -n 1")
|
sh("git log -n 1")
|
||||||
}else{
|
}else{
|
||||||
for( project in projects ){
|
for( project in projects ){
|
||||||
def git_take ="git "
|
|
||||||
if( fileExists( project ) ){
|
if( fileExists( project ) ){
|
||||||
dir( project ){
|
dir( project ){
|
||||||
git_reset = git_take +" reset --hard "
|
sh "git fetch --all && git reset --hard origin/HEAD"
|
||||||
sh( git_reset )
|
}
|
||||||
git_take = git_take +"pull"
|
|
||||||
sh( git_take )
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
git_take = git_take +"clone https://git.arti24.eu/gitea/"+project+".git"
|
sh "git clone "+git_remote+"/"+project+".git"
|
||||||
sh( git_take )
|
|
||||||
}
|
}
|
||||||
dir( project ){
|
dir( project ){
|
||||||
sh( "git log -n 1");
|
sh( "git log -n 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,7 +37,6 @@ def disableSafeDirCheck(){
|
||||||
sh( disableSafeDirCheck )
|
sh( disableSafeDirCheck )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
agent any
|
agent any
|
||||||
|
|
@ -56,8 +52,6 @@ pipeline {
|
||||||
git_take( projects )
|
git_take( projects )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue