jenkins: prepared function to synchronize yocto downloads
BugzID: 71491 Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
669ba32c6a
commit
db60b919eb
|
|
@ -26,6 +26,8 @@ pipeline {
|
||||||
DISTRO_VERSION_FILE = "distro_version.inc"
|
DISTRO_VERSION_FILE = "distro_version.inc"
|
||||||
SUBMODULE_VERION_FILE = "submodule_revisions"
|
SUBMODULE_VERION_FILE = "submodule_revisions"
|
||||||
AUTOREV_VERSION_FILE = "autorev_revisions.inc"
|
AUTOREV_VERSION_FILE = "autorev_revisions.inc"
|
||||||
|
|
||||||
|
BINARY_STORAGE_URL = "http://nmrepo.netmodule.intranet/src/yocto-downloads/"
|
||||||
}
|
}
|
||||||
|
|
||||||
options {
|
options {
|
||||||
|
|
@ -62,7 +64,8 @@ pipeline {
|
||||||
--> version = ${version}\n\
|
--> version = ${version}\n\
|
||||||
----------------------------------\n"
|
----------------------------------\n"
|
||||||
changeDistroVersion("${version}")
|
changeDistroVersion("${version}")
|
||||||
|
syncSources("${env.BINARY_STORAGE_URL}", "${env.SHARED_BUILD}/downloads")
|
||||||
|
error("STOPPING because I want it so... :-D")
|
||||||
}
|
}
|
||||||
writeFile file: 'VERSION', text: "${env.PACKAGE_NAME}: ${env.BUILD_VERSION}"
|
writeFile file: 'VERSION', text: "${env.PACKAGE_NAME}: ${env.BUILD_VERSION}"
|
||||||
}
|
}
|
||||||
|
|
@ -162,6 +165,28 @@ def cleanupDistroVersion() {
|
||||||
sh(script:"git clean -f ${env.DISTRO_VERSION_PATHNAME}")
|
sh(script:"git clean -f ${env.DISTRO_VERSION_PATHNAME}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def syncSources(src, dst) {
|
||||||
|
def url = (src.contains("http")) ? src : dst
|
||||||
|
def repoUrl = url.split("//")[1]
|
||||||
|
String[] repoParts = "${repoUrl}".split("/")
|
||||||
|
repoParts[0] = "jenkins@" + repoParts[0] + ":/repo/repo"
|
||||||
|
sshSrc = repoParts.join("/")
|
||||||
|
println "sshSrc=${sshSrc}"
|
||||||
|
|
||||||
|
def syncCmd = "rsync -avz -e \"ssh\""
|
||||||
|
|
||||||
|
// http://nmrepo.netmodule.intranet/src/yocto-downloads/
|
||||||
|
|
||||||
|
// synchronizing build job
|
||||||
|
if(src.contains("http")) {
|
||||||
|
println "getting data from server..."
|
||||||
|
// sh(script: "rsync -avz -e \"ssh\" ${sshSrc} ${dst}")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// synchronizing storage
|
||||||
|
println "putting data to server..."
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def buildAndArchive() {
|
def buildAndArchive() {
|
||||||
if (params.IMAGE_TYPE == 'sdk') {
|
if (params.IMAGE_TYPE == 'sdk') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue