jenkins: used writeFile for the distro version file and clean only this at the end
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
2b84d3db8f
commit
3d76f212bf
|
|
@ -22,6 +22,8 @@ pipeline {
|
|||
build_deploy = "${SHARED_BUILD}/tmp/deploy/images/${MACHINE}"
|
||||
build_licenses = "${SHARED_BUILD}/tmp/deploy/licenses"
|
||||
buildhistory = "${SHARED_BUILD}/buildhistory"
|
||||
|
||||
DISTO_VERSION_FILE = "${SHARED_BUILD}/conf/distro_version.inc"
|
||||
}
|
||||
|
||||
options {
|
||||
|
|
@ -131,14 +133,13 @@ def build_version(versionParam) {
|
|||
|
||||
def change_distro_version(versionString){
|
||||
println "Set the distro version to ${versionString}..."
|
||||
def versionTag = "DISTRO_VERSION = "
|
||||
def sedCmd = "sed -i 's/^${versionTag}.*\$/${versionTag}\"${versionString}\"/'"
|
||||
sh(script:"${sedCmd} meta-netmodule-distro/conf/distro/netmodule-linux.conf")
|
||||
def versionTag = "DISTRO_VERSION = \"${versionString}\""
|
||||
writeFile(file: "${env.DISTO_VERSION_FILE}", text: "${versionTag}")
|
||||
}
|
||||
|
||||
def cleanup_distro_version() {
|
||||
println "cleaning submodule holding distro version..."
|
||||
sh 'cd meta-netmodule-distro && git checkout *'
|
||||
println "cleaning repository regarding distro version..."
|
||||
sh(script:"git clean -f ${env.DISTO_VERSION_FILE}")
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -42,3 +42,5 @@ PREMIRRORS_prepend = "\
|
|||
ftp://.*/.* file://${YOCTOROOT}/sla-mirror/ \n \
|
||||
http://.*/.* file://${YOCTOROOT}/sla-mirror/ \n \
|
||||
https://.*/.* file://${YOCTOROOT}/sla-mirror/ \n"
|
||||
|
||||
include distro_version.inc
|
||||
|
|
|
|||
Loading…
Reference in New Issue