sh "useradd -o -u $UID -d `pwd` -r -g jenkins jenkins"
sh "echo '#! /bin/sh' > /usr/bin/mesg"
sh "chmod 755 /usr/bin/mesg"
- sh "runuser -l jenkins -c devops-stages/stage-test.sh"
+ sh "runuser jenkins -c devops-stages/stage-test.sh"
if (fileExists('coverage.xml')) {
cobertura coberturaReportFile: 'coverage.xml'
}
}
stage('Build') {
sh(returnStdout:true,
- script: "runuser -l $USER -c devops-stages/stage-build.sh").trim()
+ script: "runuser jenkins -c devops-stages/stage-build.sh").trim()
}
stage('Archive') {
- sh "runuser -l jenkins -c 'mkdir -p changelog'"
- sh "runuser -l jenkins -c \"tools/generatechangelog-pipeline.sh > changelog/changelog-${mdg}.html\""
+ sh "runuser jenkins -c 'mkdir -p changelog'"
+ sh "runuser jenkins -c \"devops/tools/generatechangelog-pipeline.sh > changelog/changelog-${mdg}.html\""
sh(returnStdout:true,
- script: "runuser -l jenkins -c devops-stages/stage-archive.sh").trim()
+ script: "runuser jenkins -c devops-stages/stage-archive.sh").trim()
ci_helper.archive(artifactory_server,mdg,branch,'untested')
}
}
step ([$class: 'CopyArtifact',
projectName: "${params.UPSTREAM_JOB_NAME}",
- selector: [$class: 'SpecificBuildSelector', buildNumber: "${params.UPSTREAM_JOB_NUMBER}"]
+ selector: [$class: 'SpecificBuildSelector',
+ buildNumber: "${params.UPSTREAM_JOB_NUMBER}"]
])
- upstreamComponent = ci_helper.get_mdg_from_project(ci_helper.get_env_value('build.env','GERRIT_PROJECT'))
-
- // the upstream job name contains suffix with the project. Need this stripped off
- def project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0]
- def packages = ci_helper.get_archive(params.ARTIFACTORY_SERVER,
- upstreamComponent,
- GERRIT_BRANCH,
- "${project_without_branch} :: ${GERRIT_BRANCH}",
- ci_helper.get_env_value('build.env','BUILD_NUMBER'))
-
- packageList.addAll(packages)
- println("${params.UPSTREAM_JOB_NAME}: ${packages}")
+ upstreamComponent = ci_helper.get_mdg_from_project(
+ ci_helper.get_env_value('build.env','GERRIT_PROJECT'))
+ def buildNumber = ci_helper.get_env_value('build.env','BUILD_NUMBER')
+ dir("$upstreamComponent") {
+ // the upstream job name contains suffix with the project. Need this stripped off
+ def project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0]
+ def packages = ci_helper.get_archive(params.ARTIFACTORY_SERVER,
+ upstreamComponent,
+ GERRIT_BRANCH,
+ "${project_without_branch} :: ${GERRIT_BRANCH}",
+ buildNumber)
+
+ packageList.addAll(packages)
+ println("Fetched pre-merge ${params.UPSTREAM_JOB_NAME}: ${packages}")
+ }
}
parallelSteps = [:]
parallel parallelSteps
///////////////////////////////////////////////////////////////////////////////////////
-// Create APT repository
+// Create Devops APT repository
///////////////////////////////////////////////////////////////////////////////////////
- for ( component in [ "devops" ] ) {
- sh "mv ${component}/pool/${component} pool"
- sh "dpkg-sig --sign builder -k ${GPG_KEY_NAME} pool/${component}/*"
- 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"
- }
+ sh "mv devops/pool/ pool"
+ sh "dpkg-sig --sign builder -k ${GPG_KEY_NAME} pool/devops/*"
+ sh "mkdir -p dists/${params.REPO_DISTRO}/devops/binary-amd64/"
+ sh "apt-ftparchive packages pool/devops > dists/${params.REPO_DISTRO}/devops/binary-amd64/Packages"
+ sh "gzip -9fk dists/${params.REPO_DISTRO}/devops/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 ${GPG_KEY_NAME} -o dists/${params.REPO_DISTRO}/Release.gpg dists/${params.REPO_DISTRO}/Release"