Exemple #1
0
        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);
            }));
        }
Exemple #2
0
        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);
            }));
        }
Exemple #3
0
        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
                }
            }));
        }
Exemple #4
0
        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
                }
            }));
        }