mirror of
https://github.com/naveenrajm7/rpmbuild.git
synced 2025-07-12 20:23:50 +00:00
await till return
This commit is contained in:
@ -30,12 +30,12 @@ function download_archive(owner, repo, ref) {
|
||||
return console.log(err);
|
||||
}
|
||||
console.log("The Tar file was saved!");
|
||||
console.log(`Tarball Location : ${tarFile}`);
|
||||
return tarFile;
|
||||
});
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
console.log(`Tarball Location : ${tarFile}`);
|
||||
return tarFile;
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
10
lib/main.js
10
lib/main.js
@ -22,19 +22,17 @@ function run() {
|
||||
const repo = context.repo.repo;
|
||||
const ref = context.ref;
|
||||
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
||||
const tarBallPath = yield download_tar(owner, repo, ref);
|
||||
console.log(`Tar Path for copy : ${tarBallPath}`);
|
||||
const specFile = core.getInput('specFile');
|
||||
console.log(`Hello ${specFile} from inside a container`);
|
||||
// Get repo files from /github/workspace/
|
||||
yield exec.exec('ls -la /github/workspace');
|
||||
// Get repo files from /github/workspace/
|
||||
yield exec.exec('ls -la ');
|
||||
// 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
|
||||
// 1. Write API call to download tar.gz from release OR
|
||||
// 2. Create tar.gz of /github/workspace to get tar of source code
|
||||
const tarBallPath = yield download_tar(owner, repo, ref);
|
||||
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');
|
||||
|
@ -26,14 +26,14 @@ async function download_archive(owner, repo, ref ) {
|
||||
return console.log(err);
|
||||
}
|
||||
console.log("The Tar file was saved!");
|
||||
console.log(`Tarball Location : ${tarFile}`);
|
||||
return tarFile;
|
||||
});
|
||||
}).catch( function(error){
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
console.log(`Tarball Location : ${tarFile}`);
|
||||
|
||||
return tarFile;
|
||||
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
17
src/main.ts
17
src/main.ts
@ -16,16 +16,9 @@ async function run() {
|
||||
|
||||
console.log(`We can even get context data, like the owner: ${owner}, repo: ${repo}, ref: ${ref}`);
|
||||
|
||||
const tarBallPath = await download_tar(owner, repo, ref);
|
||||
|
||||
console.log(`Tar Path for copy : ${tarBallPath}`);
|
||||
|
||||
const specFile = core.getInput('specFile');
|
||||
console.log(`Hello ${specFile} from inside a container`);
|
||||
|
||||
// Get repo files from /github/workspace/
|
||||
await exec.exec('ls -la /github/workspace');
|
||||
|
||||
// Get repo files from /github/workspace/
|
||||
await exec.exec('ls -la ');
|
||||
|
||||
@ -33,8 +26,12 @@ async function run() {
|
||||
await io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/');
|
||||
|
||||
// Get tar.gz file of release
|
||||
// 1. Write API call to download tar.gz from release OR
|
||||
// 2. Create tar.gz of /github/workspace to get tar of source code
|
||||
const tarBallPath = await download_tar(owner, repo, ref);
|
||||
|
||||
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
|
||||
@ -58,8 +55,6 @@ async function run() {
|
||||
//core.setOutput("rpmPath", rpmPath)
|
||||
//core.setOutput("sourceRpmPath", sourceRpmPath) // make option to upload source rpm
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user