Skip to content

Commit b8c8d00

Browse files
committed
(build) cleaning up credentials
1 parent 80d8af1 commit b8c8d00

File tree

11 files changed

+2
-61
lines changed

11 files changed

+2
-61
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
env:
16+
GITHUB_USERNAME: ${{ github.repository_owner }}
1617
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17-
GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }}
1818
steps:
1919
-
2020
name: Checkout

build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Cake.Common.Tools.MSBuild;
77
using Cake.Core;
88
using Cake.Core.Diagnostics;
9-
using Cake.Core.IO;
109
using Cake.Frosting;
1110
using Common.Utilities;
1211

build/common/Utilities/Models.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ public record CodeCovCredentials(string Token);
99

1010
public record GitHubCredentials(string UserName, string Token);
1111

12-
public record GitterCredentials(string Token, string RoomId);
13-
14-
public record DockerCredentials(string UserName, string Password);
15-
1612
public record NugetCredentials(string ApiKey, string ApiUrl);
1713

1814
public record ChocolateyCredentials(string ApiKey, string ApiUrl);

build/docker/BuildContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
using System.Collections.Generic;
22
using Cake.Core;
33
using Common.Utilities;
4-
using Docker.Utilities;
54

65
namespace Docker
76
{
87
public class BuildContext : BuildContextBase
98
{
109
public bool IsDockerOnLinux { get; set; }
1110

12-
public Credentials? Credentials { get; set; }
1311
public IEnumerable<DockerImage> Images { get; set; } = new List<DockerImage>();
1412

1513
public BuildContext(ICakeContext context) : base(context)

build/docker/BuildLifetime.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Cake.Common.Diagnostics;
44
using Cake.Docker;
55
using Common.Utilities;
6-
using Docker.Utilities;
76
using Constants = Common.Utilities.Constants;
87

98
namespace Docker
@@ -29,7 +28,6 @@ from distro in distros
2928
select new DockerImage(distro, version, registry, false);
3029

3130
context.StartGroup("Build Setup");
32-
context.Credentials = Credentials.GetCredentials(context, dockerRegistry);
3331

3432
LogBuildInformation(context);
3533

build/docker/Tasks/DockerBuild.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Cake.Common.IO;
2-
using Cake.Core.IO;
32
using Cake.Frosting;
43
using Common.Utilities;
54

build/docker/Tasks/DockerPublish.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using Cake.Frosting;
32
using Common.Utilities;
43

@@ -37,18 +36,6 @@ public override bool ShouldRun(BuildContext context)
3736

3837
public override void Run(BuildContext context)
3938
{
40-
var username = context.Credentials?.Docker?.UserName;
41-
if (string.IsNullOrEmpty(username))
42-
{
43-
throw new InvalidOperationException("Could not resolve Docker user name.");
44-
}
45-
46-
var password = context.Credentials?.Docker?.Password;
47-
if (string.IsNullOrEmpty(password))
48-
{
49-
throw new InvalidOperationException("Could not resolve Docker password.");
50-
}
51-
5239
foreach (var dockerImage in context.Images)
5340
{
5441
context.DockerPush(dockerImage);

build/docker/Utilities/Credentials.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

build/docker/docker.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<RootNamespace>Docker</RootNamespace>
55
</PropertyGroup>
66
<ItemGroup>
7-
<ProjectReference Include="..\common\common.csproj"/>
7+
<ProjectReference Include="..\common\common.csproj" />
88
</ItemGroup>
99
</Project>

build/publish/Utilities/Credentials.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@ namespace Publish.Utilities
77
public class Credentials
88
{
99
public GitHubCredentials? GitHub { get; private set; }
10-
public GitterCredentials? Gitter { get; private set; }
1110
public NugetCredentials? Nuget { get; private set; }
1211
public ChocolateyCredentials? Chocolatey { get; private set; }
1312

1413
public static Credentials GetCredentials(ICakeContext context) => new()
1514
{
16-
Gitter = new GitterCredentials(
17-
context.EnvironmentVariable("GITTER_TOKEN"),
18-
context.EnvironmentVariable("GITTER_ROOM_ID")),
19-
2015
GitHub = new GitHubCredentials(
2116
context.EnvironmentVariable("GITHUB_USERNAME"),
2217
context.EnvironmentVariable("GITHUB_TOKEN")),

0 commit comments

Comments
 (0)