Use credential agent to supply password
This commit is contained in:
parent
b397a0722b
commit
36b9f2e187
1 changed files with 5 additions and 1 deletions
|
|
@ -64,12 +64,14 @@ def DebRootDefinition debDefinition(String rootpath, String packagesourceroot, S
|
|||
return new DebRootDefinition(rootpath, packagesourceroot, packageprefix, buildstamp, inpackagepathsuffix)
|
||||
}
|
||||
|
||||
def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs) {
|
||||
def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs, String password) {
|
||||
try {
|
||||
sh """#!/bin/bash
|
||||
# Exit if any command fails
|
||||
set -xe
|
||||
|
||||
echo "${password}" | sudo -S echo
|
||||
|
||||
cp -v -r "${packagedefs.PACKAGE_SOURCE_ROOT}/${packagedefs.PACKAGE_SOURCE_FOLDER_NAME}"/* "${packagedefs.DEBPATH}"
|
||||
|
||||
sudo chown -v -R root: "${packagedefs.DEBPATH}"
|
||||
|
|
@ -95,6 +97,8 @@ def buildPackage(String packageout, String uniquepackageout, DebRootDefinition p
|
|||
catch (Exception e) {
|
||||
echo "Exception occurred"
|
||||
sh """#!/bin/bash -v
|
||||
echo "${password}" | sudo -S echo
|
||||
|
||||
sudo chown -R ${USER}: "${packagedefs.DEBPATH}"
|
||||
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue