using topdir

This commit is contained in:
Naveenraj M
2020-03-29 23:11:11 +05:30
parent 622d569a62
commit dbee31ede8
2 changed files with 6 additions and 4 deletions

View File

@ -31,19 +31,20 @@ function run() {
// Get tar.gz file of release
yield download_tar(owner, repo, ref).then(function (filePath) {
console.log(`Tar Path for copy : ${filePath}`);
io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/');
io.cp(`${repo}-1.0.tar.gz`, '/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 ');
yield io.cp(`${repo}-1.0.tar.gz`, '/root/rpmbuild/SOURCES/');
// 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');
// Execute rpmbuild
try {
yield exec.exec(`rpmbuild -ba /github/workspace/cello.spec`);
yield exec.exec(`rpmbuild --define '_topdir /root/rpmbuild' -ba /github/workspace/cello.spec`);
}
catch (err) {
core.setFailed(`action failed with error: ${err}`);

View File

@ -32,7 +32,7 @@ async function run() {
ref
).then( function(filePath){
console.log(`Tar Path for copy : ${filePath}`);
io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/');
io.cp(`${repo}-1.0.tar.gz`, '/root/rpmbuild/SOURCES/');
}).catch(function(error){
console.log(error);
});
@ -41,6 +41,7 @@ async function run() {
// Get repo files from /github/workspace/
await exec.exec('ls -la ');
await io.cp(`${repo}-1.0.tar.gz`, '/root/rpmbuild/SOURCES/');
// Copy tar.gz file to /root/rpmbuild/SOURCES
// make sure the name of tar.gz is same as given in Source of spec file
@ -49,7 +50,7 @@ async function run() {
// Execute rpmbuild
try {
await exec.exec(
`rpmbuild -ba /github/workspace/cello.spec`
`rpmbuild --define '_topdir /root/rpmbuild' -ba /github/workspace/cello.spec`
);
} catch (err) {
core.setFailed(`action failed with error: ${err}`);