Easer update-from-git
This commit is contained in:
parent
2e665ac468
commit
ea4a700239
|
|
@ -8,10 +8,6 @@ def projects = [
|
||||||
]
|
]
|
||||||
|
|
||||||
def git_take(projects, git_remote) {
|
def git_take(projects, git_remote) {
|
||||||
if (projects.empty) {
|
|
||||||
sh "git pull"
|
|
||||||
sh "git log -n 1"
|
|
||||||
} else {
|
|
||||||
projects.each { project ->
|
projects.each { project ->
|
||||||
if (fileExists(project)) {
|
if (fileExists(project)) {
|
||||||
dir(project) {
|
dir(project) {
|
||||||
|
|
@ -25,7 +21,6 @@ def git_take(projects, git_remote) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
def disableSafeDirCheck() {
|
def disableSafeDirCheck() {
|
||||||
sh "git config --global --add safe.directory '*'"
|
sh "git config --global --add safe.directory '*'"
|
||||||
|
|
@ -39,7 +34,7 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
disableSafeDirCheck()
|
disableSafeDirCheck()
|
||||||
dir("/_programs_") {
|
dir("_programs_") {
|
||||||
git_take(projects, git_remote) // Dodano git_remote jako argument
|
git_take(projects, git_remote) // Dodano git_remote jako argument
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue