44 lines
968 B
Plaintext
Executable File
44 lines
968 B
Plaintext
Executable File
def git_remote = "https://git.arti24.eu/gitea"
|
|
|
|
def projects = [
|
|
"proxy-nginx",
|
|
"arti24",
|
|
"angular-services",
|
|
"arti-angular-app"
|
|
]
|
|
|
|
def git_take(projects, git_remote) {
|
|
projects.each { project ->
|
|
if (fileExists(project)) {
|
|
dir(project) {
|
|
sh "git fetch --all && git reset --hard origin/HEAD"
|
|
}
|
|
} else {
|
|
sh "git clone ${git_remote}/${project}.git"
|
|
}
|
|
dir(project) {
|
|
sh "git log -n 1"
|
|
}
|
|
}
|
|
}
|
|
|
|
def disableSafeDirCheck() {
|
|
sh "git config --global --add safe.directory '*'"
|
|
}
|
|
|
|
pipeline {
|
|
agent any
|
|
|
|
stages {
|
|
stage('Update from git') {
|
|
steps {
|
|
script {
|
|
disableSafeDirCheck()
|
|
dir("_programs_") {
|
|
git_take(projects, git_remote) // Dodano git_remote jako argument
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |