public async Task <IAsyncDisposable> AddBuildToChannelAsync(int buildId, string channelName) { await RunDarcAsync("add-build-to-channel", "--id", buildId.ToString(), "--channel", channelName, "--skip-assets-publishing"); return(AsyncDisposable.Create(async() => { TestContext.WriteLine($"Removing build {buildId} from channel {channelName}"); await RunDarcAsync("delete-build-from-channel", "--id", buildId.ToString(), "--channel", channelName); })); }
public async Task <IAsyncDisposable> PushGitBranchAsync(string remote, string branch) { await RunGitAsync("push", remote, branch); return(AsyncDisposable.Create(async() => { TestContext.WriteLine($"Cleaning up Remote branch {branch}"); await RunGitAsync("push", remote, "--delete", branch); })); }
public async Task <IAsyncDisposable> CheckoutBranchAsync(string branchName) { await RunGitAsync("fetch", "origin"); await RunGitAsync("checkout", "-b", branchName); return(AsyncDisposable.Create(async() => { TestContext.WriteLine($"Deleting remote branch {branchName}"); try { await DeleteBranchAsync(branchName); } catch { // If this throws it means that it was cleaned up by a different clean up method first } })); }
public async Task <IAsyncDisposable> PushGitBranchAsync(string remote, string branch) { await RunGitAsync("push", "-u", remote, branch); return(AsyncDisposable.Create(async() => { TestContext.WriteLine($"Cleaning up Remote branch {branch}"); try { await RunGitAsync("push", remote, "--delete", branch); } catch { // If this throws it means that it was cleaned up by a different clean up method first } })); }