2 // boolean: BUILD_FROM_SOURCE
3 // boolean: REPO_DISTRO
5 // boolean: UPSTREAM_SUFFIX
7 // string: RSYNC_DESTINATION
8 // string: REPO_BASE_URL
9 // string: REPO_KEY_NAME
12 node("${params.NODE}") {
15 tag_or_branch = params.COMMIT_ID.replaceAll(/\./,"")
16 container_name_prefix = "osm-${tag_or_branch}"
17 container_name = "${container_name_prefix}-${BUILD_NUMBER}"
24 // Copy the artifacts from the upstream jobs
25 stage("Copy Artifacts") {
26 // cleanup any previous repo
30 // grab all stable upstream builds based on the
31 // given target UPSTREAM_SUFFIX
33 def list = ["SO", "UI", "RO", "openvim", "osmclient"]
34 for (component in list) {
35 step ([$class: 'CopyArtifact',
36 projectName: "${component}_${params.UPSTREAM_SUFFIX}"])
37 sh "dpkg-sig --sign builder -k dpkg1 pool/${component}/*"
38 // cleanup any prevously defined dists
42 // now create the distro
43 for (component in list) {
44 sh "mkdir -p dists/${params.REPO_DISTRO}/${component}/binary-amd64/"
45 sh "apt-ftparchive packages pool/${component} > dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages"
46 sh "gzip -9fk dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages"
49 // create and sign the release file
50 sh "apt-ftparchive release dists/${params.REPO_DISTRO} > dists/${params.REPO_DISTRO}/Release"
51 sh "gpg --yes -abs -u dpkg1 -o dists/${params.REPO_DISTRO}/Release.gpg dists/${params.REPO_DISTRO}/Release"
52 sh "rsync -avz . ${params.RSYNC_DESTINATION}/${params.RELEASE}"
57 // check for previous containers and clean them up
58 sh "jenkins/system/delete_old_containers.sh ${container_name_prefix}"
63 if ( params.BUILD_FROM_SOURCE )
65 from_source = '--source'
69 export OSM_USE_LOCAL_DEVOPS=true
70 jenkins/host/start_build system --build-container ${container_name} \
71 -b ${params.COMMIT_ID} \
72 -r ${params.REPO_DISTRO} \
73 -u ${params.REPO_BASE_URL} \
74 -k ${params.REPO_KEY_NAME} \
75 -R ${params.RELEASE} \
80 stage("Archive Artifacts") {
81 sh "echo ${container_name} > build_version.txt"
82 sh "tar -zcvf repo.tar.gz repo"
83 archiveArtifacts artifacts: "build_version.txt, repo.tar.gz", fingerprint: true