using curl to get archive

This commit is contained in:
Naveenraj M
2020-03-30 00:33:05 +05:30
parent d031b9a6f9
commit ab399dde5d
2 changed files with 24 additions and 18 deletions

View File

@ -30,17 +30,22 @@ function run() {
// Copy spec file from path specFile to /root/rpmbuild/SPECS/ // Copy spec file from path specFile to /root/rpmbuild/SPECS/
yield io.cp('/github/workspace/cello.spec', '/github/home/rpmbuild/SPECS/'); yield io.cp('/github/workspace/cello.spec', '/github/home/rpmbuild/SPECS/');
// Get tar.gz file of release // Get tar.gz file of release
yield download_tar(owner, repo, ref).then(function (filePath) { // await download_tar(
console.log(`Tar Path for copy : ${filePath}`); // owner,
io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/'); // repo,
}).catch(function (error) { // ref
console.log(error); // ).then( function(filePath){
}); // console.log(`Tar Path for copy : ${filePath}`);
// io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/');
// }).catch(function(error){
// console.log(error);
// });
yield exec.exec('curl -L --output cello-1.0.0.tar.gz https://github.com/naveenrajm7/cello/archive/v1.0.0.tar.gz');
//console.log(`Tar Path for copy : ${tarBallPath}`); //console.log(`Tar Path for copy : ${tarBallPath}`);
yield exec.exec('echo "$HOME"'); yield exec.exec('echo "$HOME"');
// Get repo files from /github/workspace/ // Get repo files from /github/workspace/
yield exec.exec('ls -la '); yield exec.exec('ls -la ');
yield io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/'); yield io.cp(`${repo}-1.0.0.tar.gz`, '/github/home/rpmbuild/SOURCES/');
// Copy tar.gz file to /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 // 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');

View File

@ -28,23 +28,24 @@ async function run() {
await io.cp('/github/workspace/cello.spec', '/github/home/rpmbuild/SPECS/'); await io.cp('/github/workspace/cello.spec', '/github/home/rpmbuild/SPECS/');
// Get tar.gz file of release // Get tar.gz file of release
await download_tar( // await download_tar(
owner, // owner,
repo, // repo,
ref // ref
).then( function(filePath){ // ).then( function(filePath){
console.log(`Tar Path for copy : ${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`, '/github/home/rpmbuild/SOURCES/');
}).catch(function(error){ // }).catch(function(error){
console.log(error); // console.log(error);
}); // });
await exec.exec('curl -L --output cello-1.0.0.tar.gz https://github.com/naveenrajm7/cello/archive/v1.0.0.tar.gz')
//console.log(`Tar Path for copy : ${tarBallPath}`); //console.log(`Tar Path for copy : ${tarBallPath}`);
await exec.exec('echo "$HOME"'); await exec.exec('echo "$HOME"');
// Get repo files from /github/workspace/ // Get repo files from /github/workspace/
await exec.exec('ls -la '); await exec.exec('ls -la ');
await io.cp(`${repo}-1.0.tar.gz`, '/github/home/rpmbuild/SOURCES/'); await io.cp(`${repo}-1.0.0.tar.gz`, '/github/home/rpmbuild/SOURCES/');
// Copy tar.gz file to /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 // make sure the name of tar.gz is same as given in Source of spec file