proxy-nginx/deploy-this/update-from-git.jenkinsfile

68 lines
1.3 KiB
Plaintext
Executable File

def projects = [
"proxy-nginx",
"arti24",
"arti-angular-app",
"angular-services"
]
def git_take( projects ){
if( 0 == projects.size() ){
def git_pull ="git pull"
sh( git_pull )
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 )
}
}else{
git_take = git_take +"clone https://git.arti24.eu/gitea/"+project+".git"
sh( git_take )
}
dir( project ){
sh( "git log -n 1");
}
}
}
}
def disableSafeDirCheck(){
def disableSafeDirCheck="git config --global --add safe.directory '*'"
sh( disableSafeDirCheck )
}
pipeline {
agent any
stages {
stage('Update from git') {
steps {
script{
disableSafeDirCheck()
}
dir("/_programs_"){
script{
git_take( projects )
}
}
}
}
}
}