Decompose Crossgen, remove CleanPublishOutput, replace ExtractArchive with *FileExtractToDirectory (#3927)
* Eliminate CleanPublishOutput * Decompose Crossgen Task * WiP * TarGzFileExtractToDirectory * FixModeFlags --> CHMod Also various eliminations of dead code * Tasks cleanup Move all tasks to .tasks file. There is little value in keepint them in each source file as they are already being used assumptively by files that happen to get executed later. Also eliminating uses of <Exec> for DotNet invocations * Move to BuildTools implementation of TarGzCreateFromDirectory * Eliminate Command.cs and helpers * Remove dead code * Revert TarGz from BuildTools Latest build tools package has not picked up the task, though it is checked in. * Disable ChMod on Windows * Windows bug fix * PR Feedback * Finish changing Chmod caps
This commit is contained in:
parent
ee8a01b8d6
commit
5ebc6a1ceb
50 changed files with 827 additions and 1645 deletions
|
@ -1,55 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using Microsoft.DotNet.Cli.Build.Framework;
|
||||
using Microsoft.WindowsAzure.Storage;
|
||||
using Microsoft.WindowsAzure.Storage.Blob;
|
||||
|
||||
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public class DebRepoPublisher
|
||||
{
|
||||
private const string _debianRevisionNumber = "1";
|
||||
private string _repoID;
|
||||
private string _uploadJsonDirectory;
|
||||
|
||||
public DebRepoPublisher(string uploadJsonDirectory)
|
||||
{
|
||||
_uploadJsonDirectory = uploadJsonDirectory;
|
||||
_repoID = Environment.GetEnvironmentVariable("REPO_ID");
|
||||
}
|
||||
|
||||
public void PublishDebFileToDebianRepo(string packageName, string packageVersion, string uploadUrl)
|
||||
{
|
||||
var uploadJson = GenerateUploadJsonFile(packageName, packageVersion, uploadUrl);
|
||||
|
||||
Cmd(Path.Combine(Dirs.RepoRoot, "scripts", "publish", "repoapi_client.sh"), "-addpkg", uploadJson)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
}
|
||||
|
||||
private string GenerateUploadJsonFile(string packageName, string packageVersion, string uploadUrl)
|
||||
{
|
||||
var uploadJson = Path.Combine(_uploadJsonDirectory, "package_upload.json");
|
||||
File.Delete(uploadJson);
|
||||
|
||||
using (var fileStream = File.Create(uploadJson))
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter(fileStream))
|
||||
{
|
||||
sw.WriteLine("{");
|
||||
sw.WriteLine($" \"name\":\"{packageName}\",");
|
||||
sw.WriteLine($" \"version\":\"{packageVersion}-{_debianRevisionNumber}\",");
|
||||
sw.WriteLine($" \"repositoryId\":\"{_repoID}\",");
|
||||
sw.WriteLine($" \"sourceUrl\":\"{uploadUrl}\"");
|
||||
sw.WriteLine("}");
|
||||
}
|
||||
}
|
||||
|
||||
return uploadJson;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue