then copy tar

This commit is contained in:
Naveenraj M
2020-03-29 21:18:32 +05:30
parent 1c5fc49e9e
commit 19699bb4d7
2 changed files with 18 additions and 6 deletions

View File

@ -29,13 +29,17 @@ function run() {
// Copy spec file from path specFile to /root/rpmbuild/SPECS/
yield io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/');
// Get tar.gz file of release
const tarBallPath = yield download_tar(owner, repo, ref);
console.log(`Tar Path for copy : ${tarBallPath}`);
yield download_tar(owner, repo, ref).then(function (filePath) {
io.cp(filePath, '/root/rpmbuild/SOURCES');
}).catch(function (error) {
console.log(error);
});
//console.log(`Tar Path for copy : ${tarBallPath}`);
// Get repo files from /github/workspace/
yield exec.exec('ls -la ');
// Copy tar.gz file to /root/rpmbuild/SOURCES
// make sure the name of tar.gz is same as given in Source of spec file
yield io.cp(tarBallPath, '/root/rpmbuild/SOURCES');
//await io.cp(tarBallPath, '/root/rpmbuild/SOURCES');
// Execute rpmbuild
try {
yield exec.exec(`rpmbuild -ba ${specFile}`);

View File

@ -26,16 +26,24 @@ async function run() {
await io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/');
// Get tar.gz file of release
const tarBallPath = await download_tar(owner, repo, ref);
await download_tar(
owner,
repo,
ref
).then( function(filePath){
io.cp(filePath, '/root/rpmbuild/SOURCES');
}).catch(function(error){
console.log(error);
});
console.log(`Tar Path for copy : ${tarBallPath}`);
//console.log(`Tar Path for copy : ${tarBallPath}`);
// Get repo files from /github/workspace/
await exec.exec('ls -la ');
// Copy tar.gz file to /root/rpmbuild/SOURCES
// make sure the name of tar.gz is same as given in Source of spec file
await io.cp(tarBallPath, '/root/rpmbuild/SOURCES');
//await io.cp(tarBallPath, '/root/rpmbuild/SOURCES');
// Execute rpmbuild
try {