X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fsystem%2FJenkinsfile;h=c3dcc0acaa80e52cb2cde3b2a6441879d4c8e2d0;hb=425f8cef392f81356280f6508384ac397aa2eb85;hp=d3688c43ca899e093cd3640ed6ae8316bd9d4421;hpb=15f4f2295c6807d857f9b61ce291119a0a46d11f;p=osm%2Fdevops.git diff --git a/jenkins/system/Jenkinsfile b/jenkins/system/Jenkinsfile index d3688c43..c3dcc0ac 100644 --- a/jenkins/system/Jenkinsfile +++ b/jenkins/system/Jenkinsfile @@ -1,7 +1,13 @@ // input parameters: // boolean: BUILD_FROM_SOURCE +// boolean: REPO_DISTRO // boolean: COMMIT_ID +// boolean: UPSTREAM_SUFFIX // string: NODE +// string: RSYNC_DESTINATION +// string: REPO_BASE_URL +// string: REPO_KEY_NAME +// string: RELEASE node("${params.NODE}") { @@ -11,6 +17,42 @@ node("${params.NODE}") { container_name = "${container_name_prefix}-${BUILD_NUMBER}" } + stage("Checkout") { + checkout scm + } + + // Copy the artifacts from the upstream jobs + stage("Copy Artifacts") { + // cleanup any previous repo + sh 'rm -rf repo' + + dir('repo') { + // grab all stable upstream builds based on the + // given target UPSTREAM_SUFFIX + + def list = ["SO", "UI", "RO", "openvim", "osmclient"] + for (component in list) { + step ([$class: 'CopyArtifact', + projectName: "${component}_${params.UPSTREAM_SUFFIX}"]) + sh "dpkg-sig --sign builder -k dpkg1 pool/${component}/*" + // cleanup any prevously defined dists + sh "rm -rf dists" + } + + // now create the distro + for (component in list) { + sh "mkdir -p dists/${params.REPO_DISTRO}/${component}/binary-amd64/" + sh "apt-ftparchive packages pool/${component} > dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages" + sh "gzip -9fk dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages" + } + + // create and sign the release file + sh "apt-ftparchive release dists/${params.REPO_DISTRO} > dists/${params.REPO_DISTRO}/Release" + sh "gpg --yes -abs -u dpkg1 -o dists/${params.REPO_DISTRO}/Release.gpg dists/${params.REPO_DISTRO}/Release" + sh "rsync -avz . ${params.RSYNC_DESTINATION}/${params.RELEASE}" + } + } + stage("Cleanup") { // check for previous containers and clean them up sh "jenkins/system/delete_old_containers.sh ${container_name_prefix}" @@ -22,9 +64,22 @@ node("${params.NODE}") { { from_source = '--source' } + + sh """ + export OSM_USE_LOCAL_DEVOPS=true + jenkins/host/start_build system --build-container ${container_name} \ + -b ${params.COMMIT_ID} \ + -r ${params.REPO_DISTRO} \ + -u ${params.REPO_BASE_URL} \ + -k ${params.REPO_KEY_NAME} \ + -R ${params.RELEASE} \ + ${from_source} + """ + } - sh "jenkins/host/start_build system --build-container ${container_name} -b ${params.COMMIT_ID} ${from_source}" + stage("Archive Artifacts") { sh "echo ${container_name} > build_version.txt" - archiveArtifacts artifacts: "build_version.txt" + sh "tar -zcvf repo.tar.gz repo" + archiveArtifacts artifacts: "build_version.txt, repo.tar.gz" } }