specifying spec file

This commit is contained in:
Naveenraj M
2020-03-29 21:29:31 +05:30
parent 19699bb4d7
commit 9127a2bbc2
2 changed files with 8 additions and 4 deletions

View File

@ -30,6 +30,7 @@ function run() {
yield io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/'); yield io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/');
// Get tar.gz file of release // Get tar.gz file of release
yield download_tar(owner, repo, ref).then(function (filePath) { yield download_tar(owner, repo, ref).then(function (filePath) {
console.log(`Tar Path for copy : ${filePath}`);
io.cp(filePath, '/root/rpmbuild/SOURCES'); io.cp(filePath, '/root/rpmbuild/SOURCES');
}).catch(function (error) { }).catch(function (error) {
console.log(error); console.log(error);
@ -42,18 +43,19 @@ function run() {
//await io.cp(tarBallPath, '/root/rpmbuild/SOURCES'); //await io.cp(tarBallPath, '/root/rpmbuild/SOURCES');
// Execute rpmbuild // Execute rpmbuild
try { try {
yield exec.exec(`rpmbuild -ba ${specFile}`); yield exec.exec(`rpmbuild -ba /github/workspace/cello.spec`);
} }
catch (err) { catch (err) {
core.setFailed(`action failed with error: ${err}`); core.setFailed(`action failed with error: ${err}`);
} }
// Get path for rpm // Get path for rpm
//const rpmPath = await exec.exec('node', ['index.js', 'foo=bar'], options); //const rpmPath = await exec.exec('node', ['index.js', 'foo=bar'], options);
yield exec.exec('ls /root/rpmbuild/RPMS');
// setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like // setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like
// actions/upload-release-asset // actions/upload-release-asset
// If you want to upload yourself , need to write api call to upload as asset // If you want to upload yourself , need to write api call to upload as asset
//core.setOutput("rpmPath", rpmPath) //core.setOutput("rpmPath", rpmPath)
//core.setOutput("sourceRpmPath", sourceRpmPath) // make option to upload source rpm core.setOutput("source_rpm_path", "/root/rpmbuild/SRPMS"); // make option to upload source rpm
} }
catch (error) { catch (error) {
core.setFailed(error.message); core.setFailed(error.message);

View File

@ -31,6 +31,7 @@ async function run() {
repo, repo,
ref ref
).then( function(filePath){ ).then( function(filePath){
console.log(`Tar Path for copy : ${filePath}`);
io.cp(filePath, '/root/rpmbuild/SOURCES'); io.cp(filePath, '/root/rpmbuild/SOURCES');
}).catch(function(error){ }).catch(function(error){
console.log(error); console.log(error);
@ -48,7 +49,7 @@ async function run() {
// Execute rpmbuild // Execute rpmbuild
try { try {
await exec.exec( await exec.exec(
`rpmbuild -ba ${specFile}` `rpmbuild -ba /github/workspace/cello.spec`
); );
} catch (err) { } catch (err) {
core.setFailed(`action failed with error: ${err}`); core.setFailed(`action failed with error: ${err}`);
@ -56,12 +57,13 @@ async function run() {
// Get path for rpm // Get path for rpm
//const rpmPath = await exec.exec('node', ['index.js', 'foo=bar'], options); //const rpmPath = await exec.exec('node', ['index.js', 'foo=bar'], options);
await exec.exec('ls /root/rpmbuild/RPMS');
// setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like // setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like
// actions/upload-release-asset // actions/upload-release-asset
// If you want to upload yourself , need to write api call to upload as asset // If you want to upload yourself , need to write api call to upload as asset
//core.setOutput("rpmPath", rpmPath) //core.setOutput("rpmPath", rpmPath)
//core.setOutput("sourceRpmPath", sourceRpmPath) // make option to upload source rpm core.setOutput("source_rpm_path", "/root/rpmbuild/SRPMS") // make option to upload source rpm
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);